fvModels, fvConstraints: Rational separation of fvOptions between physical modelling and numerical constraints

The new fvModels is a general interface to optional physical models in the
finite volume framework, providing sources to the governing conservation
equations, thus ensuring consistency and conservation.  This structure is used
not only for simple sources and forces but also provides a general run-time
selection interface for more complex models such as radiation and film, in the
future this will be extended to Lagrangian, reaction, combustion etc.  For such
complex models the 'correct()' function is provided to update the state of these
models at the beginning of the PIMPLE loop.

fvModels are specified in the optional constant/fvModels dictionary and
backward-compatibility with fvOption is provided by reading the
constant/fvOptions or system/fvOptions dictionary if present.

The new fvConstraints is a general interface to optional numerical constraints
applied to the matrices of the governing equations after construction and/or to
the resulting field after solution.  This system allows arbitrary changes to
either the matrix or solution to ensure numerical or other constraints and hence
violates consistency with the governing equations and conservation but it often
useful to ensure numerical stability, particularly during the initial start-up
period of a run.  Complex manipulations can be achieved with fvConstraints, for
example 'meanVelocityForce' used to maintain a specified mean velocity in a
cyclic channel by manipulating the momentum matrix and the velocity solution.

fvConstraints are specified in the optional system/fvConstraints dictionary and
backward-compatibility with fvOption is provided by reading the
constant/fvOptions or system/fvOptions dictionary if present.

The separation of fvOptions into fvModels and fvConstraints provides a rational
and consistent separation between physical and numerical models which is easier
to understand and reason about, avoids the confusing issue of location of the
controlling dictionary file, improves maintainability and easier to extend to
handle current and future requirements for optional complex physical models and
numerical constraints.
This commit is contained in:
Henry Weller
2021-03-07 22:45:01 +00:00
parent a28fd5552f
commit da3f4cc92e
444 changed files with 4427 additions and 3005 deletions

View File

@ -4,5 +4,6 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lfvOptions \ -lfvModels \
-lfvConstraints \
-lmeshTools -lmeshTools

View File

@ -36,4 +36,5 @@ dimensionedScalar DT
transportProperties.lookup("DT") transportProperties.lookup("DT")
); );
#include "createFvOptions.H" #include "createFvModels.H"
#include "createFvConstraints.H"

View File

@ -30,7 +30,8 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #include "fvCFD.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
#include "simpleControl.H" #include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -54,7 +55,7 @@ int main(int argc, char *argv[])
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
fvOptions.correct(); fvModels.correct();
while (simple.correctNonOrthogonal()) while (simple.correctNonOrthogonal())
{ {
@ -62,12 +63,12 @@ int main(int argc, char *argv[])
( (
fvm::ddt(T) - fvm::laplacian(DT, T) fvm::ddt(T) - fvm::laplacian(DT, T)
== ==
fvOptions(T) fvModels.source(T)
); );
fvOptions.constrain(TEqn); fvConstraints.constrain(TEqn);
TEqn.solve(); TEqn.solve();
fvOptions.constrain(T); fvConstraints.constrain(T);
} }
#include "write.H" #include "write.H"

View File

@ -5,6 +5,7 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lfvOptions \ -lfvModels \
-lfvConstraints \
-lmeshTools \ -lmeshTools \
-lsampling -lsampling

View File

@ -54,4 +54,5 @@ dimensionedScalar DT
#include "createPhi.H" #include "createPhi.H"
#include "createFvOptions.H" #include "createFvModels.H"
#include "createFvConstraints.H"

View File

@ -30,7 +30,8 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #include "fvCFD.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
#include "simpleControl.H" #include "simpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -55,7 +56,7 @@ int main(int argc, char *argv[])
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
fvOptions.correct(); fvModels.correct();
while (simple.correctNonOrthogonal()) while (simple.correctNonOrthogonal())
{ {
@ -65,13 +66,13 @@ int main(int argc, char *argv[])
+ fvm::div(phi, T) + fvm::div(phi, T)
- fvm::laplacian(DT, T) - fvm::laplacian(DT, T)
== ==
fvOptions(T) fvModels.source(T)
); );
TEqn.relax(); TEqn.relax();
fvOptions.constrain(TEqn); fvConstraints.constrain(TEqn);
TEqn.solve(); TEqn.solve();
fvOptions.constrain(T); fvConstraints.constrain(T);
} }
runTime.write(); runTime.write();

View File

@ -16,16 +16,16 @@
: -betav*dpdt : -betav*dpdt
) )
- fvm::laplacian(Db, hea) - fvm::laplacian(Db, hea)
+ betav*fvOptions(rho, hea) + betav*fvModels.source(rho, hea)
); );
EaEqn.relax(); EaEqn.relax();
fvOptions.constrain(EaEqn); fvConstraints.constrain(EaEqn);
EaEqn.solve(); EaEqn.solve();
fvOptions.constrain(hea); fvConstraints.constrain(hea);
thermo.correct(); thermo.correct();
} }

View File

@ -24,12 +24,12 @@ if (ign.ignited())
//- fvm::div(muEff*fvc::grad(b)/(b + 0.001), heau) //- fvm::div(muEff*fvc::grad(b)/(b + 0.001), heau)
//+ fvm::Sp(fvc::div(muEff*fvc::grad(b)/(b + 0.001)), heau) //+ fvm::Sp(fvc::div(muEff*fvc::grad(b)/(b + 0.001)), heau)
== ==
betav*fvOptions(rho, heau) betav*fvModels.source(rho, heau)
); );
fvOptions.constrain(heauEqn); fvConstraints.constrain(heauEqn);
heauEqn.solve(); heauEqn.solve();
fvOptions.constrain(heau); fvConstraints.constrain(heau);
} }

View File

@ -45,4 +45,5 @@ EXE_LIBS = \
-llaminarFlameSpeedModels \ -llaminarFlameSpeedModels \
-lfiniteVolume \ -lfiniteVolume \
-ldynamicFvMesh \ -ldynamicFvMesh \
-lfvOptions -lfvModels \
-lfvConstraints

View File

@ -78,7 +78,8 @@ Description
#include "Switch.H" #include "Switch.H"
#include "bound.H" #include "bound.H"
#include "pimpleControl.H" #include "pimpleControl.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -120,7 +121,7 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop()) while (pimple.loop())
{ {
fvOptions.correct(); fvModels.correct();
#include "UEqn.H" #include "UEqn.H"

View File

@ -7,10 +7,10 @@
+ turbulence->divDevTau(U) + turbulence->divDevTau(U)
== ==
betav*rho*g betav*rho*g
+ betav*fvOptions(rho, U) + betav*fvModels.source(rho, U)
); );
fvOptions.constrain(UEqn); fvConstraints.constrain(UEqn);
volSymmTensorField invA(inv(I*UEqn.A() + drag->Dcu())); volSymmTensorField invA(inv(I*UEqn.A() + drag->Dcu()));
@ -18,6 +18,6 @@
{ {
U = invA & (UEqn.H() - betav*fvc::grad(p)); U = invA & (UEqn.H() - betav*fvc::grad(p));
U.correctBoundaryConditions(); U.correctBoundaryConditions();
fvOptions.constrain(U); fvConstraints.constrain(U);
K = 0.5*magSqr(U); K = 0.5*magSqr(U);
} }

View File

@ -74,7 +74,7 @@ if (ign.ignited())
- fvm::Sp(fvc::div(phiSt), b) - fvm::Sp(fvc::div(phiSt), b)
- fvm::laplacian(Db, b) - fvm::laplacian(Db, b)
== ==
betav*fvOptions(rho, b) betav*fvModels.source(rho, b)
); );
@ -86,11 +86,11 @@ if (ign.ignited())
// ~~~~~~~~~~~ // ~~~~~~~~~~~
bEqn.relax(); bEqn.relax();
fvOptions.constrain(bEqn); fvConstraints.constrain(bEqn);
bEqn.solve(); bEqn.solve();
fvOptions.constrain(b); fvConstraints.constrain(b);
Info<< "min(b) = " << min(b).value() << endl; Info<< "min(b) = " << min(b).value() << endl;

