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*

View File

@ -30,7 +30,6 @@ mixture // air at room temperature (293 K)
{
specie
{
nMoles 1;
molWeight 28.9;
}
thermodynamics

View File

@ -44,9 +44,9 @@ divSchemes
div(phi,e) $turbulence;
div(phi,h) $turbulence;
div(phi,K) $turbulence;
div(phi,Ekp) $turbulence;
div(phi,Ekp) $turbulence;
div(phid,p) bounded Gauss upwind;
div(phid,p) Gauss upwind;
div((phi|interpolate(rho)),p) bounded Gauss upwind;
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;

View File

@ -43,8 +43,8 @@ SIMPLE
}
nNonOrthogonalCorrectors 0;
rhoMin rhoMin [ 1 -3 0 0 0 ] 0.1;
rhoMax rhoMax [ 1 -3 0 0 0 ] 1.5;
pMinFactor 0.1;
pMaxFactor 1.5;
}
relaxationFactors
@ -56,7 +56,7 @@ relaxationFactors
}
equations
{
U 0.7;
U 0.7;
"(e|h)" 0.7;
"(k|epsilon|omega)" 0.7;
}

File diff suppressed because it is too large Load Diff

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 | Copyright (C) 2015-2017 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -187,6 +187,8 @@ void Foam::Time::setControls()
int oldPrecision = precision_;
int requiredPrecision = -1;
bool found = false;
word oldTime(timeName());
for
(
precision_ = maxPrecision_;
@ -197,6 +199,14 @@ void Foam::Time::setControls()
// Update the time formatting
setTime(startTime_, 0);
// Check that the time name has changed otherwise exit loop
word newTime(timeName());
if (newTime == oldTime)
{
break;
}
oldTime = newTime;
// Check the existence of the time directory with the new format
found = exists(timePath(), 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 | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -348,6 +348,20 @@ void Foam::Time::readDict()
(
controlDict_.lookup("writeCompression")
);
if
(
writeFormat_ == IOstream::BINARY
&& writeCompression_ == IOstream::COMPRESSED
)
{
IOWarningInFunction(controlDict_)
<< "Selecting compressed binary is inefficient and ineffective"
", resetting to uncompressed binary"
<< endl;
writeCompression_ = IOstream::UNCOMPRESSED;
}
}
controlDict_.readIfPresent("graphFormat", graphFormat_);

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
@ -66,6 +66,10 @@ public:
inline scalar operator[](const label) const;
inline zeroField field() const;
inline zeroField operator()() const;
inline zeroField operator-() const;
};

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
@ -39,4 +39,80 @@ inline Foam::zeroField Foam::zeroField::field() const
}
inline Foam::zeroField Foam::zeroField::operator()() const
{
return zeroField();
}
inline Foam::zeroField Foam::zeroField::operator-() const
{
return zeroField();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
inline const zeroField operator+(const zeroField&, const zeroField&)
{
return zeroField();
}
template<class Type>
inline const Type& operator+(const Type& t, const zeroField&)
{
return t;
}
template<class Type>
inline const Type& operator+(const zeroField&, const Type& t)
{
return t;
}
inline const zeroField operator-(const zeroField&, const zeroField&)
{
return zeroField();
}
template<class Type>
inline const Type& operator-(const Type& t, const zeroField&)
{
return t;
}
template<class Type>
inline Type operator-(const zeroField&, const Type& t)
{
return -t;
}
template<class Type>
inline zeroField operator*(const Type& t, const zeroField&)
{
return zeroField();
}
template<class Type>
inline zeroField operator*(const zeroField&, const Type& t)
{
return zeroField();
}
template<class Type>
inline zeroField operator/(const zeroField&, const Type& t)
{
return zeroField();
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

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 | Copyright (C) 2015-2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -1176,11 +1176,18 @@ void Foam::GeometricField<Type, PatchField, GeoMesh>::operator=
this->dimensions() = gf.dimensions();
// Transfer the storage from the tmp
primitiveFieldRef().transfer
(
const_cast<Field<Type>&>(gf.primitiveField())
);
if (tgf.isTmp())
{
// Transfer the storage from the tmp
primitiveFieldRef().transfer
(
const_cast<Field<Type>&>(gf.primitiveField())
);
}
else
{
primitiveFieldRef() = gf.primitiveField();
}
boundaryFieldRef() = gf.boundaryField();

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
@ -72,6 +72,8 @@ public:
inline zeroField field() const;
inline zeroField operator()() const;
inline zeroField oldTime() const;
inline zeroFieldField boundaryField() const;
@ -84,7 +86,7 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "geometricZeroFieldI.H"
#include "geometricZeroFieldI.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

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
@ -42,6 +42,11 @@ inline Foam::zeroField Foam::geometricZeroField::field() const
return zeroField();
}
inline Foam::zeroField Foam::geometricZeroField::operator()() const
{
return zeroField();
}
inline Foam::zeroField Foam::geometricZeroField::oldTime() const
{
return zeroField();

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
@ -122,6 +122,9 @@ public:
//- Dictionary of controls
dictionary controlDict_;
//- Default maximum number of iterations in the solver
static const label defaultMaxIter_ = 1000;
//- Maximum number of iterations in the solver
label maxIter_;

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
@ -131,7 +131,7 @@ Foam::LduMatrix<Type, DType, LUType>::solver::solver
controlDict_(solverDict),
maxIter_(1000),
maxIter_(defaultMaxIter_),
minIter_(0),
tolerance_(1e-6*pTraits<Type>::one),
relTol_(Zero)

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
@ -35,6 +35,9 @@ namespace Foam
}
const Foam::label Foam::lduMatrix::solver::defaultMaxIter_ = 1000;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::lduMatrix::lduMatrix(const lduMesh& mesh)

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 | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -107,6 +107,9 @@ public:
//- Dictionary of controls
dictionary controlDict_;
//- Default maximum number of iterations in the solver
static const label defaultMaxIter_;
//- Maximum number of iterations in the solver
label maxIter_;

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 | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
@ -158,10 +158,10 @@ Foam::lduMatrix::solver::solver
void Foam::lduMatrix::solver::readControls()
{
maxIter_ = controlDict_.lookupOrDefault<label>("maxIter", 1000);
minIter_ = controlDict_.lookupOrDefault<label>("minIter", 0);
maxIter_ = controlDict_.lookupOrDefault<label>("maxIter", defaultMaxIter_);
minIter_ = controlDict_.lookupOrDefault<label>("minIter", 0);
tolerance_ = controlDict_.lookupOrDefault<scalar>("tolerance", 1e-6);
relTol_ = controlDict_.lookupOrDefault<scalar>("relTol", 0);
relTol_ = controlDict_.lookupOrDefault<scalar>("relTol", 0);
}

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
@ -208,6 +208,16 @@ Foam::solverPerformance Foam::PBiCG::solve
);
}
// Recommend PBiCGStab if PBiCG fails to converge
if (solverPerf.nIterations() > max(defaultMaxIter_, maxIter_))
{
FatalErrorInFunction
<< "PBiCG has failed to converge within the maximum number"
" of iterations " << max(defaultMaxIter_, maxIter_) << nl
<< " Please try the more robust PBiCGStab solver."
<< exit(FatalError);
}
return solverPerf;
}

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
@ -25,8 +25,6 @@ License
#include <cctype>
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
inline void Foam::word::stripInvalid()

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
@ -115,6 +115,19 @@ public:
return this->transport_.mu(patchi);
}
//- Return the laminar viscosity
virtual tmp<volScalarField> nu() const
{
return this->transport_.mu()/this->rho_;
}
//- Return the laminar viscosity on patchi
virtual tmp<scalarField> nu(const label patchi) const
{
return
this->transport_.mu(patchi)/this->rho_.boundaryField()[patchi];
}
//- Return the turbulence dynamic viscosity
virtual tmp<volScalarField> mut() const
{

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
@ -54,7 +54,6 @@ Usage
// Solid thermo
specie
{
nMoles 1;
molWeight 20;
}
transport

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -130,7 +130,11 @@ kOmegaSSTSato<BasicTurbulenceModel>::gasTurbulence() const
template<class BasicTurbulenceModel>
void kOmegaSSTSato<BasicTurbulenceModel>::correctNut()
void kOmegaSSTSato<BasicTurbulenceModel>::correctNut
(
const volScalarField& S2,
const volScalarField& F2
)
{
const PhaseCompressibleTurbulenceModel<transportModel>& gasTurbulence =
this->gasTurbulence();
@ -141,12 +145,7 @@ void kOmegaSSTSato<BasicTurbulenceModel>::correctNut()
);
this->nut_ =
this->a1_*this->k_
/max
(
this->a1_*this->omega_,
this->F23()*sqrt(2.0)*mag(symm(fvc::grad(this->U_)))
)
this->a1_*this->k_/max(this->a1_*this->omega_, this->b1_*F2*sqrt(S2))
+ sqr(1 - exp(-yPlus/16.0))
*Cmub_*gasTurbulence.transport().d()*gasTurbulence.alpha()
*(mag(this->U_ - gasTurbulence.U()));

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014-2016 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2014-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -68,8 +68,8 @@ Description
to specify the near-wall omega as appropriate.
The blending functions (15) and (16) are not currently used because of the
uncertainty in their origin, range of applicability and that is y+ becomes
sufficiently small blending u_tau in this manner clearly becomes nonsense.
uncertainty in their origin, range of applicability and that as y+ becomes
sufficiently small blending u_tau in this manner is clearly nonsense.
The default model coefficients correspond to the following:
\verbatim
@ -156,7 +156,12 @@ protected:
// Protected Member Functions
virtual void correctNut();
virtual void correctNut
(
const volScalarField& S2,
const volScalarField& F2
);
public:

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
@ -158,13 +158,13 @@ public:
}
//- Return the laminar viscosity
tmp<volScalarField> nu() const
virtual tmp<volScalarField> nu() const
{
return transport_.nu();
}
//- Return the laminar viscosity on patchi
tmp<scalarField> nu(const label patchi) const
virtual tmp<scalarField> nu(const label patchi) const
{
return transport_.nu(patchi);
}

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
@ -147,7 +147,7 @@ namespace Foam
os << nl;
}
} // end namespace
}
template<class Type>
@ -183,17 +183,24 @@ void Foam::csvSetWriter<Type>::writeCoordHeader
Ostream& os
) const
{
const word axisName(points.axis());
if (points.hasVectorAxis())
{
forAll(points, i)
for
(
word::const_iterator iter = axisName.begin();
iter != axisName.end();
++iter
)
{
os << points.axis()[i];
os << *iter;
writeSeparator(os);
}
}
else
{
os << points.axis();
os << axisName;
writeSeparator(os);
}
}

