MRG: Integrated Foundation code to commit 7d6845d

This commit is contained in:
Andrew Heather
2017-03-23 14:33:33 +00:00
595 changed files with 7175 additions and 11727 deletions

View File

@ -13,10 +13,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/solidChemistryModel/lnInclude \
-I$(LIB_SRC)/combustionModels/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
@ -38,9 +35,6 @@ EXE_LIBS = \
-lspecie \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lsolidProperties \
-lsolidMixtureProperties \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \
-lchemistryModel \

View File

@ -1,9 +1,10 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<rhoThermo> pThermo
autoPtr<fluidThermo> pThermo
(
rhoThermo::New(mesh)
fluidThermo::New(mesh)
);
rhoThermo& thermo = pThermo();
fluidThermo& thermo = pThermo();
thermo.validate(args.executable(), "h", "e");
volScalarField rho
@ -37,6 +38,7 @@ volVectorField U
#include "compressibleCreatePhi.H"
pressureControl pressureControl(p, rho, simple.dict());
label pRefCell = 0;
scalar pRefValue = 0.0;

View File

@ -10,20 +10,23 @@
if (simple.transonic())
{
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
surfaceScalarField rhof(fvc::interpolate(rho));
MRF.makeRelative(rhof, phiHbyA);
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)
*fvc::flux(HbyA)
(fvc::interpolate(psi)/rhof)*phiHbyA
);
MRF.makeRelative(fvc::interpolate(psi), phid);
phiHbyA -= fvc::interpolate(p)*phid;
while (simple.correctNonOrthogonal())
{
fvScalarMatrix pEqn
(
fvm::div(phid, p)
fvc::div(phiHbyA)
+ fvm::div(phid, p)
- fvm::laplacian(rhorAUf, p)
==
fvOptions(psi, p, rho.name())
@ -32,13 +35,17 @@
// Relax the pressure equation to ensure diagonal-dominance
pEqn.relax();
pEqn.setReference(pRefCell, pRefValue);
pEqn.setReference
(
pressureControl.refCell(),
pressureControl.refValue()
);
pEqn.solve();
if (simple.finalNonOrthogonalIter())
{
phi == pEqn.flux();
phi = phiHbyA + pEqn.flux();
}
}
}
@ -62,7 +69,11 @@
fvOptions(psi, p, rho.name())
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.setReference
(
pressureControl.refCell(),
pressureControl.refValue()
);
pEqn.solve();
@ -83,6 +94,8 @@
U.correctBoundaryConditions();
fvOptions.correct(U);
pressureControl.limit(p);
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity
if (closedVolume)
@ -91,9 +104,9 @@
/fvc::domainIntegrate(psi);
}
p.correctBoundaryConditions();
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
thermo.rho() = max(thermo.rho(), rhoMin);
thermo.rho() = min(thermo.rho(), rhoMax);
@ -102,8 +115,4 @@
{
rho.relax();
}
Info<< "rho max/min : "
<< max(rho).value() << " "
<< min(rho).value() << endl;
}

View File

@ -7,20 +7,19 @@ bool closedVolume = false;
if (simple.transonic())
{
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
surfaceScalarField rhof(fvc::interpolate(rho));
MRF.makeRelative(rhof, phiHbyA);
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)
*fvc::flux(HbyA)
(fvc::interpolate(psi)/rhof)*phiHbyA
);
MRF.makeRelative(fvc::interpolate(psi), phid);
surfaceScalarField phic
(
"phic",
phiHbyA +=
fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf()
);
- fvc::interpolate(p)*phid;
HbyA -= (rAU - rAtU)*fvc::grad(p);
@ -31,7 +30,7 @@ if (simple.transonic())
fvScalarMatrix pEqn
(
fvm::div(phid, p)
+ fvc::div(phic)
+ fvc::div(phiHbyA)
- fvm::laplacian(rhorAtU, p)
==
fvOptions(psi, p, rho.name())
@ -40,13 +39,17 @@ if (simple.transonic())
// Relax the pressure equation to maintain diagonal dominance
pEqn.relax();
pEqn.setReference(pRefCell, pRefValue);
pEqn.setReference
(
pressureControl.refCell(),
pressureControl.refValue()
);
pEqn.solve();
if (simple.finalNonOrthogonalIter())
{
phi == phic + pEqn.flux();
phi = phiHbyA + pEqn.flux();
}
}
}
@ -75,7 +78,11 @@ else
fvOptions(psi, p, rho.name())
);
pEqn.setReference(pRefCell, pRefValue);
pEqn.setReference
(
pressureControl.refCell(),
pressureControl.refValue()
);
pEqn.solve();
@ -97,6 +104,8 @@ U = HbyA - rAtU*fvc::grad(p);
U.correctBoundaryConditions();
fvOptions.correct(U);
pressureControl.limit(p);
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity
if (closedVolume)
@ -105,10 +114,10 @@ if (closedVolume)
/fvc::domainIntegrate(psi);
}
p.correctBoundaryConditions();
// Recalculate density from the relaxed pressure
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
thermo.rho() = max(thermo.rho(), rhoMin);
thermo.rho() = min(thermo.rho(), rhoMax);
@ -116,5 +125,3 @@ if (!simple.transonic())
{
rho.relax();
}
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;

View File

@ -1,26 +0,0 @@
{
volScalarField& he = thermo.he();
fvScalarMatrix EEqn
(
fvm::div(phi, he)
+ (
he.name() == "e"
? fvc::div(phi, volScalarField("Ekp", 0.5*magSqr(U) + p/rho))
: fvc::div(phi, volScalarField("K", 0.5*magSqr(U)))
)
- fvm::laplacian(turbulence->alphaEff(), he)
==
fvOptions(rho, he)
);
EEqn.relax();
fvOptions.constrain(EEqn);
EEqn.solve();
fvOptions.correct(he);
thermo.correct();
}

View File