View File

@ -238,4 +238,5 @@ fields.add(thermo.heu());
flameWrinkling->addXi(fields); flameWrinkling->addXi(fields);
#include "createMRF.H" #include "createMRF.H"
#include "createFvOptions.H" #include "createFvModels.H"
#include "createFvConstraints.H"

View File

@ -24,7 +24,7 @@ if (pimple.transonic())
+ fvm::div(phid, p) + fvm::div(phid, p)
- fvm::laplacian(rho*invA, p) - fvm::laplacian(rho*invA, p)
== ==
betav*fvOptions(psi, p, rho.name()) betav*fvModels.source(psi, p, rho.name())
); );
pEqn.solve(); pEqn.solve();
@ -54,7 +54,7 @@ else
+ fvc::div(phiHbyA) + fvc::div(phiHbyA)
- fvm::laplacian(rho*invA, p) - fvm::laplacian(rho*invA, p)
== ==
betav*fvOptions(psi, p, rho.name()) betav*fvModels.source(psi, p, rho.name())
); );
pEqn.solve(); pEqn.solve();
@ -71,7 +71,7 @@ else
U = HbyA - (invA & (betav*fvc::grad(p))); U = HbyA - (invA & (betav*fvc::grad(p)));
U.correctBoundaryConditions(); U.correctBoundaryConditions();
fvOptions.constrain(U); fvConstraints.constrain(U);
K = 0.5*magSqr(U); K = 0.5*magSqr(U);
if (thermo.dpdt()) if (thermo.dpdt())

View File

@ -16,16 +16,16 @@
: -dpdt : -dpdt
) )
- fvm::laplacian(thermophysicalTransport->alphaEff(), hea) - fvm::laplacian(thermophysicalTransport->alphaEff(), hea)
+ fvOptions(rho, hea) + fvModels.source(rho, hea)
); );
EaEqn.relax(); EaEqn.relax();
fvOptions.constrain(EaEqn); fvConstraints.constrain(EaEqn);
EaEqn.solve(); EaEqn.solve();
fvOptions.constrain(hea); fvConstraints.constrain(hea);
thermo.correct(); thermo.correct();
} }

View File

@ -25,12 +25,12 @@ if (ign.ignited())
//+ fvm::Sp(fvc::div(muEff*fvc::grad(b)/(b + 0.001)), heau) //+ fvm::Sp(fvc::div(muEff*fvc::grad(b)/(b + 0.001)), heau)
== ==
fvOptions(rho, heau) fvModels.source(rho, heau)
); );
fvOptions.constrain(heauEqn); fvConstraints.constrain(heauEqn);
heauEqn.solve(); heauEqn.solve();
fvOptions.constrain(heau); fvConstraints.constrain(heau);
} }

View File

@ -21,6 +21,7 @@ EXE_LIBS = \
-lspecie \ -lspecie \
-llaminarFlameSpeedModels \ -llaminarFlameSpeedModels \
-lfiniteVolume \ -lfiniteVolume \
-lfvOptions \ -lfvModels \
-lfvConstraints \
-lsampling \ -lsampling \
-lmeshTools -lmeshTools

View File

@ -6,17 +6,17 @@
+ MRF.DDt(rho, U) + MRF.DDt(rho, U)
+ turbulence->divDevTau(U) + turbulence->divDevTau(U)
== ==
fvOptions(rho, U) fvModels.source(rho, U)
); );
UEqn.relax(); UEqn.relax();
fvOptions.constrain(UEqn); fvConstraints.constrain(UEqn);
if (pimple.momentumPredictor()) if (pimple.momentumPredictor())
{ {
solve(UEqn == -fvc::grad(p)); solve(UEqn == -fvc::grad(p));
fvOptions.constrain(U); fvConstraints.constrain(U);
K = 0.5*magSqr(U); K = 0.5*magSqr(U);
} }

View File

@ -14,7 +14,8 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lfvOptions \ -lfvModels \
-lfvConstraints \
-lsampling \ -lsampling \
-lmeshTools \ -lmeshTools \
-lengine \ -lengine \

View File

@ -4,13 +4,13 @@
+ fvm::div(phi, U) + fvm::div(phi, U)
+ turbulence->divDevTau(U) + turbulence->divDevTau(U)
== ==
fvOptions(rho, U) fvModels.source(rho, U)
); );
if (pimple.momentumPredictor()) if (pimple.momentumPredictor())
{ {
solve(UEqn == -fvc::grad(p)); solve(UEqn == -fvc::grad(p));
fvOptions.constrain(U); fvConstraints.constrain(U);
K = 0.5*magSqr(U); K = 0.5*magSqr(U);
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -60,7 +60,8 @@ Description
#include "OFstream.H" #include "OFstream.H"
#include "mathematicalConstants.H" #include "mathematicalConstants.H"
#include "pimpleControl.H" #include "pimpleControl.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -32,7 +32,7 @@ if (pimple.transonic())
+ fvm::div(phid, p) + fvm::div(phid, p)
- fvm::laplacian(rhorAUf, p) - fvm::laplacian(rhorAUf, p)
== ==
fvOptions(psi, p, rho.name()) fvModels.source(psi, p, rho.name())
); );
pEqn.solve(); pEqn.solve();
@ -68,7 +68,7 @@ else
+ fvc::div(phiHbyA) + fvc::div(phiHbyA)
- fvm::laplacian(rhorAUf, p) - fvm::laplacian(rhorAUf, p)
== ==
fvOptions(psi, p, rho.name()) fvModels.source(psi, p, rho.name())
); );
pEqn.solve(); pEqn.solve();
@ -85,7 +85,7 @@ else
U = HbyA - rAU*fvc::grad(p); U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
fvOptions.constrain(U); fvConstraints.constrain(U);
K = 0.5*magSqr(U); K = 0.5*magSqr(U);
{ {

View File

@ -57,7 +57,8 @@ Description
#include "ignition.H" #include "ignition.H"
#include "Switch.H" #include "Switch.H"
#include "pimpleControl.H" #include "pimpleControl.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -97,7 +98,7 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop()) while (pimple.loop())
{ {
fvOptions.correct(); fvModels.correct();
#include "UEqn.H" #include "UEqn.H"

View File

@ -54,7 +54,7 @@ if (ign.ignited())
- fvm::Sp(fvc::div(phiSt), b) - fvm::Sp(fvc::div(phiSt), b)
- fvm::laplacian(thermophysicalTransport->alphaEff(), b) - fvm::laplacian(thermophysicalTransport->alphaEff(), b)
== ==
fvOptions(rho, b) fvModels.source(rho, b)
); );
@ -67,11 +67,11 @@ if (ign.ignited())
// ~~~~~~~~~~~ // ~~~~~~~~~~~
bEqn.relax(); bEqn.relax();
fvOptions.constrain(bEqn); fvConstraints.constrain(bEqn);
bEqn.solve(); bEqn.solve();
fvOptions.constrain(b); fvConstraints.constrain(b);
Info<< "min(b) = " << min(b).value() << endl; Info<< "min(b) = " << min(b).value() << endl;
@ -163,16 +163,16 @@ if (ign.ignited())
== ==
- fvm::SuSp(-rho*Rc*Su0/Su, Su) - fvm::SuSp(-rho*Rc*Su0/Su, Su)
- fvm::SuSp(rho*(sigmas + Rc), Su) - fvm::SuSp(rho*(sigmas + Rc), Su)
+ fvOptions(rho, Su) + fvModels.source(rho, Su)
); );
SuEqn.relax(); SuEqn.relax();
fvOptions.constrain(SuEqn); fvConstraints.constrain(SuEqn);
SuEqn.solve(); SuEqn.solve();
fvOptions.constrain(Su); fvConstraints.constrain(Su);
// Limit the maximum Su // Limit the maximum Su
// ~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~
@ -250,16 +250,16 @@ if (ign.ignited())
), ),
Xi Xi
) )
+ fvOptions(rho, Xi) + fvModels.source(rho, Xi)
); );
XiEqn.relax(); XiEqn.relax();
fvOptions.constrain(XiEqn); fvConstraints.constrain(XiEqn);
XiEqn.solve(); XiEqn.solve();
fvOptions.constrain(Xi); fvConstraints.constrain(Xi);
// Correct boundedness of Xi // Correct boundedness of Xi
// ~~~~~~~~~~~~~~~~~~~~~~~~~ // ~~~~~~~~~~~~~~~~~~~~~~~~~

