mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' into molecularDynamics
This commit is contained in:
@ -0,0 +1,3 @@
|
||||
kinematicParcelFoam.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/kinematicParcelFoam
|
||||
@ -0,0 +1,21 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
|
||||
-I$(LIB_SRC)/lagrangian/intermediate/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/combustion/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels/RAS
|
||||
|
||||
EXE_LIBS = \
|
||||
-llagrangian \
|
||||
-llagrangianIntermediate \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools \
|
||||
-lthermophysicalFunctions \
|
||||
-lbasicThermophysicalModels \
|
||||
/* -lcombustionThermophysicalModels */ \
|
||||
-lspecie \
|
||||
-lradiation \
|
||||
-lcompressibleRASModels
|
||||
@ -0,0 +1,68 @@
|
||||
Info<< "Reading thermophysical properties\n" << endl;
|
||||
|
||||
autoPtr<basicThermo> thermo
|
||||
(
|
||||
basicThermo::New(mesh)
|
||||
);
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"rho",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::NO_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
thermo->rho()
|
||||
);
|
||||
|
||||
Info<< "\nReading field U\n" << endl;
|
||||
volVectorField U
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
runTime.timeName(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
|
||||
# include "compressibleCreatePhi.H"
|
||||
|
||||
Info<< "Creating turbulence model\n" << endl;
|
||||
autoPtr<compressible::RASModel> turbulence
|
||||
(
|
||||
compressible::RASModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
thermo()
|
||||
)
|
||||
);
|
||||
|
||||
pointMesh pMesh(mesh);
|
||||
volPointInterpolation vpi(mesh, pMesh);
|
||||
|
||||
word kinematicCloudName("kinematicCloud");
|
||||
|
||||
if (args.options().found("cloudName"))
|
||||
{
|
||||
kinematicCloudName = args.options()["cloudName"];
|
||||
}
|
||||
|
||||
Info<< "Constructing kinematicCloud " << kinematicCloudName << endl;
|
||||
basicKinematicCloud kinematicCloud
|
||||
(
|
||||
kinematicCloudName,
|
||||
vpi,
|
||||
rho,
|
||||
U,
|
||||
thermo().mu(),
|
||||
g
|
||||
);
|
||||
@ -0,0 +1,78 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 1991-2008 OpenCFD Ltd.
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
|
||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
|
||||
Application
|
||||
kinematicParcelFoam
|
||||
|
||||
Description
|
||||
Transient solver a single kinematicCloud.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "basicThermo.H"
|
||||
#include "compressible/RASModel/RASModel.H"
|
||||
#include "basicKinematicCloud.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
argList::validOptions.insert("cloudName", "cloud name");
|
||||
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
#include "createMesh.H"
|
||||
#include "readEnvironmentalProperties.H"
|
||||
#include "createFields.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
|
||||
while (runTime.run())
|
||||
{
|
||||
runTime++;
|
||||
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
Info<< "Evolving " << kinematicCloud.name() << endl;
|
||||
kinematicCloud.evolve();
|
||||
kinematicCloud.info();
|
||||
|
||||
runTime.write();
|
||||
|
||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
}
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return(0);
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -16,12 +16,13 @@ if (transonic)
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
{
|
||||
fvScalarMatrix pEqn0
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::div(phid, p)
|
||||
- fvm::laplacian(rho*rUA, p)
|
||||
);
|
||||
fvScalarMatrix pEqn = pEqn0;
|
||||
|
||||
// Relax the pressure equation to ensure diagonal-dominance
|
||||
pEqn.relax(mesh.relaxationFactor("pEqn"));
|
||||
|
||||
pEqn.setReference(pRefCell, pRefValue);
|
||||
@ -39,14 +40,13 @@ if (transonic)
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
{
|
||||
phi == pEqn0.flux();
|
||||
phi == pEqn.flux();
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
phi = fvc::interpolate(rho)*(fvc::interpolate(U) & mesh.Sf());
|
||||
//phi = fvc::interpolate(rho*U) & mesh.Sf();
|
||||
closedVolume = adjustPhi(phi, U, p);
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
@ -58,7 +58,7 @@ else
|
||||
|
||||
pEqn.setReference(pRefCell, pRefValue);
|
||||
|
||||
// retain the residual from the first iteration
|
||||
// Retain the residual from the first iteration
|
||||
if (nonOrth == 0)
|
||||
{
|
||||
eqnResidual = pEqn.solve().initialResidual();
|
||||
|
||||
@ -1,4 +1,6 @@
|
||||
EXE_INC = \
|
||||
-I../rasInterFoam \
|
||||
-I../interFoam \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
|
||||
|
||||
@ -1,34 +0,0 @@
|
||||
surfaceScalarField muEff
|
||||
(
|
||||
"muEff",
|
||||
twoPhaseProperties.muf()
|
||||
+ fvc::interpolate(rho*turbulence->nut())
|
||||
);
|
||||
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(rho, U)
|
||||
+ fvm::div(rhoPhi, U)
|
||||
- fvm::laplacian(muEff, U)
|
||||
- (fvc::grad(U) & fvc::grad(muEff))
|
||||
//- fvc::div(muEff*(fvc::interpolate(dev(fvc::grad(U))) & mesh.Sf()))
|
||||
);
|
||||
|
||||
UEqn.relax();
|
||||
|
||||
if (momentumPredictor)
|
||||
{
|
||||
solve
|
||||
(
|
||||
UEqn
|
||||
==
|
||||
fvc::reconstruct
|
||||
(
|
||||
(
|
||||
fvc::interpolate(interface.sigmaK())*fvc::snGrad(gamma)
|
||||
- ghf*fvc::snGrad(rho)
|
||||
- fvc::snGrad(pd)
|
||||
)*mesh.magSf()
|
||||
)
|
||||
);
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
{
|
||||
word gammaScheme("div(phi,gamma)");
|
||||
word gammarScheme("div(phirb,gamma)");
|
||||
|
||||
surfaceScalarField phic = mag(phi/mesh.magSf());
|
||||
phic = min(interface.cGamma()*phic, max(phic));
|
||||
surfaceScalarField phir = phic*interface.nHatf();
|
||||
|
||||
for (int gCorr=0; gCorr<nGammaCorr; gCorr++)
|
||||
{
|
||||
surfaceScalarField phiGamma =
|
||||
fvc::flux
|
||||
(
|
||||
phi,
|
||||
gamma,
|
||||
gammaScheme
|
||||
)
|
||||
+ fvc::flux
|
||||
(
|
||||
-fvc::flux(-phir, scalar(1) - gamma, gammarScheme),
|
||||
gamma,
|
||||
gammarScheme
|
||||
);
|
||||
|
||||
MULES::explicitSolve(gamma, phi, phiGamma, 1, 0);
|
||||
|
||||
rhoPhi = phiGamma*(rho1 - rho2) + phi*rho2;
|
||||
}
|
||||
|
||||
Info<< "Liquid phase volume fraction = "
|
||||
<< gamma.weightedAverage(mesh.V()).value()
|
||||
<< " Min(gamma) = " << min(gamma).value()
|
||||
<< " Max(gamma) = " << max(gamma).value()
|
||||
<< endl;
|
||||
}
|
||||
@ -1,35 +0,0 @@
|
||||
label nGammaCorr
|
||||
(
|
||||
readLabel(piso.lookup("nGammaCorr"))
|
||||
);
|
||||
|
||||
label nGammaSubCycles
|
||||
(
|
||||
readLabel(piso.lookup("nGammaSubCycles"))
|
||||
);
|
||||
|
||||
if (nGammaSubCycles > 1)
|
||||
{
|
||||
dimensionedScalar totalDeltaT = runTime.deltaT();
|
||||
surfaceScalarField rhoPhiSum = 0.0*rhoPhi;
|
||||
|
||||
for
|
||||
(
|
||||
subCycle<volScalarField> gammaSubCycle(gamma, nGammaSubCycles);
|
||||
!(++gammaSubCycle).end();
|
||||
)
|
||||
{
|
||||
# include "gammaEqn.H"
|
||||
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
|
||||
}
|
||||
|
||||
rhoPhi = rhoPhiSum;
|
||||
}
|
||||
else
|
||||
{
|
||||
# include "gammaEqn.H"
|
||||
}
|
||||
|
||||
interface.correct();
|
||||
|
||||
rho == gamma*rho1 + (scalar(1) - gamma)*rho2;
|
||||
@ -41,7 +41,6 @@ Description
|
||||
#include "twoPhaseMixture.H"
|
||||
#include "incompressible/RASModel/RASModel.H"
|
||||
#include "probes.H"
|
||||
#include "EulerDdtScheme.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
Reference in New Issue
Block a user