@ -1,10 +1,10 @@
Info<< "Reading thermophysical properties\n" << endl;
autoPtr<rhoThermo> pThermo
autoPtr<fluidThermo> pThermo
(
rhoThermo::New(mesh)
fluidThermo::New(mesh)
);
rhoThermo& thermo = pThermo();
fluidThermo& thermo = pThermo();
thermo.validate(args.executable(), "h", "e");
volScalarField rho
@ -38,35 +38,10 @@ volVectorField U
#include "compressibleCreatePhi.H"
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, simple.dict(), pRefCell, pRefValue);
pressureControl pressureControl(p, rho, simple.dict());
mesh.setFluxRequired(p.name());
dimensionedScalar rhoMax
(
dimensionedScalar::lookupOrDefault
(
"rhoMax",
simple.dict(),
dimDensity,
GREAT
)
);
dimensionedScalar rhoMin
(
dimensionedScalar::lookupOrDefault
(
"rhoMin",
simple.dict(),
dimDensity,
0
)
);
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence
(

View File

@ -48,7 +48,11 @@
fvScalarMatrix& pEqn = tpEqn.ref();
pEqn.setReference(pRefCell, pRefValue);
pEqn.setReference
(
pressureControl.refCell(),
pressureControl.refValue()
);
pEqn.solve();
@ -75,6 +79,8 @@
U.correctBoundaryConditions();
fvOptions.correct(U);
pressureControl.limit(p);
// For closed-volume cases adjust the pressure and density levels
// to obey overall mass continuity
if (closedVolume)
@ -84,14 +90,9 @@
}
rho = thermo.rho();
rho = max(rho, rhoMin);
rho = min(rho, rhoMax);
thermo.rho() = max(thermo.rho(), rhoMin);
thermo.rho() = min(thermo.rho(), rhoMax);
rho.relax();
Info<< "rho max/min : "
<< max(rho).value() << " "
<< min(rho).value() << endl;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -34,11 +34,12 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "rhoThermo.H"
#include "fluidThermo.H"
#include "turbulentFluidThermoModel.H"
#include "simpleControl.H"
#include "pressureControl.H"
#include "fvOptions.H"
#include "IOporosityModelList.H"
#include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -33,9 +33,10 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "rhoThermo.H"
#include "fluidThermo.H"
#include "turbulentFluidThermoModel.H"
#include "simpleControl.H"
#include "pressureControl.H"
#include "fvOptions.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -25,7 +25,6 @@ EXE_LIBS = \
-llagrangian \
-llagrangianIntermediate \
-llagrangianTurbulence \
-lthermophysicalFunctions \
-lspecie \
-lradiationModels \
-lincompressibleTransportModels \

View File

@ -21,7 +21,6 @@ EXE_LIBS = \
-llagrangian \
-llagrangianIntermediate \
-llagrangianTurbulence \
-lthermophysicalFunctions \
-lspecie \
-lradiationModels \
-lincompressibleTransportModels \

View File

@ -10,10 +10,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
@ -38,11 +35,7 @@ EXE_LIBS = \
-lspecie \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \
-lsolidMixtureProperties \
-lthermophysicalFunctions \
-lthermophysicalProperties \
-lreactionThermophysicalModels \
-lSLGThermo \
-lchemistryModel \

View File

@ -19,7 +19,6 @@ EXE_LIBS = \
-llagrangian \
-llagrangianIntermediate \
-llagrangianTurbulence \
-lthermophysicalFunctions \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \

View File

@ -23,7 +23,6 @@ EXE_LIBS = \
-llagrangian \
-llagrangianIntermediate \
-llagrangianTurbulence \
-lthermophysicalFunctions \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \

View File

@ -9,10 +9,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
@ -36,9 +33,6 @@ EXE_LIBS = \
-lspecie \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lsolidProperties \
-lsolidMixtureProperties \
-lthermophysicalFunctions \
-lreactionThermophysicalModels \
-lSLGThermo \
-lchemistryModel \

View File

@ -11,10 +11,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
@ -39,11 +36,7 @@ EXE_LIBS = \
-lspecie \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \
-lsolidMixtureProperties \
-lthermophysicalFunctions \
-lthermophysicalProperties \
-lreactionThermophysicalModels \
-lSLGThermo \
-lchemistryModel \

View File

@ -11,10 +11,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
@ -39,11 +36,7 @@ EXE_LIBS = \
-lspecie \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \
-lsolidMixtureProperties \
-lthermophysicalFunctions \
-lthermophysicalProperties \
-lreactionThermophysicalModels \
-lSLGThermo \
-lchemistryModel \

View File

@ -13,10 +13,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
@ -37,11 +34,7 @@ EXE_LIBS = \
-lspecie \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \
-lsolidMixtureProperties \
-lthermophysicalFunctions \
-lthermophysicalProperties \
-lreactionThermophysicalModels \
-lSLGThermo \
-lchemistryModel \

View File

@ -14,10 +14,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
@ -41,11 +38,7 @@ EXE_LIBS = \
-lspecie \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \
-lsolidMixtureProperties \
-lthermophysicalFunctions \
-lthermophysicalProperties \
-lreactionThermophysicalModels \
-lSLGThermo \
-lchemistryModel \

View File

@ -15,10 +15,7 @@ EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \
@ -44,11 +41,7 @@ EXE_LIBS = \
-lspecie \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lliquidProperties \
-lliquidMixtureProperties \
-lsolidProperties \
-lsolidMixtureProperties \
-lthermophysicalFunctions \
-lthermophysicalProperties \
-lreactionThermophysicalModels \
-lSLGThermo \
-lchemistryModel \

View File