View File

@ -146,4 +146,5 @@ fields.add(thermo.he());
fields.add(thermo.heu()); fields.add(thermo.heu());
#include "createMRF.H" #include "createMRF.H"
#include "createFvOptions.H" #include "createFvModels.H"
#include "createFvConstraints.H"

View File

@ -19,12 +19,12 @@ if (composition.contains("ft"))
+ mvConvection->fvmDiv(phi, ft) + mvConvection->fvmDiv(phi, ft)
- fvm::laplacian(thermophysicalTransport->alphaEff(), ft) - fvm::laplacian(thermophysicalTransport->alphaEff(), ft)
== ==
fvOptions(rho, ft) fvModels.source(rho, ft)
); );
fvOptions.constrain(ftEqn); fvConstraints.constrain(ftEqn);
ftEqn.solve(); ftEqn.solve();
fvOptions.constrain(ft); fvConstraints.constrain(ft);
} }

View File

@ -26,7 +26,7 @@ if (pimple.transonic())
+ fvm::div(phid, p) + fvm::div(phid, p)
- fvm::laplacian(rhorAUf, p) - fvm::laplacian(rhorAUf, p)
== ==
fvOptions(psi, p, rho.name()) fvModels.source(psi, p, rho.name())
); );
pEqn.solve(); pEqn.solve();
@ -61,7 +61,7 @@ else
+ fvc::div(phiHbyA) + fvc::div(phiHbyA)
- fvm::laplacian(rhorAUf, p) - fvm::laplacian(rhorAUf, p)
== ==
fvOptions(psi, p, rho.name()) fvModels.source(psi, p, rho.name())
); );
pEqn.solve(); pEqn.solve();
@ -78,7 +78,7 @@ else
U = HbyA - rAU*fvc::grad(p); U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
fvOptions.constrain(U); fvConstraints.constrain(U);
K = 0.5*magSqr(U); K = 0.5*magSqr(U);
if (thermo.dpdt()) if (thermo.dpdt())

View File

@ -23,4 +23,5 @@ EXE_LIBS = \
-lspecie \ -lspecie \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-lfvOptions -lfvModels \
-lfvConstraints

View File

@ -36,7 +36,8 @@ Description
#include "fluidThermoMomentumTransportModel.H" #include "fluidThermoMomentumTransportModel.H"
#include "fluidThermophysicalTransportModel.H" #include "fluidThermophysicalTransportModel.H"
#include "OFstream.H" #include "OFstream.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
#include "pimpleControl.H" #include "pimpleControl.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -84,7 +85,7 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop()) while (pimple.loop())
{ {
fvOptions.correct(); fvModels.correct();
#include "UEqn.H" #include "UEqn.H"

View File

@ -74,4 +74,5 @@ Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U)); volScalarField K("K", 0.5*magSqr(U));
#include "createMRF.H" #include "createMRF.H"
#include "createFvOptions.H" #include "createFvModels.H"
#include "createFvConstraints.H"

View File

@ -22,7 +22,8 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lfvOptions \ -lfvModels \
-lfvConstraints \
-lmeshTools \ -lmeshTools \
-lsampling \ -lsampling \
-lmomentumTransportModels \ -lmomentumTransportModels \

View File

@ -7,12 +7,12 @@
+ turbulence->divDevTau(U) + turbulence->divDevTau(U)
== ==
parcels.SU(U) parcels.SU(U)
+ fvOptions(rho, U) + fvModels.source(rho, U)
); );
UEqn.relax(); UEqn.relax();
fvOptions.constrain(UEqn); fvConstraints.constrain(UEqn);
if (pimple.momentumPredictor()) if (pimple.momentumPredictor())
{ {
@ -29,6 +29,6 @@
) )
); );
fvOptions.constrain(U); fvConstraints.constrain(U);
K = 0.5*magSqr(U); K = 0.5*magSqr(U);
} }

View File

@ -26,16 +26,16 @@ tmp<fv::convectionScheme<scalar>> mvConvection
parcels.SYi(i, Yi) parcels.SYi(i, Yi)
+ surfaceFilm.Srho(i) + surfaceFilm.Srho(i)
+ combustion->R(Yi) + combustion->R(Yi)
+ fvOptions(rho, Yi) + fvModels.source(rho, Yi)
); );
YiEqn.relax(); YiEqn.relax();
fvOptions.constrain(YiEqn); fvConstraints.constrain(YiEqn);
YiEqn.solve("Yi"); YiEqn.solve("Yi");
fvOptions.constrain(Yi); fvConstraints.constrain(Yi);
} }
} }
@ -62,16 +62,16 @@ tmp<fv::convectionScheme<scalar>> mvConvection
combustion->Qdot() combustion->Qdot()
+ parcels.Sh(he) + parcels.Sh(he)
+ surfaceFilm.Sh() + surfaceFilm.Sh()
+ fvOptions(rho, he) + fvModels.source(rho, he)
); );
EEqn.relax(); EEqn.relax();
fvOptions.constrain(EEqn); fvConstraints.constrain(EEqn);
EEqn.solve(); EEqn.solve();
fvOptions.constrain(he); fvConstraints.constrain(he);
thermo.correct(); thermo.correct();

View File

@ -134,5 +134,6 @@ volScalarField K("K", 0.5*magSqr(U));
#include "createClouds.H" #include "createClouds.H"
#include "createSurfaceFilmModel.H" #include "createSurfaceFilmModel.H"
#include "createFvOptions.H" #include "createFvModels.H"
#include "createFvConstraints.H"
#include "checkRadiationModel.H" #include "checkRadiationModel.H"

View File

@ -39,7 +39,8 @@ Description
#include "fluidReactionThermo.H" #include "fluidReactionThermo.H"
#include "combustionModel.H" #include "combustionModel.H"
#include "pimpleControl.H" #include "pimpleControl.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -86,7 +87,7 @@ int main(int argc, char *argv[])
// --- PIMPLE loop // --- PIMPLE loop
while (pimple.loop()) while (pimple.loop())
{ {
fvOptions.correct(); fvModels.correct();
#include "UEqn.H" #include "UEqn.H"
#include "YEEqn.H" #include "YEEqn.H"

View File

@ -33,7 +33,7 @@ while (pimple.correctNonOrthogonal())
== ==
parcels.Srho() parcels.Srho()
+ surfaceFilm.Srho() + surfaceFilm.Srho()
+ fvOptions(psi, p_rgh, rho.name()) + fvModels.source(psi, p_rgh, rho.name())
); );
p_rghEqn.solve(); p_rghEqn.solve();
@ -43,7 +43,7 @@ while (pimple.correctNonOrthogonal())
phi = phiHbyA + p_rghEqn.flux(); phi = phiHbyA + p_rghEqn.flux();
U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/rhorAUf); U = HbyA + rAU*fvc::reconstruct((p_rghEqn.flux() + phig)/rhorAUf);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
fvOptions.constrain(U); fvConstraints.constrain(U);
} }
} }

View File

@ -37,12 +37,12 @@ Description
== ==
parcels.Srho(rho) parcels.Srho(rho)
+ surfaceFilm.Srho() + surfaceFilm.Srho()
+ fvOptions(rho) + fvModels.source(rho)
); );
rhoEqn.solve(); rhoEqn.solve();
fvOptions.constrain(rho); fvConstraints.constrain(rho);
} }
// ************************************************************************* // // ************************************************************************* //

View File