View File

@ -405,6 +405,7 @@ $(general)/constrainHbyA/constrainHbyA.C
$(general)/adjustPhi/adjustPhi.C
$(general)/bound/bound.C
$(general)/CorrectPhi/correctUphiBCs.C
$(general)/pressureControl/pressureControl.C
solutionControl = $(general)/solutionControl
$(solutionControl)/solutionControl/solutionControl.C
@ -420,6 +421,7 @@ $(porosity)/porosityModel/IOporosityModelList.C
$(porosity)/DarcyForchheimer/DarcyForchheimer.C
$(porosity)/fixedCoeff/fixedCoeff.C
$(porosity)/powerLaw/powerLaw.C
$(porosity)/solidification/solidification.C
MRF = $(general)/MRF
$(MRF)/MRFZone.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -27,7 +27,7 @@ License
// * * * * * * * * * * * * * * * Global Functions * * * * * * * * * * * * * //
void Foam::setRefCell
bool Foam::setRefCell
(
const volScalarField& field,
const volScalarField& fieldRef,
@ -109,11 +109,17 @@ void Foam::setRefCell
}
refValue = readScalar(dict.lookup(refValueName));
return true;
}
else
{
return false;
}
}
void Foam::setRefCell
bool Foam::setRefCell
(
const volScalarField& field,
const dictionary& dict,
@ -122,7 +128,7 @@ void Foam::setRefCell
const bool forceReference
)
{
setRefCell(field, field, dict, refCelli, refValue, forceReference);
return setRefCell(field, field, dict, refCelli, refValue, forceReference);
}

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
@ -46,8 +46,8 @@ namespace Foam
//- If the field fieldRef needs referencing find the reference cell nearest
// (in index) to the given cell looked-up for field, but which is not on a
// cyclic, symmetry or processor patch.
void setRefCell
// cyclic, symmetry or processor patch and return true, otherwise return false.
bool setRefCell
(
const volScalarField& field,
const volScalarField& fieldRef,
@ -59,8 +59,8 @@ void setRefCell
//- If the field needs referencing find the reference cell nearest
// (in index) to the given cell looked-up for field, but which is not on a
// cyclic, symmetry or processor patch.
void setRefCell
// cyclic, symmetry or processor patch and return true, otherwise return false.
bool setRefCell
(
const volScalarField& field,
const dictionary& dict,

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::DarcyForchheimer
Foam::porosityModels::DarcyForchheimer
Description
Darcy-Forchheimer law porosity model, given by:

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::fixedCoeff
Foam::porosityModels::fixedCoeff
Description
Fixed coefficient form of porosity model

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2015 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -94,14 +94,16 @@ void Foam::porosityModels::powerLaw::correct
fvVectorMatrix& UEqn
) const
{
const vectorField& U = UEqn.psi();
const volVectorField& U = UEqn.psi();
const scalarField& V = mesh_.V();
scalarField& Udiag = UEqn.diag();
if (UEqn.dimensions() == dimForce)
{
const volScalarField& rho =
mesh_.lookupObject<volScalarField>(rhoName_);
const volScalarField& rho = mesh_.lookupObject<volScalarField>
(
IOobject::groupName(rhoName_, U.group())
);
apply(Udiag, V, rho, U);
}
@ -122,7 +124,7 @@ void Foam::porosityModels::powerLaw::correct
const vectorField& U = UEqn.psi();
const scalarField& V = mesh_.V();
scalarField& Udiag = UEqn.diag();
apply(Udiag, V, rho, U);
}
@ -133,12 +135,14 @@ void Foam::porosityModels::powerLaw::correct
volTensorField& AU
) const
{
const vectorField& U = UEqn.psi();
const volVectorField& U = UEqn.psi();
if (UEqn.dimensions() == dimForce)
{
const volScalarField& rho =
mesh_.lookupObject<volScalarField>(rhoName_);
const volScalarField& rho = mesh_.lookupObject<volScalarField>
(
IOobject::groupName(rhoName_, U.group())
);
apply(AU, rho, U);
}

Some files were not shown because too many files have changed in this diff Show More