@ -17,7 +17,6 @@ EXE_LIBS = \
-llagrangian \
-llagrangianIntermediate \
-llagrangianTurbulence \
-lthermophysicalFunctions \
-lcompressibleTransportModels \
-lfluidThermophysicalModels \
-lspecie \

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -79,6 +79,8 @@
if (MULESCorr)
{
#include "alphaSuSp.H"
fvScalarMatrix alpha1Eqn
(
(
@ -92,6 +94,8 @@
phiCN,
upwind<scalar>(mesh, phiCN)
).fvmDiv(phiCN, alpha1)
==
Su + fvm::Sp(Sp + divU, alpha1)
);
alpha1Eqn.solve();
@ -124,37 +128,49 @@
for (int aCorr=0; aCorr<nAlphaCorr; aCorr++)
{
#include "alphaSuSp.H"
surfaceScalarField phir(phic*mixture.nHatf());
alphaPhiUn =
tmp<surfaceScalarField> talphaPhiUn
(
fvc::flux
(
fvc::flux
(
phi,
alpha1,
alphaScheme
)
+ fvc::flux
(
-fvc::flux(-phir, alpha2, alpharScheme),
alpha1,
alpharScheme
)
);
phi,
alpha1,
alphaScheme
)
+ fvc::flux
(
-fvc::flux(-phir, alpha2, alpharScheme),
alpha1,
alpharScheme
)
);
// Calculate the Crank-Nicolson off-centred alpha flux
if (ocCoeff > 0)
{
alphaPhiUn =
cnCoeff*alphaPhiUn + (1.0 - cnCoeff)*alphaPhi.oldTime();
talphaPhiUn =
cnCoeff*talphaPhiUn + (1.0 - cnCoeff)*alphaPhi.oldTime();
}
if (MULESCorr)
{
tmp<surfaceScalarField> talphaPhiCorr(alphaPhiUn - alphaPhi);
tmp<surfaceScalarField> talphaPhiCorr(talphaPhiUn() - alphaPhi);
volScalarField alpha10("alpha10", alpha1);
MULES::correct(alpha1, alphaPhiUn, talphaPhiCorr.ref(), 1, 0);
MULES::correct
(
geometricOneField(),
alpha1,
talphaPhiUn(),
talphaPhiCorr.ref(),
Sp,
(-Sp*alpha1)(),
1,
0
);
// Under-relax the correction for all but the 1st corrector
if (aCorr == 0)
@ -169,9 +185,19 @@
}
else
{
alphaPhi = alphaPhiUn;
alphaPhi = talphaPhiUn;
MULES::explicitSolve(alpha1, phiCN, alphaPhi, 1, 0);
MULES::explicitSolve
(
geometricOneField(),
alpha1,
phiCN,
alphaPhi,
Sp,
(Su + divU*min(alpha1(), scalar(1)))(),
1,
0
);
}
alpha2 = 1.0 - alpha1;
@ -195,7 +221,8 @@
== fv::EulerDdtScheme<vector>::typeName
)
{
rhoPhi = alphaPhi*(rho1 - rho2) + phiCN*rho2;
#include "rhofs.H"
rhoPhi = alphaPhi*(rho1f - rho2f) + phiCN*rho2f;
}
else
{
@ -206,7 +233,8 @@
}
// Calculate the end-of-time-step mass flux
rhoPhi = alphaPhi*(rho1 - rho2) + phi*rho2;
#include "rhofs.H"
rhoPhi = alphaPhi*(rho1f - rho2f) + phi*rho2f;
}
Info<< "Phase-1 volume fraction = "

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -1,4 +1,6 @@
EXE_INC = \
-I. \
-I../VoF \
-ItwoPhaseMixtureThermo \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \

View File

@ -12,12 +12,18 @@
alpha1/mixture.thermo1().Cv()
+ alpha2/mixture.thermo2().Cv()
)
==
fvOptions(rho, T)
);
TEqn.relax();
fvOptions.constrain(TEqn);
TEqn.solve();
mixture.correct();
fvOptions.correct(T);
Info<< "min(T) " << min(T).value() << endl;
mixture.correctThermo();
mixture.correct();
}

View File

@ -1,12 +1,16 @@
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(rhoPhi, U)
fvm::ddt(rho, U) + fvm::div(rhoPhi, U)
+ MRF.DDt(rho, U)
+ turbulence->divDevRhoReff(U)
==
fvOptions(rho, U)
);
UEqn.relax();
fvOptions.constrain(UEqn);
if (pimple.momentumPredictor())
{
solve
@ -16,12 +20,14 @@
fvc::reconstruct
(
(
interface.surfaceTensionForce()
mixture.surfaceTensionForce()
- ghf*fvc::snGrad(rho)
- fvc::snGrad(p_rgh)
) * mesh.magSf()
)
);
fvOptions.correct(U);
K = 0.5*magSqr(U);
}

View File

@ -1,5 +0,0 @@
const dictionary& alphaControls = mesh.solverDict(alpha1.name());
label nAlphaCorr(readLabel(alphaControls.lookup("nAlphaCorr")));
label nAlphaSubCycles(readLabel(alphaControls.lookup("nAlphaSubCycles")));

View File