@ -18,16 +18,16 @@
+ thermophysicalTransport->divq(he) + thermophysicalTransport->divq(he)
== ==
reaction->Qdot() reaction->Qdot()
+ fvOptions(rho, he) + fvModels.source(rho, he)
); );
EEqn.relax(); EEqn.relax();
fvOptions.constrain(EEqn); fvConstraints.constrain(EEqn);
EEqn.solve(); EEqn.solve();
fvOptions.constrain(he); fvConstraints.constrain(he);
thermo.correct(); thermo.correct();

View File

@ -31,4 +31,5 @@ EXE_LIBS = \
-ltopoChangerFvMesh \ -ltopoChangerFvMesh \
-lmeshTools \ -lmeshTools \
-lsampling \ -lsampling \
-lfvOptions -lfvModels \
-lfvConstraints

View File

@ -8,18 +8,18 @@ tmp<fvVectorMatrix> tUEqn
+ MRF.DDt(rho, U) + MRF.DDt(rho, U)
+ turbulence->divDevTau(U) + turbulence->divDevTau(U)
== ==
fvOptions(rho, U) fvModels.source(rho, U)
); );
fvVectorMatrix& UEqn = tUEqn.ref(); fvVectorMatrix& UEqn = tUEqn.ref();
UEqn.relax(); UEqn.relax();
fvOptions.constrain(UEqn); fvConstraints.constrain(UEqn);
if (pimple.momentumPredictor()) if (pimple.momentumPredictor())
{ {
solve(UEqn == -fvc::grad(p)); solve(UEqn == -fvc::grad(p));
fvOptions.constrain(U); fvConstraints.constrain(U);
K = 0.5*magSqr(U); K = 0.5*magSqr(U);
} }

View File

@ -24,16 +24,16 @@ forAll(Y, i)
+ thermophysicalTransport->divj(Yi) + thermophysicalTransport->divj(Yi)
== ==
reaction->R(Yi) reaction->R(Yi)
+ fvOptions(rho, Yi) + fvModels.source(rho, Yi)
); );
YiEqn.relax(); YiEqn.relax();
fvOptions.constrain(YiEqn); fvConstraints.constrain(YiEqn);
YiEqn.solve("Yi"); YiEqn.solve("Yi");
fvOptions.constrain(Yi); fvConstraints.constrain(Yi);
} }
} }

View File

@ -19,7 +19,8 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lfvOptions \ -lfvModels \
-lfvConstraints \
-lmeshTools \ -lmeshTools \
-lsampling \ -lsampling \
-lmomentumTransportModels \ -lmomentumTransportModels \

View File

@ -6,13 +6,13 @@
+ MRF.DDt(rho, U) + MRF.DDt(rho, U)
+ turbulence->divDevTau(U) + turbulence->divDevTau(U)
== ==
fvOptions(rho, U) fvModels.source(rho, U)
); );
fvVectorMatrix& UEqn = tUEqn.ref(); fvVectorMatrix& UEqn = tUEqn.ref();
UEqn.relax(); UEqn.relax();
fvOptions.constrain(UEqn); fvConstraints.constrain(UEqn);
if (pimple.momentumPredictor()) if (pimple.momentumPredictor())
{ {
@ -29,6 +29,6 @@
) )
); );
fvOptions.constrain(U); fvConstraints.constrain(U);
K = 0.5*magSqr(U); K = 0.5*magSqr(U);
} }

View File

@ -38,7 +38,8 @@ Description
#include "multivariateScheme.H" #include "multivariateScheme.H"
#include "pimpleControl.H" #include "pimpleControl.H"
#include "pressureControl.H" #include "pressureControl.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
#include "localEulerDdtScheme.H" #include "localEulerDdtScheme.H"
#include "fvcSmooth.H" #include "fvcSmooth.H"
@ -92,7 +93,7 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop()) while (pimple.loop())
{ {
fvOptions.correct(); fvModels.correct();
#include "UEqn.H" #include "UEqn.H"
#include "YEqn.H" #include "YEqn.H"

View File

@ -130,7 +130,8 @@ forAll(Y, i)
fields.add(thermo.he()); fields.add(thermo.he());
#include "createMRF.H" #include "createMRF.H"
#include "createFvOptions.H" #include "createFvModels.H"
#include "createFvConstraints.H"
// This solver does not support moving mesh but it uses the pressure equation // This solver does not support moving mesh but it uses the pressure equation

View File

@ -98,4 +98,5 @@ forAll(Y, i)
fields.add(thermo.he()); fields.add(thermo.he());
#include "createMRF.H" #include "createMRF.H"
#include "createFvOptions.H" #include "createFvModels.H"
#include "createFvConstraints.H"

View File

@ -39,7 +39,8 @@ Description
#include "pimpleControl.H" #include "pimpleControl.H"
#include "pressureControl.H" #include "pressureControl.H"
#include "CorrectPhi.H" #include "CorrectPhi.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
#include "localEulerDdtScheme.H" #include "localEulerDdtScheme.H"
#include "fvcSmooth.H" #include "fvcSmooth.H"
@ -104,7 +105,7 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop()) while (pimple.loop())
{ {
fvOptions.correct(); fvModels.correct();
if (pimple.frozenFlow()) if (pimple.frozenFlow())
{ {

View File

@ -11,7 +11,8 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lfvOptions \ -lfvModels \
-lfvConstraints \
-lfluidThermophysicalModels \ -lfluidThermophysicalModels \
-lspecie \ -lspecie \
-lrhoCentralFoam \ -lrhoCentralFoam \

View File

@ -17,16 +17,16 @@
) )
+ thermophysicalTransport->divq(he) + thermophysicalTransport->divq(he)
== ==
fvOptions(rho, he) fvModels.source(rho, he)
); );
EEqn.relax(); EEqn.relax();
fvOptions.constrain(EEqn); fvConstraints.constrain(EEqn);
EEqn.solve(); EEqn.solve();
fvOptions.constrain(he); fvConstraints.constrain(he);
thermo.correct(); thermo.correct();
} }

View File

@ -20,4 +20,5 @@ EXE_LIBS = \
-ltopoChangerFvMesh \ -ltopoChangerFvMesh \
-lmeshTools \ -lmeshTools \
-lsampling \ -lsampling \
-lfvOptions -lfvModels \
-lfvConstraints

View File

@ -8,18 +8,18 @@ tmp<fvVectorMatrix> tUEqn
+ MRF.DDt(rho, U) + MRF.DDt(rho, U)
+ turbulence->divDevTau(U) + turbulence->divDevTau(U)
== ==
fvOptions(rho, U) fvModels.source(rho, U)
); );
fvVectorMatrix& UEqn = tUEqn.ref(); fvVectorMatrix& UEqn = tUEqn.ref();
UEqn.relax(); UEqn.relax();
fvOptions.constrain(UEqn); fvConstraints.constrain(UEqn);
if (pimple.momentumPredictor()) if (pimple.momentumPredictor())
{ {
solve(UEqn == -fvc::grad(p)); solve(UEqn == -fvc::grad(p));
fvOptions.constrain(U); fvConstraints.constrain(U);
K = 0.5*magSqr(U); K = 0.5*magSqr(U);
} }

View File

@ -87,4 +87,5 @@ volScalarField K("K", 0.5*magSqr(U));
dimensionedScalar initialMass = fvc::domainIntegrate(rho); dimensionedScalar initialMass = fvc::domainIntegrate(rho);
#include "createMRF.H" #include "createMRF.H"
#include "createFvOptions.H" #include "createFvModels.H"
#include "createFvConstraints.H"

View File