@ -1,88 +0,0 @@
{
word alphaScheme("div(phi,alpha)");
word alpharScheme("div(phirb,alpha)");
surfaceScalarField phir(phic*interface.nHatf());
for (int gCorr=0; gCorr<nAlphaCorr; gCorr++)
{
volScalarField::Internal Sp
(
IOobject
(
"Sp",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("Sp", dgdt.dimensions(), 0.0)
);
volScalarField::Internal Su
(
IOobject
(
"Su",
runTime.timeName(),
mesh
),
// Divergence term is handled explicitly to be
// consistent with the explicit transport solution
divU*min(alpha1, scalar(1))
);
forAll(dgdt, celli)
{
if (dgdt[celli] > 0.0 && alpha1[celli] > 0.0)
{
Sp[celli] -= dgdt[celli]*alpha1[celli];
Su[celli] += dgdt[celli]*alpha1[celli];
}
else if (dgdt[celli] < 0.0 && alpha1[celli] < 1.0)
{
Sp[celli] += dgdt[celli]*(1.0 - alpha1[celli]);
}
}
surfaceScalarField alphaPhi1
(
fvc::flux
(
phi,
alpha1,
alphaScheme
)
+ fvc::flux
(
-fvc::flux(-phir, alpha2, alpharScheme),
alpha1,
alpharScheme
)
);
MULES::explicitSolve
(
geometricOneField(),
alpha1,
phi,
alphaPhi1,
Sp,
Su,
1,
0
);
surfaceScalarField rho1f(fvc::interpolate(rho1));
surfaceScalarField rho2f(fvc::interpolate(rho2));
rhoPhi = alphaPhi1*(rho1f - rho2f) + phi*rho2f;
alpha2 = scalar(1) - alpha1;
}
Info<< "Liquid phase volume fraction = "
<< alpha1.weightedAverage(mesh.V()).value()
<< " Min(" << alpha1.name() << ") = " << min(alpha1).value()
<< " Min(" << alpha2.name() << ") = " << min(alpha2).value()
<< endl;
}

View File

@ -1,40 +0,0 @@
{
#include "alphaControls.H"
surfaceScalarField phic(mag(phi/mesh.magSf()));
phic = min(interface.cAlpha()*phic, max(phic));
volScalarField divU(fvc::div(fvc::absolute(phi, U)));
if (nAlphaSubCycles > 1)
{
dimensionedScalar totalDeltaT = runTime.deltaT();
surfaceScalarField rhoPhiSum
(
IOobject
(
"rhoPhiSum",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("0", rhoPhi.dimensions(), 0)
);
for
(
subCycle<volScalarField> alphaSubCycle(alpha1, nAlphaSubCycles);
!(++alphaSubCycle).end();
)
{
#include "alphaEqns.H"
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
}
rhoPhi = rhoPhiSum;
}
else
{
#include "alphaEqns.H"
}
}

View File

@ -0,0 +1,43 @@
volScalarField::Internal Sp
(
IOobject
(
"Sp",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("Sp", dgdt.dimensions(), 0)
);
volScalarField::Internal Su
(
IOobject
(
"Su",
runTime.timeName(),
mesh
),
mesh,
dimensionedScalar("Su", dgdt.dimensions(), 0)
);
forAll(dgdt, celli)
{
if (dgdt[celli] > 0.0 && alpha1[celli] > 0.0)
{
Sp[celli] -= dgdt[celli]*alpha1[celli];
Su[celli] += dgdt[celli]*alpha1[celli];
}
else if (dgdt[celli] < 0.0 && alpha1[celli] < 1.0)
{
Sp[celli] += dgdt[celli]*(1.0 - alpha1[celli]);
}
}
volScalarField::Internal divU
(
mesh.moving()
? fvc::div(phiCN() + mesh.phi())
: fvc::div(phiCN())
);

View File

@ -0,0 +1,3 @@
{
#include "alphaEqnSubCycle.H"
}

View File

@ -1,5 +1,7 @@
EXE_INC = \
-I. \
-I.. \
-I../../VoF \
-I../twoPhaseMixtureThermo \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -24,9 +24,6 @@ License
Application
compressibleInterDyMFoam
Group
grpMultiphaseSolvers grpMovingMeshSolvers
Description
Solver for 2 compressible, non-isothermal immiscible fluids using a VOF
(volume of fluid) phase-fraction based interface capturing approach,
@ -42,14 +39,18 @@ Description
#include "fvCFD.H"
#include "dynamicFvMesh.H"
#include "MULES.H"
#include "CMULES.H"
#include "EulerDdtScheme.H"
#include "localEulerDdtScheme.H"
#include "CrankNicolsonDdtScheme.H"
#include "subCycle.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "twoPhaseMixtureThermo.H"
#include "turbulentFluidThermoModel.H"
#include "pimpleControl.H"
#include "fvOptions.H"
#include "CorrectPhi.H"
#include "fvcSmooth.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -63,6 +64,7 @@ int main(int argc, char *argv[])
#include "initContinuityErrs.H"
#include "createControl.H"
#include "createFields.H"
#include "createFvOptions.H"
#include "createUf.H"
#include "createControls.H"
#include "CourantNo.H"
@ -87,63 +89,66 @@ int main(int argc, char *argv[])
// same divergence
volScalarField divU("divU0", fvc::div(fvc::absolute(phi, U)));
if (LTS)
{
#include "setRDeltaT.H"
}
else
{
#include "CourantNo.H"
#include "alphaCourantNo.H"
#include "setDeltaT.H"
runTime++;
Info<< "Time = " << runTime.timeName() << nl << endl;
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
// Do any mesh changes
mesh.update();
if (mesh.changing())
{
Info<< "Execution time for mesh.update() = "
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
<< " s" << endl;
gh = (g & mesh.C()) - ghRef;
ghf = (g & mesh.Cf()) - ghRef;
}
if ((correctPhi && mesh.changing()) || mesh.topoChanging())
{
// Calculate absolute flux from the mapped surface velocity
// Note: temporary fix until mapped Uf is assessed
Uf = fvc::interpolate(U);
// Calculate absolute flux from the mapped surface velocity
phi = mesh.Sf() & Uf;
#include "correctPhi.H"
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);
}
}
if (mesh.changing() && checkMeshCourantNo)
{
#include "meshCourantNo.H"
}
runTime++;
turbulence->correct();
Info<< "Time = " << runTime.timeName() << nl << endl;
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
#include "alphaEqnsSubCycle.H"
// correct interface on first PIMPLE corrector
if (pimple.corr() == 1)
if (pimple.firstIter() || moveMeshOuterCorrectors)
{
interface.correct();
scalar timeBeforeMeshUpdate = runTime.elapsedCpuTime();
mesh.update();
if (mesh.changing())
{
Info<< "Execution time for mesh.update() = "
<< runTime.elapsedCpuTime() - timeBeforeMeshUpdate
<< " s" << endl;
gh = (g & mesh.C()) - ghRef;
ghf = (g & mesh.Cf()) - ghRef;
}
if ((mesh.changing() && correctPhi)) || mesh.topoChanging())
{
// Calculate absolute flux from the mapped surface velocity
// Note: temporary fix until mapped Uf is assessed
Uf = fvc::interpolate(U);
// Calculate absolute flux from the mapped surface velocity
phi = mesh.Sf() & Uf;
#include "correctPhi.H"
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phi, U);
mixture.correct();
}
if (mesh.changing() && checkMeshCourantNo)
{
#include "meshCourantNo.H"
}
}
#include "alphaControls.H"
#include "compressibleAlphaEqnSubCycle.H"
solve(fvm::ddt(rho) + fvc::div(rhoPhi));
#include "UEqn.H"
@ -154,14 +159,13 @@ int main(int argc, char *argv[])
{
#include "pEqn.H"
}
if (pimple.turbCorr())
{
turbulence->correct();
}
}
rho = alpha1*rho1 + alpha2*rho2;
// Correct p_rgh for consistency with p and the updated densities
p_rgh = p - rho*gh;
p_rgh.correctBoundaryConditions();
runTime.write();
Info<< "ExecutionTime = "

View File

@ -9,3 +9,8 @@ bool checkMeshCourantNo
(
pimple.dict().lookupOrDefault<Switch>("checkMeshCourantNo", false)
);
bool moveMeshOuterCorrectors
(
pimple.dict().lookupOrDefault<Switch>("moveMeshOuterCorrectors", false)
);

View File

@ -8,11 +8,12 @@
fvc::flux(HbyA)
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, Uf)
);
MRF.makeRelative(phiHbyA);
surfaceScalarField phig
(
(
interface.surfaceTensionForce()
mixture.surfaceTensionForce()
- ghf*fvc::snGrad(rho)
)*rAUf*mesh.magSf()
);
@ -20,7 +21,7 @@
phiHbyA += phig;
// Update the pressure BCs to ensure flux consistency
constrainPressure(p_rgh, U, phiHbyA, rAUf);
constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF);
// Make the fluxes relative to the mesh motion
fvc::makeRelative(phiHbyA, U);
@ -92,6 +93,7 @@
U = HbyA
+ rAU*fvc::reconstruct((phig + p_rghEqnIncomp.flux())/rAUf);
U.correctBoundaryConditions();
fvOptions.correct(U);
}
}
@ -118,7 +120,4 @@
);
K = 0.5*magSqr(U);
Info<< "max(U) " << max(mag(U)).value() << endl;
Info<< "min(p_rgh) " << min(p_rgh).value() << endl;
}

View File

@ -4,3 +4,6 @@ correctPhi = pimple.dict().lookupOrDefault<Switch>("correctPhi", true);
checkMeshCourantNo =
pimple.dict().lookupOrDefault<Switch>("checkMeshCourantNo", false);
moveMeshOuterCorrectors =
pimple.dict().lookupOrDefault<Switch>("moveMeshOuterCorrectors", false);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -39,14 +39,18 @@ Description
\*---------------------------------------------------------------------------*/
#include "fvCFD.H"
#include "MULES.H"
#include "CMULES.H"
#include "EulerDdtScheme.H"
#include "localEulerDdtScheme.H"
#include "CrankNicolsonDdtScheme.H"
#include "subCycle.H"
#include "rhoThermo.H"
#include "interfaceProperties.H"
#include "twoPhaseMixture.H"
#include "twoPhaseMixtureThermo.H"
#include "turbulentFluidThermoModel.H"
#include "pimpleControl.H"
#include "fvOptions.H"
#include "fvcSmooth.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -60,8 +64,7 @@ int main(int argc, char *argv[])
#include "createControl.H"
#include "createTimeControls.H"
#include "createFields.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
#include "createFvOptions.H"
volScalarField& p = mixture.p();
volScalarField& T = mixture.T();
@ -70,6 +73,13 @@ int main(int argc, char *argv[])
turbulence->validate();
if (!LTS)
{
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setInitialDeltaT.H"
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Info<< "\nStarting time loop\n" << endl;
@ -77,8 +87,17 @@ int main(int argc, char *argv[])
while (runTime.run())
{
#include "readTimeControls.H"
#include "CourantNo.H"
#include "setDeltaT.H"
if (LTS)
{
#include "setRDeltaT.H"
}
else
{
#include "CourantNo.H"
#include "alphaCourantNo.H"
#include "setDeltaT.H"
}
runTime++;
@ -87,13 +106,8 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop())
{
#include "alphaEqnsSubCycle.H"
// correct interface on first PIMPLE corrector
if (pimple.corr() == 1)
{
interface.correct();
}
#include "alphaControls.H"
#include "alphaEqnSubCycle.H"
solve(fvm::ddt(rho) + fvc::div(rhoPhi));

View File

@ -1,3 +1,5 @@
#include "createRDeltaT.H"
Info<< "Reading field p_rgh\n" << endl;
volScalarField p_rgh
(
@ -29,7 +31,7 @@ volVectorField U
#include "createPhi.H"
Info<< "Constructing twoPhaseMixtureThermo\n" << endl;
twoPhaseMixtureThermo mixture(mesh);
twoPhaseMixtureThermo mixture(U, phi);
volScalarField& alpha1(mixture.alpha1());
volScalarField& alpha2(mixture.alpha2());
@ -61,6 +63,7 @@ dimensionedScalar pMin
);
mesh.setFluxRequired(p_rgh.name());
mesh.setFluxRequired(alpha1.name());
#include "readGravitationalAcceleration.H"
@ -89,9 +92,6 @@ volScalarField dgdt
pos(alpha2)*fvc::div(phi)/max(alpha2, scalar(0.0001))
);
// Construct interface from alpha1 distribution
interfaceProperties interface(alpha1, U, mixture);
// Construct compressible turbulence model
autoPtr<compressible::turbulenceModel> turbulence
(
@ -100,3 +100,22 @@ autoPtr<compressible::turbulenceModel> turbulence
Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U));
// MULES flux from previous time-step
surfaceScalarField alphaPhi
(
IOobject
(
"alphaPhi",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
phi*fvc::interpolate(alpha1)
);
// MULES Correction
tmp<surfaceScalarField> talphaPhiCorr0;
#include "createMRF.H"

View File

@ -8,11 +8,12 @@
fvc::flux(HbyA)
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(U, phi)
);
MRF.makeRelative(phiHbyA);
surfaceScalarField phig
(
(
interface.surfaceTensionForce()
mixture.surfaceTensionForce()
- ghf*fvc::snGrad(rho)
)*rAUf*mesh.magSf()
);
@ -20,7 +21,7 @@
phiHbyA += phig;
// Update the pressure BCs to ensure flux consistency
constrainPressure(p_rgh, U, phiHbyA, rAUf);
constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF);
tmp<fvScalarMatrix> p_rghEqnComp1;
tmp<fvScalarMatrix> p_rghEqnComp2;
@ -98,6 +99,7 @@
U = HbyA
+ rAU*fvc::reconstruct((phig + p_rghEqnIncomp.flux())/rAUf);
U.correctBoundaryConditions();
fvOptions.correct(U);
}
}
@ -112,7 +114,4 @@
p_rgh.correctBoundaryConditions();
K = 0.5*magSqr(U);
Info<< "max(U) " << max(mag(U)).value() << endl;
Info<< "min(p_rgh) " << min(p_rgh).value() << endl;
}