@ -70,7 +70,7 @@ if (pimple.transonic())
fvc::ddt(rho) + psi*correction(fvm::ddt(p)) fvc::ddt(rho) + psi*correction(fvm::ddt(p))
+ fvc::div(phiHbyA) + fvm::div(phid, p) + fvc::div(phiHbyA) + fvm::div(phid, p)
== ==
fvOptions(psi, p, rho.name()) fvModels.source(psi, p, rho.name())
); );
while (pimple.correctNonOrthogonal()) while (pimple.correctNonOrthogonal())
@ -112,7 +112,7 @@ else
fvc::ddt(rho) + psi*correction(fvm::ddt(p)) fvc::ddt(rho) + psi*correction(fvm::ddt(p))
+ fvc::div(phiHbyA) + fvc::div(phiHbyA)
== ==
fvOptions(psi, p, rho.name()) fvModels.source(psi, p, rho.name())
); );
while (pimple.correctNonOrthogonal()) while (pimple.correctNonOrthogonal())
@ -159,7 +159,7 @@ p.relax();
U = HbyA - rAAtU*fvc::grad(p); U = HbyA - rAAtU*fvc::grad(p);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
fvOptions.constrain(U); fvConstraints.constrain(U);
K = 0.5*magSqr(U); K = 0.5*magSqr(U);
if (mesh.steady()) if (mesh.steady())

View File

@ -41,7 +41,8 @@ Description
#include "pimpleControl.H" #include "pimpleControl.H"
#include "pressureControl.H" #include "pressureControl.H"
#include "CorrectPhi.H" #include "CorrectPhi.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
#include "localEulerDdtScheme.H" #include "localEulerDdtScheme.H"
#include "fvcSmooth.H" #include "fvcSmooth.H"
@ -144,7 +145,7 @@ int main(int argc, char *argv[])
#include "rhoEqn.H" #include "rhoEqn.H"
} }
fvOptions.correct(); fvModels.correct();
#include "UEqn.H" #include "UEqn.H"
#include "EEqn.H" #include "EEqn.H"

View File

@ -11,16 +11,16 @@
) )
+ thermophysicalTransport->divq(he) + thermophysicalTransport->divq(he)
== ==
fvOptions(rho, he) fvModels.source(rho, he)
); );
EEqn.relax(); EEqn.relax();
fvOptions.constrain(EEqn); fvConstraints.constrain(EEqn);
EEqn.solve(); EEqn.solve();
fvOptions.constrain(he); fvConstraints.constrain(he);
thermo.correct(); thermo.correct();
} }

View File

@ -17,4 +17,5 @@ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lsampling \ -lsampling \
-lmeshTools \ -lmeshTools \
-lfvOptions -lfvModels \
-lfvConstraints

View File

@ -8,14 +8,14 @@
+ MRF.DDt(rho, U) + MRF.DDt(rho, U)
+ turbulence->divDevTau(U) + turbulence->divDevTau(U)
== ==
fvOptions(rho, U) fvModels.source(rho, U)
); );
fvVectorMatrix& UEqn = tUEqn.ref(); fvVectorMatrix& UEqn = tUEqn.ref();
UEqn.relax(); UEqn.relax();
fvOptions.constrain(UEqn); fvConstraints.constrain(UEqn);
solve(UEqn == -fvc::grad(p)); solve(UEqn == -fvc::grad(p));
fvOptions.constrain(U); fvConstraints.constrain(U);

View File

@ -69,4 +69,5 @@ autoPtr<fluidThermophysicalTransportModel> thermophysicalTransport
dimensionedScalar initialMass = fvc::domainIntegrate(rho); dimensionedScalar initialMass = fvc::domainIntegrate(rho);
#include "createMRF.H" #include "createMRF.H"
#include "createFvOptions.H" #include "createFvModels.H"
#include "createFvConstraints.H"

View File

@ -64,7 +64,7 @@ if (simple.transonic())
+ fvm::div(phid, p) + fvm::div(phid, p)
- fvm::laplacian(rhorAAtUf, p) - fvm::laplacian(rhorAAtUf, p)
== ==
fvOptions(psi, p, rho.name()) fvModels.source(psi, p, rho.name())
); );
// Relax the pressure equation to ensure diagonal-dominance // Relax the pressure equation to ensure diagonal-dominance
@ -101,7 +101,7 @@ else
fvc::div(phiHbyA) fvc::div(phiHbyA)
- fvm::laplacian(rhorAAtUf, p) - fvm::laplacian(rhorAAtUf, p)
== ==
fvOptions(psi, p, rho.name()) fvModels.source(psi, p, rho.name())
); );
pEqn.setReference pEqn.setReference
@ -126,7 +126,7 @@ p.relax();
U = HbyA - rAAtU*fvc::grad(p); U = HbyA - rAAtU*fvc::grad(p);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
fvOptions.constrain(U); fvConstraints.constrain(U);
pressureControl.limit(p); pressureControl.limit(p);

View File

@ -19,4 +19,5 @@ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lsampling \ -lsampling \
-lmeshTools \ -lmeshTools \
-lfvOptions -lfvModels \
-lfvConstraints

View File

@ -8,7 +8,7 @@
+ MRF.DDt(rho, U) + MRF.DDt(rho, U)
+ turbulence->divDevTau(U) + turbulence->divDevTau(U)
== ==
fvOptions(rho, U) fvModels.source(rho, U)
); );
fvVectorMatrix& UEqn = tUEqn.ref(); fvVectorMatrix& UEqn = tUEqn.ref();
@ -28,7 +28,7 @@
trTU = inv(tTU()); trTU = inv(tTU());
trTU.ref().rename("rAU"); trTU.ref().rename("rAU");
fvOptions.constrain(UEqn); fvConstraints.constrain(UEqn);
volVectorField gradp(fvc::grad(p)); volVectorField gradp(fvc::grad(p));
@ -38,17 +38,17 @@
} }
U.correctBoundaryConditions(); U.correctBoundaryConditions();
fvOptions.constrain(U); fvConstraints.constrain(U);
} }
else else
{ {
pZones.addResistance(UEqn); pZones.addResistance(UEqn);
fvOptions.constrain(UEqn); fvConstraints.constrain(UEqn);
solve(UEqn == -fvc::grad(p)); solve(UEqn == -fvc::grad(p));
fvOptions.constrain(U); fvConstraints.constrain(U);
trAU = 1.0/UEqn.A(); trAU = 1.0/UEqn.A();
trAU.ref().rename("rAU"); trAU.ref().rename("rAU");

View File

@ -34,7 +34,7 @@
tpEqn = tpEqn =
( (
fvm::laplacian(rho*trTU(), p) fvm::laplacian(rho*trTU(), p)
+ fvOptions(psi, p, rho.name()) + fvModels.source(psi, p, rho.name())
== ==
fvc::div(phiHbyA) fvc::div(phiHbyA)
); );
@ -44,7 +44,7 @@
tpEqn = tpEqn =
( (
fvm::laplacian(rho*trAU(), p) fvm::laplacian(rho*trAU(), p)
+ fvOptions(psi, p, rho.name()) + fvModels.source(psi, p, rho.name())
== ==
fvc::div(phiHbyA) fvc::div(phiHbyA)
); );
@ -81,7 +81,7 @@
} }
U.correctBoundaryConditions(); U.correctBoundaryConditions();
fvOptions.constrain(U); fvConstraints.constrain(U);
pressureControl.limit(p); pressureControl.limit(p);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -36,7 +36,8 @@ Description
#include "fluidThermophysicalTransportModel.H" #include "fluidThermophysicalTransportModel.H"
#include "simpleControl.H" #include "simpleControl.H"
#include "pressureControl.H" #include "pressureControl.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
#include "IOporosityModelList.H" #include "IOporosityModelList.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

View File

@ -35,7 +35,8 @@ Description
#include "fluidThermophysicalTransportModel.H" #include "fluidThermophysicalTransportModel.H"
#include "simpleControl.H" #include "simpleControl.H"
#include "pressureControl.H" #include "pressureControl.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -61,7 +62,7 @@ int main(int argc, char *argv[])
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
fvOptions.correct(); fvModels.correct();
// Pressure-velocity SIMPLE corrector // Pressure-velocity SIMPLE corrector
#include "UEqn.H" #include "UEqn.H"

View File

@ -18,16 +18,16 @@
+ thermophysicalTransport->divq(he) + thermophysicalTransport->divq(he)
== ==
rho*(U&g) rho*(U&g)
+ fvOptions(rho, he) + fvModels.source(rho, he)
); );
EEqn.relax(); EEqn.relax();
fvOptions.constrain(EEqn); fvConstraints.constrain(EEqn);
EEqn.solve(); EEqn.solve();
fvOptions.constrain(he); fvConstraints.constrain(he);
thermo.correct(); thermo.correct();
} }

View File

@ -22,4 +22,5 @@ EXE_LIBS = \
-ltopoChangerFvMesh \ -ltopoChangerFvMesh \
-lmeshTools \ -lmeshTools \
-lsampling \ -lsampling \
-lfvOptions -lfvModels \
-lfvConstraints

View File

@ -8,13 +8,13 @@
+ MRF.DDt(rho, U) + MRF.DDt(rho, U)
+ turbulence->divDevTau(U) + turbulence->divDevTau(U)
== ==
fvOptions(rho, U) fvModels.source(rho, U)
); );
fvVectorMatrix& UEqn = tUEqn.ref(); fvVectorMatrix& UEqn = tUEqn.ref();
UEqn.relax(); UEqn.relax();
fvOptions.constrain(UEqn); fvConstraints.constrain(UEqn);
if (pimple.momentumPredictor()) if (pimple.momentumPredictor())
{ {
@ -31,6 +31,6 @@
) )
); );
fvOptions.constrain(U); fvConstraints.constrain(U);
K = 0.5*magSqr(U); K = 0.5*magSqr(U);
} }

View File

@ -42,7 +42,8 @@ Description
#include "pimpleControl.H" #include "pimpleControl.H"
#include "pressureControl.H" #include "pressureControl.H"
#include "CorrectPhi.H" #include "CorrectPhi.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
#include "localEulerDdtScheme.H" #include "localEulerDdtScheme.H"
#include "fvcSmooth.H" #include "fvcSmooth.H"
@ -143,7 +144,7 @@ int main(int argc, char *argv[])
#include "rhoEqn.H" #include "rhoEqn.H"
} }
fvOptions.correct(); fvModels.correct();
#include "UEqn.H" #include "UEqn.H"
#include "EEqn.H" #include "EEqn.H"

View File

@ -109,5 +109,6 @@ volScalarField K("K", 0.5*magSqr(U));
dimensionedScalar initialMass = fvc::domainIntegrate(rho); dimensionedScalar initialMass = fvc::domainIntegrate(rho);
#include "createMRF.H" #include "createMRF.H"
#include "createFvOptions.H" #include "createFvModels.H"
#include "createFvConstraints.H"
#include "checkRadiationModel.H" #include "checkRadiationModel.H"

View File

@ -53,7 +53,7 @@ if (pimple.transonic())
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh)) fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
+ fvc::div(phiHbyA) + fvm::div(phid, p_rgh) + fvc::div(phiHbyA) + fvm::div(phid, p_rgh)
== ==
fvOptions(psi, p_rgh, rho.name()) fvModels.source(psi, p_rgh, rho.name())
); );
while (pimple.correctNonOrthogonal()) while (pimple.correctNonOrthogonal())
@ -79,7 +79,7 @@ else
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh)) fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
+ fvc::div(phiHbyA) + fvc::div(phiHbyA)
== ==
fvOptions(psi, p_rgh, rho.name()) fvModels.source(psi, p_rgh, rho.name())
); );
while (pimple.correctNonOrthogonal()) while (pimple.correctNonOrthogonal())
@ -127,7 +127,7 @@ p_rgh.relax();
// calculated from the relaxed pressure // calculated from the relaxed pressure
U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf); U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
fvOptions.constrain(U); fvConstraints.constrain(U);
K = 0.5*magSqr(U); K = 0.5*magSqr(U);
if (mesh.steady()) if (mesh.steady())

View File

@ -12,16 +12,16 @@
+ thermophysicalTransport->divq(he) + thermophysicalTransport->divq(he)
== ==
rho*(U&g) rho*(U&g)
+ fvOptions(rho, he) + fvModels.source(rho, he)
); );
EEqn.relax(); EEqn.relax();
fvOptions.constrain(EEqn); fvConstraints.constrain(EEqn);
EEqn.solve(); EEqn.solve();
fvOptions.constrain(he); fvConstraints.constrain(he);
thermo.correct(); thermo.correct();
} }

View File

@ -10,7 +10,8 @@ EXE_INC = \
EXE_LIBS = \ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lfvOptions \ -lfvModels \
-lfvConstraints \
-lsampling \ -lsampling \
-lmeshTools \ -lmeshTools \
-lthermophysicalTransportModels \ -lthermophysicalTransportModels \

View File

@ -8,13 +8,13 @@
+ MRF.DDt(rho, U) + MRF.DDt(rho, U)
+ turbulence->divDevTau(U) + turbulence->divDevTau(U)
== ==
fvOptions(rho, U) fvModels.source(rho, U)
); );
fvVectorMatrix& UEqn = tUEqn.ref(); fvVectorMatrix& UEqn = tUEqn.ref();
UEqn.relax(); UEqn.relax();
fvOptions.constrain(UEqn); fvConstraints.constrain(UEqn);
if (simple.momentumPredictor()) if (simple.momentumPredictor())
{ {
@ -31,5 +31,5 @@
) )
); );
fvOptions.constrain(U); fvConstraints.constrain(U);
} }

View File

@ -35,7 +35,8 @@ Description
#include "fluidThermophysicalTransportModel.H" #include "fluidThermophysicalTransportModel.H"
#include "simpleControl.H" #include "simpleControl.H"
#include "pressureControl.H" #include "pressureControl.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -61,7 +62,7 @@ int main(int argc, char *argv[])
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
fvOptions.correct(); fvModels.correct();
// Pressure-velocity SIMPLE corrector // Pressure-velocity SIMPLE corrector
{ {

View File

@ -91,5 +91,6 @@ mesh.setFluxRequired(p_rgh.name());
dimensionedScalar initialMass = fvc::domainIntegrate(rho); dimensionedScalar initialMass = fvc::domainIntegrate(rho);
#include "createMRF.H" #include "createMRF.H"
#include "createFvOptions.H" #include "createFvModels.H"
#include "createFvConstraints.H"
#include "checkRadiationModel.H" #include "checkRadiationModel.H"

View File

@ -41,7 +41,7 @@ if (simple.transonic())
fvc::div(phiHbyA) + fvm::div(phid, p_rgh) fvc::div(phiHbyA) + fvm::div(phid, p_rgh)
- fvm::laplacian(rhorAUf, p_rgh) - fvm::laplacian(rhorAUf, p_rgh)
== ==
fvOptions(psi, p_rgh, rho.name()); fvModels.source(psi, p_rgh, rho.name());
// Relax the pressure equation to ensure diagonal-dominance // Relax the pressure equation to ensure diagonal-dominance
p_rghEqn.relax(); p_rghEqn.relax();
@ -63,7 +63,7 @@ else
fvc::div(phiHbyA) fvc::div(phiHbyA)
- fvm::laplacian(rhorAUf, p_rgh) - fvm::laplacian(rhorAUf, p_rgh)
== ==
fvOptions(psi, p_rgh, rho.name()); fvModels.source(psi, p_rgh, rho.name());
p_rghEqn.setReference p_rghEqn.setReference
( (
@ -88,7 +88,7 @@ p_rgh.relax();
// calculated from the relaxed pressure // calculated from the relaxed pressure
U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf); U = HbyA + rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
fvOptions.constrain(U); fvConstraints.constrain(U);
pressureControl.limit(p); pressureControl.limit(p);

View File

@ -37,6 +37,7 @@ EXE_LIBS = \
-lfluidReactionThermophysicalTransportModels \ -lfluidReactionThermophysicalTransportModels \
-lmeshTools \ -lmeshTools \
-lfiniteVolume \ -lfiniteVolume \
-lfvOptions \ -lfvModels \
-lfvConstraints \
-lregionModels \ -lregionModels \
-lsampling -lsampling

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org \\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -41,7 +41,8 @@ Description
#include "compressibleCourantNo.H" #include "compressibleCourantNo.H"
#include "solidRegionDiffNo.H" #include "solidRegionDiffNo.H"
#include "solidThermo.H" #include "solidThermo.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
#include "coordinateSystem.H" #include "coordinateSystem.H"
#include "pimpleMultiRegionControl.H" #include "pimpleMultiRegionControl.H"
#include "pressureControl.H" #include "pressureControl.H"

View File

@ -24,16 +24,16 @@
== ==
rho*(U&g) rho*(U&g)
+ reaction.Qdot() + reaction.Qdot()
+ fvOptions(rho, he) + fvModels.source(rho, he)
); );
EEqn.relax(); EEqn.relax();
fvOptions.constrain(EEqn); fvConstraints.constrain(EEqn);
EEqn.solve(); EEqn.solve();
fvOptions.constrain(he); fvConstraints.constrain(he);
thermo.correct(); thermo.correct();

View File

@ -8,13 +8,13 @@
+ MRF.DDt(rho, U) + MRF.DDt(rho, U)
+ turbulence.divDevTau(U) + turbulence.divDevTau(U)
== ==
fvOptions(rho, U) fvModels.source(rho, U)
); );
fvVectorMatrix& UEqn = tUEqn.ref(); fvVectorMatrix& UEqn = tUEqn.ref();
UEqn.relax(); UEqn.relax();
fvOptions.constrain(UEqn); fvConstraints.constrain(UEqn);
if (pimple.momentumPredictor()) if (pimple.momentumPredictor())
{ {
@ -31,8 +31,8 @@
) )
); );
fvOptions.constrain(U); fvConstraints.constrain(U);
K = 0.5*magSqr(U); K = 0.5*magSqr(U);
} }
fvOptions.constrain(U); fvConstraints.constrain(U);