View File

@ -0,0 +1,2 @@
surfaceScalarField rho1f(fvc::interpolate(rho1));
surfaceScalarField rho2f(fvc::interpolate(rho2));

View File

@ -2,6 +2,7 @@ EXE_INC = \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels/interfaceProperties/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude
LIB_LIBS = \
@ -9,4 +10,5 @@ LIB_LIBS = \
-lfluidThermophysicalModels \
-lspecie \
-ltwoPhaseMixture \
-linterfaceProperties \
-lfiniteVolume

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -40,11 +40,13 @@ namespace Foam
Foam::twoPhaseMixtureThermo::twoPhaseMixtureThermo
(
const fvMesh& mesh
const volVectorField& U,
const surfaceScalarField& phi
)
:
psiThermo(mesh, word::null),
twoPhaseMixture(mesh, *this),
psiThermo(U.mesh(), word::null),
twoPhaseMixture(U.mesh(), *this),
interfaceProperties(alpha1(), U, *this),
thermo1_(nullptr),
thermo2_(nullptr)
{
@ -58,8 +60,8 @@ Foam::twoPhaseMixtureThermo::twoPhaseMixtureThermo
T2.write();
}
thermo1_ = rhoThermo::New(mesh, phase1Name());
thermo2_ = rhoThermo::New(mesh, phase2Name());
thermo1_ = rhoThermo::New(U.mesh(), phase1Name());
thermo2_ = rhoThermo::New(U.mesh(), phase2Name());
thermo1_->validate(phase1Name(), "e");
thermo2_->validate(phase2Name(), "e");
@ -76,17 +78,23 @@ Foam::twoPhaseMixtureThermo::~twoPhaseMixtureThermo()
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
void Foam::twoPhaseMixtureThermo::correct()
void Foam::twoPhaseMixtureThermo::correctThermo()
{
thermo1_->he() = thermo1_->he(p_, T_);
thermo1_->correct();
thermo2_->he() = thermo2_->he(p_, T_);
thermo2_->correct();
}
void Foam::twoPhaseMixtureThermo::correct()
{
psi_ = alpha1()*thermo1_->psi() + alpha2()*thermo2_->psi();
mu_ = alpha1()*thermo1_->mu() + alpha2()*thermo2_->mu();
alpha_ = alpha1()*thermo1_->alpha() + alpha2()*thermo2_->alpha();
interfaceProperties::correct();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -39,6 +39,7 @@ SourceFiles
#include "rhoThermo.H"
#include "psiThermo.H"
#include "twoPhaseMixture.H"
#include "interfaceProperties.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -52,7 +53,8 @@ namespace Foam
class twoPhaseMixtureThermo
:
public psiThermo,
public twoPhaseMixture
public twoPhaseMixture,
public interfaceProperties
{
// Private data
@ -71,10 +73,11 @@ public:
// Constructors
//- Construct from mesh
//- Construct from components
twoPhaseMixtureThermo
(
const fvMesh& mesh
const volVectorField& U,
const surfaceScalarField& phi
);
@ -104,7 +107,10 @@ public:
return thermo2_();
}
//- Update properties
//- Correct the thermodynamics of each phase
virtual void correctThermo();
//- Update mixture properties
virtual void correct();
//- Return true if the equation of state is incompressible

View File

@ -1,5 +1,6 @@
EXE_INC = \
-I. \
-I../VoF \
-I../interFoam \
-ImultiphaseMixtureThermo/lnInclude \
-I$(LIB_SRC)/transportModels/compressible/lnInclude \

View File

@ -1,4 +1,5 @@
EXE_INC = \
-I../VoF \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \

View File

@ -0,0 +1,3 @@
zeroField Su;
zeroField Sp;
zeroField divU;

View File

@ -1,6 +1,7 @@
EXE_INC = \
-I. \
-I.. \
-I../../VoF \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \

View File

@ -47,7 +47,6 @@ Description
#include "pimpleControl.H"
#include "fvOptions.H"
#include "CorrectPhi.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -129,7 +128,11 @@ int main(int argc, char *argv[])
<< " s" << endl;
// Do not apply previous time-step mesh compression flux
talphaPhiCorr0.clear();
// if the mesh topology changed
if (mesh.topoChanging())
{
talphaPhiCorr0.clear();
}
gh = (g & mesh.C()) - ghRef;
ghf = (g & mesh.Cf()) - ghRef;

View File

@ -28,7 +28,7 @@
phiHbyA += phig;
// Update the pressure BCs to ensure flux consistency
constrainPressure(p_rgh, U, phiHbyA, rAUf);
constrainPressure(p_rgh, U, phiHbyA, rAUf, MRF);
while (pimple.correctNonOrthogonal())
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -51,7 +51,6 @@ Description
#include "pimpleControl.H"
#include "fvOptions.H"
#include "CorrectPhi.H"
#include "localEulerDdtScheme.H"
#include "fvcSmooth.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -1,6 +1,7 @@
EXE_INC = \
-I. \
-I.. \
-I../../VoF \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-IimmiscibleIncompressibleThreePhaseMixture \
-IincompressibleThreePhaseMixture \

View File

@ -19,7 +19,7 @@ if (nAlphaSubCycles > 1)
!(++alphaSubCycle).end();
)
{
#include "alphaEqns.H"
#include "alphaEqn.H"
rhoPhiSum += (runTime.deltaT()/totalDeltaT)*rhoPhi;
}
@ -27,7 +27,7 @@ if (nAlphaSubCycles > 1)
}
else
{
#include "alphaEqns.H"
#include "alphaEqn.H"
}
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -96,7 +96,7 @@ int main(int argc, char *argv[])
while (pimple.loop())
{
#include "alphaControls.H"
#include "alphaEqnsSubCycle.H"
#include "alphaEqnSubCycle.H"
mixture.correct();

View File

@ -0,0 +1,2 @@
const dimensionedScalar& rho1f(rho1);
const dimensionedScalar& rho2f(rho2);

View File

@ -1,5 +1,6 @@
EXE_INC = \
-I. \
-I../VoF \
-I../interFoam \
-ImultiphaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels \

View File

@ -1,5 +1,6 @@
EXE_INC = \
-I.. \
-I../../VoF \
-I../../interFoam/interDyMFoam \
-I../../interFoam \
-I../multiphaseMixture/lnInclude \

View File

@ -2,10 +2,7 @@ EXE_INC = \
-I../phaseSystems/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/properties/solidMixtureProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \

View File

@ -1,6 +1,6 @@
EXE_INC = \
-I. \
-I../interFoam \
-I../VoF \
-I$(LIB_SRC)/transportModels/twoPhaseMixture/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/transportModels/incompressible/lnInclude \

View File

@ -9,7 +9,6 @@ EXE_INC = \
EXE_LIBS = \
-llagrangianIntermediate \
-lradiationModels \
-lthermophysicalFunctions \
-lregionModels \
-lfiniteVolume \
-lmeshTools \

View File

@ -1,5 +1,3 @@
EXE_INC = \
-I$(LIB_SRC)/thermophysicalModels/properties/liquidProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude
EXE_LIBS = -lliquidProperties -lthermophysicalFunctions

View File

@ -2,7 +2,6 @@ specie1
{
specie
{
nMoles 1;
molWeight 1;
}
@ -24,7 +23,6 @@ specie2
{
specie
{
nMoles 1;
molWeight 0.5;
}

View File

@ -15,9 +15,10 @@ EXE_LIBS = \
-lchemistryModel \
-lcoalCombustion \
-lcombustionModels \
-lcompressibleEulerianInterfacialModels \
-lcompressibleTransportModels \
-lcompressibleTurbulenceModels \
-lCompressibleTwoPhaseMixtureTurbulenceModels \
-lconversion \
-ldecompose \
-ldecompositionMethods \
-ldistributed \
-ldistributionModels \
@ -38,25 +39,34 @@ EXE_LIBS = \
-lfvMotionSolvers \
-lfvOptions \
-lgenericPatchFields \
-limmiscibleIncompressibleTwoPhaseMixture \
-lincompressibleTransportModels \
-lincompressibleTurbulenceModels \
-linterfaceProperties \
-llagrangianFunctionObjects \
-llagrangianIntermediate \
-llagrangian \
-llagrangianSpray \
-llagrangianTurbulence \
-llaminarFlameSpeedModels \
-lliquidPropertiesFvPatchFields \
-lliquidProperties \
-lthermophysicalProperties \
-lmeshTools \
-lmolecularMeasurements \
-lmolecule \
-lODE \
-lOpenFOAM \
-lpairPatchAgglomeration \
-lphaseChangeTwoPhaseMixtures \
-lphaseCompressibleTurbulenceModels \
-lphaseTemperatureChangeTwoPhaseMixtures \
-lpotential \
-lpyrolysisModels \
-lradiationModels \
-lrandomProcesses \
-lreactingEulerianInterfacialCompositionModels \
-lreactingEulerianInterfacialModels \
-lreactingPhaseSystem \
-lreactingTwoPhaseSystem \
-lreactionThermophysicalModels \
-lreconstruct \
-lregionCoupled \
-lregionCoupling \
-lregionModels \
@ -67,10 +77,10 @@ EXE_LIBS = \
-lsampling \
-lscotchDecomp \
-lsixDoFRigidBodyMotion \
-lSloanRenumber \
-lSLGThermo \
-lsnappyHexMesh \
-lsolidChemistryModel \
-lsolidProperties \
-lsolidParticle \
-lsolidSpecie \
-lsolidThermo \
-lsolverFunctionObjects \
@ -79,9 +89,11 @@ EXE_LIBS = \
-lsurfaceFilmModels \
-lsurfMesh \
-lthermalBaffleModels \
-lthermophysicalFunctions \
-ltopoChangerFvMesh \
-lturbulenceModelSchemes \
-ltriSurface \
-lturbulenceModels \
-ltwoPhaseMixture \
-ltwoPhaseMixtureThermo \
-ltwoPhaseProperties \
-ltwoPhaseReactingTurbulenceModels \
-lutilityFunctionObjects

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -100,28 +100,59 @@ int main(int argc, char *argv[])
scalar stoicO2 = n + m/4.0;
scalar stoicN2 = (0.79/0.21)*(n + m/4.0);
scalar stoicN2 = (0.79/0.21)*stoicO2;
scalar stoicCO2 = n;
scalar stoicH2O = m/2.0;
thermo fuel
thermo FUEL
(
"fuel",
thermo(thermoData.subDict(fuelName))
);
Info<< "fuel " << FUEL << ';' << endl;
FUEL *= FUEL.W();
thermo O2
(
"O2",
thermo(thermoData.subDict("O2"))
);
O2 *= O2.W();
thermo N2
(
"N2",
thermo(thermoData.subDict("N2"))
);
N2 *= N2.W();
thermo CO2
(
"CO2",
thermo(thermoData.subDict("CO2"))
);
CO2 *= CO2.W();
thermo H2O
(
"H2O",
thermo(thermoData.subDict("H2O"))
);
H2O *= H2O.W();
thermo oxidant
(
"oxidant",
stoicO2*thermo(thermoData.subDict("O2"))
+ stoicN2*thermo(thermoData.subDict("N2"))
stoicO2*O2
+ stoicN2*N2
);
Info<< "oxidant " << (1/oxidant.Y())*oxidant << ';' << endl;
dimensionedScalar stoichiometricAirFuelMassRatio
(
"stoichiometricAirFuelMassRatio",
dimless,
(oxidant.W()*oxidant.nMoles())/fuel.W()
oxidant.Y()/FUEL.W()
);
Info<< "stoichiometricAirFuelMassRatio "
@ -141,49 +172,34 @@ int main(int argc, char *argv[])
scalar ores = max(1.0/equiv - 1.0, 0.0);
scalar fburnt = 1.0 - fres;
thermo fuel
(
"fuel",
thermo(thermoData.subDict(fuelName))
);
Info<< "fuel " << fuel << ';' << endl;
thermo oxidant
(
"oxidant",
o2*thermo(thermoData.subDict("O2"))
+ n2*thermo(thermoData.subDict("N2"))
);
Info<< "oxidant " << (1/oxidant.nMoles())*oxidant << ';' << endl;
thermo reactants
(
"reactants",
fuel + oxidant
FUEL + (1.0/equiv)*oxidant
);
Info<< "reactants " << (1/reactants.nMoles())*reactants << ';' << endl;
Info<< "reactants " << (1/reactants.Y())*reactants << ';' << endl;
thermo burntProducts
(
"burntProducts",
+ (n2 - (0.79/0.21)*ores*stoicO2)*thermo(thermoData.subDict("N2"))
+ fburnt*stoicCO2*thermo(thermoData.subDict("CO2"))
+ fburnt*stoicH2O*thermo(thermoData.subDict("H2O"))
+ (n2 - (0.79/0.21)*ores*stoicO2)*N2
+ fburnt*stoicCO2*CO2
+ fburnt*stoicH2O*H2O
);
Info<< "burntProducts "
<< (1/burntProducts.nMoles())*burntProducts << ';' << endl;
<< (1/burntProducts.Y())*burntProducts << ';' << endl;
thermo products
(
"products",
fres*fuel
+ n2*thermo(thermoData.subDict("N2"))
+ fburnt*stoicCO2*thermo(thermoData.subDict("CO2"))
+ fburnt*stoicH2O*thermo(thermoData.subDict("H2O"))
+ ores*stoicO2*thermo(thermoData.subDict("O2"))
fres*FUEL
+ n2*N2
+ fburnt*stoicCO2*CO2
+ fburnt*stoicH2O*H2O
+ ores*stoicO2*O2
);
Info<< "products " << (1/products.nMoles())*products << ';' << endl;
Info<< "products " << (1/products.Y())*products << ';' << endl;
scalar Tad = products.THa(reactants.Ha(P, T0), P, 1000.0);
Info<< "Tad = " << Tad << nl << endl;

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,6 +45,9 @@ using namespace Foam;
int main(int argc, char *argv[])
{
// Increase the precision of the output for JANAF coefficients
Ostream::defaultPrecision(10);
argList::validArgs.append("CHEMKINFile");
argList::validArgs.append("CHEMKINThermodynamicsFile");
argList::validArgs.append("CHEMKINTransport");

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -76,52 +76,44 @@ int main(int argc, char *argv[])
scalar P = 1e5;
scalar T = 3000.0;
const scalar P = 1e5;
const scalar T = 3000.0;
// Oxidant (mole-based)
thermo O2(thermoData.subDict("O2")); O2 *= O2.W();
thermo N2(thermoData.subDict("N2")); N2 *= N2.W();
// Intermediates (mole-based)
thermo H2(thermoData.subDict("H2")); H2 *= H2.W();
thermo OH(thermoData.subDict("OH")); OH *= OH.W();
thermo H(thermoData.subDict("H")); H *= H.W();
thermo O(thermoData.subDict("O")); O *= O.W();
// Products (mole-based)
thermo CO2(thermoData.subDict("CO2")); CO2 *= CO2.W();
thermo H2O(thermoData.subDict("H2O")); H2O *= H2O.W();
thermo CO(thermoData.subDict("CO")); CO *= CO.W();
SLPtrList<thermo> EQreactions;
EQreactions.append
(
new thermo
(
thermo(thermoData.subDict("CO2"))
==
thermo(thermoData.subDict("CO"))
+ 0.5*thermo(thermoData.subDict("O2"))
)
new thermo(CO2 == CO + 0.5*O2)
);
EQreactions.append
(
new thermo
(
thermo(thermoData.subDict("O2"))
==
2.0*thermo(thermoData.subDict("O"))
)
new thermo(O2 == 2*O)
);
EQreactions.append
(
new thermo
(
thermo(thermoData.subDict("H2O"))
==
thermo(thermoData.subDict("H2"))
+ 0.5*thermo(thermoData.subDict("O2"))
)
new thermo(H2O == H2 + 0.5*O2)
);
EQreactions.append
(
new thermo
(
thermo(thermoData.subDict("H2O"))
==
thermo(thermoData.subDict("H"))
+ thermo(thermoData.subDict("OH"))
)
new thermo(H2O == H + OH)
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -103,25 +103,27 @@ int main(int argc, char *argv[])
Info<< nl << "Reading thermodynamic data for relevant species"
<< nl << endl;
// Reactants
thermo FUEL(thermoData.subDict(fuelName));
thermo O2(thermoData.subDict("O2"));
thermo N2(thermoData.subDict("N2"));
// Reactants (mole-based)
thermo FUEL(thermoData.subDict(fuelName)); FUEL *= FUEL.W();
// Products
thermo CO2(thermoData.subDict("CO2"));
thermo H2O(thermoData.subDict("H2O"));
// Oxidant (mole-based)
thermo O2(thermoData.subDict("O2")); O2 *= O2.W();
thermo N2(thermoData.subDict("N2")); N2 *= N2.W();
// Product fragments
thermo CO(thermoData.subDict("CO"));
thermo H2(thermoData.subDict("H2"));
// Intermediates (mole-based)
thermo H2(thermoData.subDict("H2")); H2 *= H2.W();
// Products (mole-based)
thermo CO2(thermoData.subDict("CO2")); CO2 *= CO2.W();
thermo H2O(thermoData.subDict("H2O")); H2O *= H2O.W();
thermo CO(thermoData.subDict("CO")); CO *= CO.W();
// Product dissociation reactions
thermo CO2BreakUp
(
CO2 == CO + 0.5* O2
CO2 == CO + 0.5*O2
);
thermo H2OBreakUp
@ -148,7 +150,7 @@ int main(int argc, char *argv[])
(
"stoichiometricAirFuelMassRatio",
dimless,
(oxidant.W()*oxidant.nMoles())/FUEL.W()
oxidant.Y()/FUEL.W()
);
Info<< "stoichiometricAirFuelMassRatio "
@ -212,7 +214,6 @@ int main(int argc, char *argv[])
// Iteration loop for adiabatic flame temperature
for (int j=0; j<20; j++)
{
if (j > 0)
{
co = co2*