View File

@ -28,16 +28,16 @@ forAll(Y, i)
+ thermophysicalTransport.divj(Yi) + thermophysicalTransport.divj(Yi)
== ==
reaction.R(Yi) reaction.R(Yi)
+ fvOptions(rho, Yi) + fvModels.source(rho, Yi)
); );
YiEqn.relax(); YiEqn.relax();
fvOptions.constrain(YiEqn); fvConstraints.constrain(YiEqn);
YiEqn.solve("Yi"); YiEqn.solve("Yi");
fvOptions.constrain(Yi); fvConstraints.constrain(Yi);
} }
} }

View File

@ -22,7 +22,8 @@ PtrList<multivariateSurfaceInterpolationScheme<scalar>::fieldTable>
List<scalar> initialMassFluid(fluidRegions.size()); List<scalar> initialMassFluid(fluidRegions.size());
PtrList<IOMRFZoneList> MRFfluid(fluidRegions.size()); PtrList<IOMRFZoneList> MRFfluid(fluidRegions.size());
PtrList<fv::options> fvOptionsFluid(fluidRegions.size()); PtrList<Foam::fvModels> fvModelsFluid(fluidRegions.size());
PtrList<fvConstraints> fvConstraintsFluid(fluidRegions.size());
// Populate fluid field pointer lists // Populate fluid field pointer lists
forAll(fluidRegions, i) forAll(fluidRegions, i)
@ -271,11 +272,18 @@ forAll(fluidRegions, i)
new IOMRFZoneList(fluidRegions[i]) new IOMRFZoneList(fluidRegions[i])
); );
Info<< " Adding fvOptionsFluid\n" << endl; Info<< " Adding fvModelsFluid\n" << endl;
fvOptionsFluid.set fvModelsFluid.set
( (
i, i,
new fv::options(fluidRegions[i]) new Foam::fvModels(fluidRegions[i])
);
Info<< " Adding fvConstraintsFluid\n" << endl;
fvConstraintsFluid.set
(
i,
new fvConstraints(fluidRegions[i])
); );
turbulenceFluid[i].validate(); turbulenceFluid[i].validate();

View File

@ -33,7 +33,8 @@
fieldsFluid[i]; fieldsFluid[i];
IOMRFZoneList& MRF = MRFfluid[i]; IOMRFZoneList& MRF = MRFfluid[i];
fv::options& fvOptions = fvOptionsFluid[i]; Foam::fvModels& fvModels = fvModelsFluid[i];
Foam::fvConstraints& fvConstraints = fvConstraintsFluid[i];
#include "checkRadiationModel.H" #include "checkRadiationModel.H"

View File

@ -1,6 +1,6 @@
if (pimple.frozenFlow()) if (pimple.frozenFlow())
{ {
fvOptions.correct(); fvModels.correct();
#include "YEqn.H" #include "YEqn.H"
#include "EEqn.H" #include "EEqn.H"
@ -12,7 +12,7 @@ else
#include "rhoEqn.H" #include "rhoEqn.H"
} }
fvOptions.correct(); fvModels.correct();
#include "UEqn.H" #include "UEqn.H"
#include "YEqn.H" #include "YEqn.H"

View File

@ -1,6 +1,7 @@
// Initialise solid field pointer lists // Initialise solid field pointer lists
PtrList<solidThermo> thermoSolid(solidRegions.size()); PtrList<solidThermo> thermoSolid(solidRegions.size());
PtrList<fv::options> fvOptionsSolid(solidRegions.size()); PtrList<Foam::fvModels> fvModelsSolid(solidRegions.size());
PtrList<fvConstraints> fvConstraintsSolid(solidRegions.size());
// Populate solid field pointer lists // Populate solid field pointer lists
forAll(solidRegions, i) forAll(solidRegions, i)
@ -11,10 +12,17 @@ forAll(solidRegions, i)
Info<< " Adding to thermoSolid\n" << endl; Info<< " Adding to thermoSolid\n" << endl;
thermoSolid.set(i, solidThermo::New(solidRegions[i])); thermoSolid.set(i, solidThermo::New(solidRegions[i]));
Info<< " Adding to fvOptionsSolid\n" << endl; Info<< " Adding to fvModelsSolid\n" << endl;
fvOptionsSolid.set fvModelsSolid.set
( (
i, i,
new fv::options(solidRegions[i]) new Foam::fvModels(solidRegions[i])
);
Info<< " Adding fvConstraintsSolid\n" << endl;
fvConstraintsSolid.set
(
i,
new fvConstraints(solidRegions[i])
); );
} }

View File

@ -7,7 +7,8 @@ const volScalarField& rho = trho();
volScalarField& e = thermo.he(); volScalarField& e = thermo.he();
const fv::options& fvOptions = fvOptionsSolid[i]; const Foam::fvModels& fvModels = fvModelsSolid[i];
Foam::fvConstraints& fvConstraints = fvConstraintsSolid[i];
#include "checkRadiationModel.H" #include "checkRadiationModel.H"

View File

@ -6,16 +6,16 @@
fvm::ddt(rho, e) fvm::ddt(rho, e)
+ thermo.divq(e) + thermo.divq(e)
== ==
fvOptions(rho, e) fvModels.source(rho, e)
); );
eEqn.relax(); eEqn.relax();
fvOptions.constrain(eEqn); fvConstraints.constrain(eEqn);
eEqn.solve(); eEqn.solve();
fvOptions.constrain(e); fvConstraints.constrain(e);
} }
} }

View File

@ -17,16 +17,16 @@
) )
+ thermophysicalTransport->divq(he) + thermophysicalTransport->divq(he)
== ==
fvOptions(rho, he) fvModels.source(rho, he)
); );
EEqn.relax(); EEqn.relax();
fvOptions.constrain(EEqn); fvConstraints.constrain(EEqn);
EEqn.solve(); EEqn.solve();
fvOptions.constrain(he); fvConstraints.constrain(he);
thermo.correct(); thermo.correct();
} }

View File

@ -11,7 +11,8 @@ EXE_LIBS = \
-lfiniteVolume \ -lfiniteVolume \
-lsampling \ -lsampling \
-lmeshTools \ -lmeshTools \
-lfvOptions \ -lfvModels \
-lfvConstraints \
-lfluidThermophysicalModels \ -lfluidThermophysicalModels \
-lspecie \ -lspecie \
-lmomentumTransportModels \ -lmomentumTransportModels \

View File

@ -69,5 +69,6 @@ volScalarField dpdt
Info<< "Creating field kinetic energy K\n" << endl; Info<< "Creating field kinetic energy K\n" << endl;
volScalarField K("K", 0.5*magSqr(U)); volScalarField K("K", 0.5*magSqr(U));
#include "createFvOptions.H" #include "createFvModels.H"
#include "createFvConstraints.H"
#include "checkRadiationModel.H" #include "checkRadiationModel.H"

View File

@ -34,7 +34,8 @@ Description
#include "fluidThermoMomentumTransportModel.H" #include "fluidThermoMomentumTransportModel.H"
#include "fluidThermophysicalTransportModel.H" #include "fluidThermophysicalTransportModel.H"
#include "LESModel.H" #include "LESModel.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
#include "simpleControl.H" #include "simpleControl.H"
#include "pimpleControl.H" #include "pimpleControl.H"
@ -84,7 +85,7 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
fvOptions.correct(); fvModels.correct();
while (pimple.correctNonOrthogonal()) while (pimple.correctNonOrthogonal())
{ {

View File

@ -14,4 +14,5 @@ EXE_LIBS = \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-lfvOptions -lfvModels \
-lfvConstraints

View File

@ -49,7 +49,8 @@ Description
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "kinematicMomentumTransportModel.H" #include "kinematicMomentumTransportModel.H"
#include "simpleControl.H" #include "simpleControl.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
template<class Type> template<class Type>
void zeroCells void zeroCells
@ -103,7 +104,7 @@ int main(int argc, char *argv[])
// Pressure-velocity SIMPLE corrector // Pressure-velocity SIMPLE corrector
{ {
fvOptions.correct(); fvModels.correct();
// Momentum predictor // Momentum predictor
@ -113,17 +114,17 @@ int main(int argc, char *argv[])
+ turbulence->divDevSigma(U) + turbulence->divDevSigma(U)
+ fvm::Sp(alpha, U) + fvm::Sp(alpha, U)
== ==
fvOptions(U) fvModels.source(U)
); );
fvVectorMatrix& UEqn = tUEqn.ref(); fvVectorMatrix& UEqn = tUEqn.ref();
UEqn.relax(); UEqn.relax();
fvOptions.constrain(UEqn); fvConstraints.constrain(UEqn);
solve(UEqn == -fvc::grad(p)); solve(UEqn == -fvc::grad(p));
fvOptions.constrain(U); fvConstraints.constrain(U);
volScalarField rAU(1.0/UEqn.A()); volScalarField rAU(1.0/UEqn.A());
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p)); volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
@ -159,7 +160,7 @@ int main(int argc, char *argv[])
// Momentum corrector // Momentum corrector
U = HbyA - rAU*fvc::grad(p); U = HbyA - rAU*fvc::grad(p);
U.correctBoundaryConditions(); U.correctBoundaryConditions();
fvOptions.constrain(U); fvConstraints.constrain(U);
} }
// Adjoint Pressure-velocity SIMPLE corrector // Adjoint Pressure-velocity SIMPLE corrector
@ -184,17 +185,17 @@ int main(int argc, char *argv[])
+ turbulence->divDevSigma(Ua) + turbulence->divDevSigma(Ua)
+ fvm::Sp(alpha, Ua) + fvm::Sp(alpha, Ua)
== ==
fvOptions(Ua) fvModels.source(Ua)
); );
fvVectorMatrix& UaEqn = tUaEqn.ref(); fvVectorMatrix& UaEqn = tUaEqn.ref();
UaEqn.relax(); UaEqn.relax();
fvOptions.constrain(UaEqn); fvConstraints.constrain(UaEqn);
solve(UaEqn == -fvc::grad(pa)); solve(UaEqn == -fvc::grad(pa));
fvOptions.constrain(Ua); fvConstraints.constrain(Ua);
volScalarField rAUa(1.0/UaEqn.A()); volScalarField rAUa(1.0/UaEqn.A());
volVectorField HbyAa("HbyAa", Ua); volVectorField HbyAa("HbyAa", Ua);
@ -228,7 +229,7 @@ int main(int argc, char *argv[])
// Adjoint momentum corrector // Adjoint momentum corrector
Ua = HbyAa - rAUa*fvc::grad(pa); Ua = HbyAa - rAUa*fvc::grad(pa);
Ua.correctBoundaryConditions(); Ua.correctBoundaryConditions();
fvOptions.constrain(Ua); fvConstraints.constrain(Ua);
} }
laminarTransport.correct(); laminarTransport.correct();

View File

@ -110,4 +110,5 @@ volScalarField alpha
zeroCells(alpha, inletCells); zeroCells(alpha, inletCells);
//zeroCells(alpha, outletCells); //zeroCells(alpha, outletCells);
#include "createFvOptions.H" #include "createFvModels.H"
#include "createFvConstraints.H"

View File

@ -12,5 +12,6 @@ EXE_LIBS = \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-lfvOptions \ -lfvModels \
-lfvConstraints \
-lsampling -lsampling

View File

@ -38,7 +38,8 @@ Description
#include "fvCFD.H" #include "fvCFD.H"
#include "singlePhaseTransportModel.H" #include "singlePhaseTransportModel.H"
#include "kinematicMomentumTransportModel.H" #include "kinematicMomentumTransportModel.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
#include "wallFvPatch.H" #include "wallFvPatch.H"
#include "makeGraph.H" #include "makeGraph.H"
@ -65,23 +66,23 @@ int main(int argc, char *argv[])
{ {
Info<< "Time = " << runTime.timeName() << nl << endl; Info<< "Time = " << runTime.timeName() << nl << endl;
fvOptions.correct(); fvModels.correct();
fvVectorMatrix divR(turbulence->divDevSigma(U)); fvVectorMatrix divR(turbulence->divDevSigma(U));
divR.source() = flowMask & divR.source(); divR.source() = flowMask & divR.source();
fvVectorMatrix UEqn fvVectorMatrix UEqn
( (
divR == gradP + fvOptions(U) divR == gradP + fvModels.source(U)
); );
UEqn.relax(); UEqn.relax();
fvOptions.constrain(UEqn); fvConstraints.constrain(UEqn);
UEqn.solve(); UEqn.solve();
fvOptions.constrain(U); fvConstraints.constrain(U);
// Correct driving force for a constant volume flow rate // Correct driving force for a constant volume flow rate

View File

@ -48,4 +48,5 @@ dimensionedVector gradP
Zero Zero
); );
#include "createFvOptions.H" #include "createFvModels.H"
#include "createFvConstraints.H"

View File

@ -13,7 +13,8 @@ EXE_LIBS = \
-lincompressibleMomentumTransportModels \ -lincompressibleMomentumTransportModels \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lfiniteVolume \ -lfiniteVolume \
-lfvOptions \ -lfvModels \
-lfvConstraints \
-lsampling \ -lsampling \
-ldynamicFvMesh \ -ldynamicFvMesh \
-ltopoChangerFvMesh \ -ltopoChangerFvMesh \

View File

@ -14,5 +14,6 @@ EXE_LIBS = \
-lincompressibleTransportModels \ -lincompressibleTransportModels \
-lfiniteVolume \ -lfiniteVolume \
-lmeshTools \ -lmeshTools \
-lfvOptions \ -lfvModels \
-lfvConstraints \
-lsampling -lsampling

View File

@ -37,7 +37,8 @@ Description
#include "kinematicMomentumTransportModel.H" #include "kinematicMomentumTransportModel.H"
#include "pimpleControl.H" #include "pimpleControl.H"
#include "SRFModel.H" #include "SRFModel.H"
#include "fvOptions.H" #include "fvModels.H"
#include "fvConstraints.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -72,7 +73,7 @@ int main(int argc, char *argv[])
// --- Pressure-velocity PIMPLE corrector loop // --- Pressure-velocity PIMPLE corrector loop
while (pimple.loop()) while (pimple.loop())
{ {
fvOptions.correct(); fvModels.correct();
#include "UrelEqn.H" #include "UrelEqn.H"

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