mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -16,9 +16,13 @@
|
|||||||
: -dpdt
|
: -dpdt
|
||||||
)
|
)
|
||||||
- fvm::laplacian(turbulence->alphaEff(), hea)
|
- fvm::laplacian(turbulence->alphaEff(), hea)
|
||||||
|
+ sources(rho, hea)
|
||||||
);
|
);
|
||||||
|
|
||||||
EaEqn.relax();
|
EaEqn.relax();
|
||||||
|
|
||||||
|
sources.constrain(EaEqn);
|
||||||
|
|
||||||
EaEqn.solve();
|
EaEqn.solve();
|
||||||
|
|
||||||
thermo.correct();
|
thermo.correct();
|
||||||
|
|||||||
@ -1,14 +1,20 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/fieldSources/lnInclude \
|
||||||
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude\
|
||||||
-I$(LIB_SRC)/engine/lnInclude \
|
-I$(LIB_SRC)/engine/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
|
-lfiniteVolume \
|
||||||
|
-lfieldSources \
|
||||||
|
-lsampling \
|
||||||
|
-lmeshTools \
|
||||||
-lengine \
|
-lengine \
|
||||||
-lcompressibleTurbulenceModel \
|
-lcompressibleTurbulenceModel \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
@ -16,6 +22,4 @@ EXE_LIBS = \
|
|||||||
-lfluidThermophysicalModels \
|
-lfluidThermophysicalModels \
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-llaminarFlameSpeedModels \
|
-llaminarFlameSpeedModels
|
||||||
-lmeshTools \
|
|
||||||
-lfiniteVolume
|
|
||||||
|
|||||||
@ -5,10 +5,13 @@
|
|||||||
+ turbulence->divDevRhoReff(U)
|
+ turbulence->divDevRhoReff(U)
|
||||||
==
|
==
|
||||||
rho*g
|
rho*g
|
||||||
|
+ sources(rho, U)
|
||||||
);
|
);
|
||||||
|
|
||||||
UEqn.relax();
|
UEqn.relax();
|
||||||
|
|
||||||
|
sources.constrain(UEqn);
|
||||||
|
|
||||||
if (pimple.momentumPredictor())
|
if (pimple.momentumPredictor())
|
||||||
{
|
{
|
||||||
solve(UEqn == -fvc::grad(p));
|
solve(UEqn == -fvc::grad(p));
|
||||||
|
|||||||
@ -56,6 +56,7 @@ Description
|
|||||||
#include "ignition.H"
|
#include "ignition.H"
|
||||||
#include "Switch.H"
|
#include "Switch.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "IObasicSourceList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -34,7 +34,7 @@ if (ign.ignited())
|
|||||||
|
|
||||||
// Calculate turbulent flame speed flux
|
// Calculate turbulent flame speed flux
|
||||||
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
surfaceScalarField phiSt(fvc::interpolate(rhou*StCorr*Su*Xi)*nf);
|
surfaceScalarField phiSt("phiSt", fvc::interpolate(rhou*StCorr*Su*Xi)*nf);
|
||||||
|
|
||||||
scalar StCoNum = max
|
scalar StCoNum = max
|
||||||
(
|
(
|
||||||
@ -50,9 +50,11 @@ if (ign.ignited())
|
|||||||
(
|
(
|
||||||
fvm::ddt(rho, b)
|
fvm::ddt(rho, b)
|
||||||
+ mvConvection->fvmDiv(phi, b)
|
+ mvConvection->fvmDiv(phi, b)
|
||||||
+ fvm::div(phiSt, b, "div(phiSt,b)")
|
+ fvm::div(phiSt, b)
|
||||||
- fvm::Sp(fvc::div(phiSt), b)
|
- fvm::Sp(fvc::div(phiSt), b)
|
||||||
- fvm::laplacian(turbulence->alphaEff(), b)
|
- fvm::laplacian(turbulence->alphaEff(), b)
|
||||||
|
==
|
||||||
|
sources(rho, b)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|
||||||
@ -64,6 +66,9 @@ if (ign.ignited())
|
|||||||
// Solve for b
|
// Solve for b
|
||||||
// ~~~~~~~~~~~
|
// ~~~~~~~~~~~
|
||||||
bEqn.relax();
|
bEqn.relax();
|
||||||
|
|
||||||
|
sources.constrain(bEqn);
|
||||||
|
|
||||||
bEqn.solve();
|
bEqn.solve();
|
||||||
|
|
||||||
Info<< "min(b) = " << min(b).value() << endl;
|
Info<< "min(b) = " << min(b).value() << endl;
|
||||||
@ -153,9 +158,13 @@ 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)
|
||||||
|
+ sources(rho, Su)
|
||||||
);
|
);
|
||||||
|
|
||||||
SuEqn.relax();
|
SuEqn.relax();
|
||||||
|
|
||||||
|
sources.constrain(SuEqn);
|
||||||
|
|
||||||
SuEqn.solve();
|
SuEqn.solve();
|
||||||
|
|
||||||
// Limit the maximum Su
|
// Limit the maximum Su
|
||||||
@ -234,9 +243,13 @@ if (ign.ignited())
|
|||||||
),
|
),
|
||||||
Xi
|
Xi
|
||||||
)
|
)
|
||||||
|
+ sources(rho, Xi)
|
||||||
);
|
);
|
||||||
|
|
||||||
XiEqn.relax();
|
XiEqn.relax();
|
||||||
|
|
||||||
|
sources.constrain(XiEqn);
|
||||||
|
|
||||||
XiEqn.solve();
|
XiEqn.solve();
|
||||||
|
|
||||||
// Correct boundedness of Xi
|
// Correct boundedness of Xi
|
||||||
|
|||||||
@ -138,3 +138,5 @@
|
|||||||
fields.add(b);
|
fields.add(b);
|
||||||
fields.add(thermo.he());
|
fields.add(thermo.he());
|
||||||
fields.add(thermo.heu());
|
fields.add(thermo.heu());
|
||||||
|
|
||||||
|
IObasicSourceList sources(mesh);
|
||||||
|
|||||||
@ -13,10 +13,16 @@ if (composition.contains("ft"))
|
|||||||
{
|
{
|
||||||
volScalarField& ft = composition.Y("ft");
|
volScalarField& ft = composition.Y("ft");
|
||||||
|
|
||||||
solve
|
fvScalarMatrix ftEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(rho, ft)
|
fvm::ddt(rho, ft)
|
||||||
+ mvConvection->fvmDiv(phi, ft)
|
+ mvConvection->fvmDiv(phi, ft)
|
||||||
- fvm::laplacian(turbulence->alphaEff(), ft)
|
- fvm::laplacian(turbulence->alphaEff(), ft)
|
||||||
|
==
|
||||||
|
sources(rho, ft)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.constrain(ftEqn);
|
||||||
|
|
||||||
|
ftEqn.solve();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,6 +16,8 @@ if (pimple.transonic())
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(fvc::interpolate(psi), phid);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
@ -23,8 +25,12 @@ if (pimple.transonic())
|
|||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
- fvm::laplacian(rho*rAU, p)
|
- fvm::laplacian(rho*rAU, p)
|
||||||
|
==
|
||||||
|
sources(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
@ -45,6 +51,8 @@ else
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(phiHbyA);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
@ -52,8 +60,12 @@ else
|
|||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA)
|
||||||
- fvm::laplacian(rho*rAU, p)
|
- fvm::laplacian(rho*rAU, p)
|
||||||
|
==
|
||||||
|
sources(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
@ -68,6 +80,7 @@ else
|
|||||||
|
|
||||||
U = HbyA - rAU*fvc::grad(p);
|
U = HbyA - rAU*fvc::grad(p);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
|
sources.correct(U);
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
|
|
||||||
if (thermo.dpdt())
|
if (thermo.dpdt())
|
||||||
|
|||||||
@ -1,14 +1,21 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I../XiFoam \
|
-I$(FOAM_SOLVERS)/combustion/XiFoam \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/fieldSources/lnInclude \
|
||||||
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/engine/lnInclude \
|
-I$(LIB_SRC)/engine/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/laminarFlameSpeed/lnInclude
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
|
-lfiniteVolume \
|
||||||
|
-lfieldSources \
|
||||||
|
-lsampling \
|
||||||
|
-lmeshTools \
|
||||||
-lengine \
|
-lengine \
|
||||||
-lcompressibleTurbulenceModel \
|
-lcompressibleTurbulenceModel \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
@ -16,5 +23,4 @@ EXE_LIBS = \
|
|||||||
-lfluidThermophysicalModels \
|
-lfluidThermophysicalModels \
|
||||||
-lreactionThermophysicalModels \
|
-lreactionThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
-llaminarFlameSpeedModels \
|
-llaminarFlameSpeedModels
|
||||||
-lfiniteVolume
|
|
||||||
|
|||||||
@ -3,6 +3,8 @@
|
|||||||
fvm::ddt(rho, U)
|
fvm::ddt(rho, U)
|
||||||
+ fvm::div(phi, U)
|
+ fvm::div(phi, U)
|
||||||
+ turbulence->divDevRhoReff(U)
|
+ turbulence->divDevRhoReff(U)
|
||||||
|
==
|
||||||
|
sources(rho, U)
|
||||||
);
|
);
|
||||||
|
|
||||||
if (pimple.momentumPredictor())
|
if (pimple.momentumPredictor())
|
||||||
|
|||||||
@ -59,6 +59,7 @@ Description
|
|||||||
#include "OFstream.H"
|
#include "OFstream.H"
|
||||||
#include "mathematicalConstants.H"
|
#include "mathematicalConstants.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "IObasicSourceList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -13,6 +13,8 @@ if (pimple.transonic())
|
|||||||
*((fvc::interpolate(HbyA) & mesh.Sf()) - fvc::meshPhi(rho, U))
|
*((fvc::interpolate(HbyA) & mesh.Sf()) - fvc::meshPhi(rho, U))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(fvc::interpolate(psi), phid);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
@ -20,8 +22,12 @@ if (pimple.transonic())
|
|||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
- fvm::laplacian(rho*rAU, p)
|
- fvm::laplacian(rho*rAU, p)
|
||||||
|
==
|
||||||
|
sources(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
@ -39,6 +45,8 @@ else
|
|||||||
*((fvc::interpolate(HbyA) & mesh.Sf()) - fvc::meshPhi(rho, U))
|
*((fvc::interpolate(HbyA) & mesh.Sf()) - fvc::meshPhi(rho, U))
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
@ -46,8 +54,12 @@ else
|
|||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA)
|
||||||
- fvm::laplacian(rho*rAU, p)
|
- fvm::laplacian(rho*rAU, p)
|
||||||
|
==
|
||||||
|
sources(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
@ -62,6 +74,7 @@ else
|
|||||||
|
|
||||||
U = HbyA - rAU*fvc::grad(p);
|
U = HbyA - rAU*fvc::grad(p);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
|
sources.correct(U);
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
|
|
||||||
if (thermo.dpdt())
|
if (thermo.dpdt())
|
||||||
|
|||||||
@ -1,6 +1,8 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/fieldSources/lnInclude \
|
||||||
-I${LIB_SRC}/meshTools/lnInclude \
|
-I${LIB_SRC}/meshTools/lnInclude \
|
||||||
|
-I${LIB_SRC}/sampling/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
@ -29,7 +31,9 @@ EXE_INC = \
|
|||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
-lfieldSources \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
|
-lsampling \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
-lcompressibleLESModels \
|
-lcompressibleLESModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
|
|||||||
@ -5,10 +5,13 @@
|
|||||||
+ turbulence->divDevRhoReff(U)
|
+ turbulence->divDevRhoReff(U)
|
||||||
==
|
==
|
||||||
parcels.SU(U)
|
parcels.SU(U)
|
||||||
|
+ sources(rho, U)
|
||||||
);
|
);
|
||||||
|
|
||||||
UEqn.relax();
|
UEqn.relax();
|
||||||
|
|
||||||
|
sources.constrain(UEqn);
|
||||||
|
|
||||||
if (pimple.momentumPredictor())
|
if (pimple.momentumPredictor())
|
||||||
{
|
{
|
||||||
solve
|
solve
|
||||||
|
|||||||
@ -30,9 +30,13 @@ 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)
|
||||||
|
+ sources(rho, Yi)
|
||||||
);
|
);
|
||||||
|
|
||||||
YiEqn.relax();
|
YiEqn.relax();
|
||||||
|
|
||||||
|
sources.constrain(YiEqn);
|
||||||
|
|
||||||
YiEqn.solve(mesh.solver("Yi"));
|
YiEqn.solve(mesh.solver("Yi"));
|
||||||
|
|
||||||
Yi.max(0.0);
|
Yi.max(0.0);
|
||||||
@ -69,9 +73,13 @@ tmp<fv::convectionScheme<scalar> > mvConvection
|
|||||||
+ radiation->Sh(thermo)
|
+ radiation->Sh(thermo)
|
||||||
+ parcels.Sh(he)
|
+ parcels.Sh(he)
|
||||||
+ surfaceFilm.Sh()
|
+ surfaceFilm.Sh()
|
||||||
|
+ sources(rho, he)
|
||||||
);
|
);
|
||||||
|
|
||||||
EEqn.relax();
|
EEqn.relax();
|
||||||
|
|
||||||
|
sources.constrain(EEqn);
|
||||||
|
|
||||||
EEqn.solve();
|
EEqn.solve();
|
||||||
|
|
||||||
thermo.correct();
|
thermo.correct();
|
||||||
|
|||||||
@ -146,3 +146,6 @@
|
|||||||
(
|
(
|
||||||
additionalControlsDict.lookup("solvePrimaryRegion")
|
additionalControlsDict.lookup("solvePrimaryRegion")
|
||||||
);
|
);
|
||||||
|
|
||||||
|
IObasicSourceList sources(mesh);
|
||||||
|
|
||||||
|
|||||||
@ -40,6 +40,7 @@ Description
|
|||||||
#include "solidChemistryModel.H"
|
#include "solidChemistryModel.H"
|
||||||
#include "psiCombustionModel.H"
|
#include "psiCombustionModel.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "IObasicSourceList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -21,6 +21,7 @@ surfaceScalarField phiHbyA
|
|||||||
+ phig
|
+ phig
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(phiHbyA);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
@ -33,8 +34,11 @@ while (pimple.correctNonOrthogonal())
|
|||||||
==
|
==
|
||||||
parcels.Srho()
|
parcels.Srho()
|
||||||
+ surfaceFilm.Srho()
|
+ surfaceFilm.Srho()
|
||||||
|
+ sources(psi, p_rgh, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.constrain(p_rghEqn);
|
||||||
|
|
||||||
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
|
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
@ -42,6 +46,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();
|
||||||
|
sources.correct(U);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -30,14 +30,19 @@ Description
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
{
|
{
|
||||||
solve
|
fvScalarMatrix rhoEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(rho)
|
fvm::ddt(rho)
|
||||||
+ fvc::div(phi)
|
+ fvc::div(phi)
|
||||||
==
|
==
|
||||||
parcels.Srho(rho)
|
parcels.Srho(rho)
|
||||||
+ surfaceFilm.Srho()
|
+ surfaceFilm.Srho()
|
||||||
|
+ sources(rho)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.constrain(rhoEqn);
|
||||||
|
|
||||||
|
rhoEqn.solve();
|
||||||
}
|
}
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -19,9 +19,13 @@
|
|||||||
// - fvm::laplacian(turbulence->muEff(), he) // unit lewis no.
|
// - fvm::laplacian(turbulence->muEff(), he) // unit lewis no.
|
||||||
==
|
==
|
||||||
reaction->Sh()
|
reaction->Sh()
|
||||||
|
+ sources(rho, he)
|
||||||
);
|
);
|
||||||
|
|
||||||
EEqn.relax();
|
EEqn.relax();
|
||||||
|
|
||||||
|
sources.constrain(EEqn);
|
||||||
|
|
||||||
EEqn.solve();
|
EEqn.solve();
|
||||||
|
|
||||||
thermo.correct();
|
thermo.correct();
|
||||||
|
|||||||
@ -1,14 +1,21 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/fieldSources/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||||
-I$(LIB_SRC)/ODE/lnInclude \
|
-I$(LIB_SRC)/ODE/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(LIB_SRC)/combustionModels/lnInclude
|
-I$(LIB_SRC)/combustionModels/lnInclude
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
|
-lfiniteVolume \
|
||||||
|
-lfieldSources \
|
||||||
|
-lmeshTools \
|
||||||
|
-lsampling \
|
||||||
-lcompressibleTurbulenceModel \
|
-lcompressibleTurbulenceModel \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
-lcompressibleLESModels \
|
-lcompressibleLESModels \
|
||||||
@ -17,5 +24,4 @@ EXE_LIBS = \
|
|||||||
-lfluidThermophysicalModels \
|
-lfluidThermophysicalModels \
|
||||||
-lchemistryModel \
|
-lchemistryModel \
|
||||||
-lODE \
|
-lODE \
|
||||||
-lfiniteVolume \
|
|
||||||
-lcombustionModels
|
-lcombustionModels
|
||||||
|
|||||||
@ -5,10 +5,13 @@
|
|||||||
+ turbulence->divDevRhoReff(U)
|
+ turbulence->divDevRhoReff(U)
|
||||||
==
|
==
|
||||||
rho*g
|
rho*g
|
||||||
|
+ sources(rho, U)
|
||||||
);
|
);
|
||||||
|
|
||||||
UEqn.relax();
|
UEqn.relax();
|
||||||
|
|
||||||
|
sources.constrain(UEqn);
|
||||||
|
|
||||||
if (pimple.momentumPredictor())
|
if (pimple.momentumPredictor())
|
||||||
{
|
{
|
||||||
solve(UEqn == -fvc::grad(p));
|
solve(UEqn == -fvc::grad(p));
|
||||||
|
|||||||
@ -28,9 +28,13 @@ tmp<fv::convectionScheme<scalar> > mvConvection
|
|||||||
- fvm::laplacian(turbulence->muEff(), Yi)
|
- fvm::laplacian(turbulence->muEff(), Yi)
|
||||||
==
|
==
|
||||||
reaction->R(Yi)
|
reaction->R(Yi)
|
||||||
|
+ sources(rho, Yi)
|
||||||
);
|
);
|
||||||
|
|
||||||
YiEqn.relax();
|
YiEqn.relax();
|
||||||
|
|
||||||
|
sources.constrain(YiEqn);
|
||||||
|
|
||||||
YiEqn.solve(mesh.solver("Yi"));
|
YiEqn.solve(mesh.solver("Yi"));
|
||||||
|
|
||||||
Yi.max(0.0);
|
Yi.max(0.0);
|
||||||
|
|||||||
@ -99,3 +99,5 @@ volScalarField dQ
|
|||||||
mesh,
|
mesh,
|
||||||
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
|
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
IObasicSourceList sources(mesh);
|
||||||
|
|||||||
@ -16,6 +16,8 @@ if (pimple.transonic())
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(fvc::interpolate(psi), phid);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
@ -23,8 +25,12 @@ if (pimple.transonic())
|
|||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
- fvm::laplacian(rho*rAU, p)
|
- fvm::laplacian(rho*rAU, p)
|
||||||
|
==
|
||||||
|
sources(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
@ -45,6 +51,8 @@ else
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
@ -52,8 +60,12 @@ else
|
|||||||
fvm::ddt(psi, p)
|
fvm::ddt(psi, p)
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA)
|
||||||
- fvm::laplacian(rho*rAU, p)
|
- fvm::laplacian(rho*rAU, p)
|
||||||
|
==
|
||||||
|
sources(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
@ -68,6 +80,7 @@ else
|
|||||||
|
|
||||||
U = HbyA - rAU*fvc::grad(p);
|
U = HbyA - rAU*fvc::grad(p);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
|
sources.correct(U);
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
|
|
||||||
if (thermo.dpdt())
|
if (thermo.dpdt())
|
||||||
|
|||||||
@ -34,6 +34,7 @@ Description
|
|||||||
#include "psiCombustionModel.H"
|
#include "psiCombustionModel.H"
|
||||||
#include "multivariateScheme.H"
|
#include "multivariateScheme.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "IObasicSourceList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -1,17 +1,23 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I../reactingFoam \
|
-I$(FOAM_SOLVERS)/combustion/reactingFoam \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/fieldSources/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \
|
||||||
-I$(LIB_SRC)/ODE/lnInclude \
|
-I$(LIB_SRC)/ODE/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
|
||||||
-I$(FOAM_SOLVERS)/combustion/reactingFoam \
|
|
||||||
-I$(LIB_SRC)/combustionModels/lnInclude
|
-I$(LIB_SRC)/combustionModels/lnInclude
|
||||||
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
|
-lfiniteVolume \
|
||||||
|
-lfieldSources \
|
||||||
|
-lmeshTools \
|
||||||
|
-lsampling \
|
||||||
-lcompressibleTurbulenceModel \
|
-lcompressibleTurbulenceModel \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
-lcompressibleLESModels \
|
-lcompressibleLESModels \
|
||||||
@ -20,5 +26,4 @@ EXE_LIBS = \
|
|||||||
-lfluidThermophysicalModels \
|
-lfluidThermophysicalModels \
|
||||||
-lchemistryModel \
|
-lchemistryModel \
|
||||||
-lODE \
|
-lODE \
|
||||||
-lfiniteVolume \
|
|
||||||
-lcombustionModels
|
-lcombustionModels
|
||||||
|
|||||||
@ -101,3 +101,5 @@ volScalarField dQ
|
|||||||
mesh,
|
mesh,
|
||||||
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
|
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
IObasicSourceList sources(mesh);
|
||||||
|
|||||||
@ -18,6 +18,8 @@
|
|||||||
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(phiHbyA);
|
||||||
|
|
||||||
surfaceScalarField phid("phid", fvc::interpolate(thermo.psi())*phiHbyA);
|
surfaceScalarField phid("phid", fvc::interpolate(thermo.psi())*phiHbyA);
|
||||||
|
|
||||||
phiHbyA *= fvc::interpolate(rho);
|
phiHbyA *= fvc::interpolate(rho);
|
||||||
@ -34,8 +36,12 @@
|
|||||||
(
|
(
|
||||||
pDDtEqn
|
pDDtEqn
|
||||||
- fvm::laplacian(rho*rAU, p)
|
- fvm::laplacian(rho*rAU, p)
|
||||||
|
==
|
||||||
|
sources(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
@ -56,10 +62,14 @@
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
fvScalarMatrix pDDtEqn
|
fvScalarMatrix pDDtEqn
|
||||||
(
|
(
|
||||||
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
|
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA)
|
||||||
|
==
|
||||||
|
sources(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
@ -70,6 +80,8 @@
|
|||||||
- fvm::laplacian(rho*rAU, p)
|
- fvm::laplacian(rho*rAU, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
@ -87,6 +99,7 @@
|
|||||||
|
|
||||||
U = HbyA - rAU*fvc::grad(p);
|
U = HbyA - rAU*fvc::grad(p);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
|
sources.correct(U);
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
|
|
||||||
if (thermo.dpdt())
|
if (thermo.dpdt())
|
||||||
|
|||||||
@ -35,6 +35,7 @@ Description
|
|||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "multivariateScheme.H"
|
#include "multivariateScheme.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "IObasicSourceList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -38,6 +38,10 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchScalarField(p, iF),
|
mixedFvPatchScalarField(p, iF),
|
||||||
|
UName_("U"),
|
||||||
|
rhoName_("rho"),
|
||||||
|
psiName_("thermo:psi"),
|
||||||
|
muName_("thermo:mu"),
|
||||||
accommodationCoeff_(1.0),
|
accommodationCoeff_(1.0),
|
||||||
Twall_(p.size(), 0.0),
|
Twall_(p.size(), 0.0),
|
||||||
gamma_(1.4)
|
gamma_(1.4)
|
||||||
@ -57,6 +61,10 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchScalarField(ptf, p, iF, mapper),
|
mixedFvPatchScalarField(ptf, p, iF, mapper),
|
||||||
|
UName_(ptf.UName_),
|
||||||
|
rhoName_(ptf.rhoName_),
|
||||||
|
psiName_(ptf.psiName_),
|
||||||
|
muName_(ptf.muName_),
|
||||||
accommodationCoeff_(ptf.accommodationCoeff_),
|
accommodationCoeff_(ptf.accommodationCoeff_),
|
||||||
Twall_(ptf.Twall_),
|
Twall_(ptf.Twall_),
|
||||||
gamma_(ptf.gamma_)
|
gamma_(ptf.gamma_)
|
||||||
@ -71,6 +79,10 @@ Foam::smoluchowskiJumpTFvPatchScalarField::smoluchowskiJumpTFvPatchScalarField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchScalarField(p, iF),
|
mixedFvPatchScalarField(p, iF),
|
||||||
|
UName_(dict.lookupOrDefault<word>("U", "U")),
|
||||||
|
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
||||||
|
psiName_(dict.lookupOrDefault<word>("psi", "thermo:psi")),
|
||||||
|
muName_(dict.lookupOrDefault<word>("mu", "thermo:mu")),
|
||||||
accommodationCoeff_(readScalar(dict.lookup("accommodationCoeff"))),
|
accommodationCoeff_(readScalar(dict.lookup("accommodationCoeff"))),
|
||||||
Twall_("Twall", dict, p.size()),
|
Twall_("Twall", dict, p.size()),
|
||||||
gamma_(dict.lookupOrDefault<scalar>("gamma", 1.4))
|
gamma_(dict.lookupOrDefault<scalar>("gamma", 1.4))
|
||||||
@ -159,13 +171,13 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const fvPatchScalarField& pmu =
|
const fvPatchScalarField& pmu =
|
||||||
patch().lookupPatchField<volScalarField, scalar>("mu");
|
patch().lookupPatchField<volScalarField, scalar>(muName_);
|
||||||
const fvPatchScalarField& prho =
|
const fvPatchScalarField& prho =
|
||||||
patch().lookupPatchField<volScalarField, scalar>("rho");
|
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||||
const fvPatchField<scalar>& ppsi =
|
const fvPatchField<scalar>& ppsi =
|
||||||
patch().lookupPatchField<volScalarField, scalar>("psi");
|
patch().lookupPatchField<volScalarField, scalar>(psiName_);
|
||||||
const fvPatchVectorField& pU =
|
const fvPatchVectorField& pU =
|
||||||
patch().lookupPatchField<volVectorField, vector>("U");
|
patch().lookupPatchField<volVectorField, vector>(UName_);
|
||||||
|
|
||||||
// Prandtl number reading consistent with rhoCentralFoam
|
// Prandtl number reading consistent with rhoCentralFoam
|
||||||
const dictionary& thermophysicalProperties =
|
const dictionary& thermophysicalProperties =
|
||||||
@ -204,6 +216,12 @@ void Foam::smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
|
|||||||
void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
|
void Foam::smoluchowskiJumpTFvPatchScalarField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchScalarField::write(os);
|
fvPatchScalarField::write(os);
|
||||||
|
|
||||||
|
writeEntryIfDifferent<word>(os, "U", "U", UName_);
|
||||||
|
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
||||||
|
writeEntryIfDifferent<word>(os, "psi", "thermo:psi", psiName_);
|
||||||
|
writeEntryIfDifferent<word>(os, "mu", "thermo:mu", muName_);
|
||||||
|
|
||||||
os.writeKeyword("accommodationCoeff")
|
os.writeKeyword("accommodationCoeff")
|
||||||
<< accommodationCoeff_ << token::END_STATEMENT << nl;
|
<< accommodationCoeff_ << token::END_STATEMENT << nl;
|
||||||
Twall_.writeEntry("Twall", os);
|
Twall_.writeEntry("Twall", os);
|
||||||
|
|||||||
@ -53,13 +53,25 @@ class smoluchowskiJumpTFvPatchScalarField
|
|||||||
|
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
// Accommodation coefficient
|
//- Velocity field name, default = "U"
|
||||||
|
word UName_;
|
||||||
|
|
||||||
|
//- Density field name, default = "rho"
|
||||||
|
word rhoName_;
|
||||||
|
|
||||||
|
//- Compressibility field name, default = "thermo:psi"
|
||||||
|
word psiName_;
|
||||||
|
|
||||||
|
//- Dynamic viscosity field name, default = "thermo:mu"
|
||||||
|
word muName_;
|
||||||
|
|
||||||
|
//- Accommodation coefficient
|
||||||
scalar accommodationCoeff_;
|
scalar accommodationCoeff_;
|
||||||
|
|
||||||
// Wall surface temperature
|
//- Wall surface temperature
|
||||||
scalarField Twall_;
|
scalarField Twall_;
|
||||||
|
|
||||||
// Heat capacity ratio (default 1.4)
|
//- Heat capacity ratio (default 1.4)
|
||||||
scalar gamma_;
|
scalar gamma_;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -30,20 +30,20 @@ License
|
|||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "fvcGrad.H"
|
#include "fvcGrad.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
||||||
(
|
(
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<vector, volMesh>& iF
|
const DimensionedField<vector, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFixedValueSlipFvPatchVectorField(p, iF),
|
mixedFixedValueSlipFvPatchVectorField(p, iF),
|
||||||
|
TName_("T"),
|
||||||
|
rhoName_("rho"),
|
||||||
|
psiName_("thermo:psi"),
|
||||||
|
muName_("thermo:mu"),
|
||||||
|
tauMCName_("tauMC"),
|
||||||
accommodationCoeff_(1.0),
|
accommodationCoeff_(1.0),
|
||||||
Uwall_(p.size(), vector(0.0, 0.0, 0.0)),
|
Uwall_(p.size(), vector(0.0, 0.0, 0.0)),
|
||||||
thermalCreep_(true),
|
thermalCreep_(true),
|
||||||
@ -51,23 +51,28 @@ maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
|||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
||||||
(
|
(
|
||||||
const maxwellSlipUFvPatchVectorField& tdpvf,
|
const maxwellSlipUFvPatchVectorField& mspvf,
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<vector, volMesh>& iF,
|
const DimensionedField<vector, volMesh>& iF,
|
||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFixedValueSlipFvPatchVectorField(tdpvf, p, iF, mapper),
|
mixedFixedValueSlipFvPatchVectorField(mspvf, p, iF, mapper),
|
||||||
accommodationCoeff_(tdpvf.accommodationCoeff_),
|
TName_(mspvf.TName_),
|
||||||
Uwall_(tdpvf.Uwall_),
|
rhoName_(mspvf.rhoName_),
|
||||||
thermalCreep_(tdpvf.thermalCreep_),
|
psiName_(mspvf.psiName_),
|
||||||
curvature_(tdpvf.curvature_)
|
muName_(mspvf.muName_),
|
||||||
|
tauMCName_(mspvf.tauMCName_),
|
||||||
|
accommodationCoeff_(mspvf.accommodationCoeff_),
|
||||||
|
Uwall_(mspvf.Uwall_),
|
||||||
|
thermalCreep_(mspvf.thermalCreep_),
|
||||||
|
curvature_(mspvf.curvature_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
||||||
(
|
(
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<vector, volMesh>& iF,
|
const DimensionedField<vector, volMesh>& iF,
|
||||||
@ -75,6 +80,11 @@ maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFixedValueSlipFvPatchVectorField(p, iF),
|
mixedFixedValueSlipFvPatchVectorField(p, iF),
|
||||||
|
TName_(dict.lookupOrDefault<word>("T", "T")),
|
||||||
|
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
||||||
|
psiName_(dict.lookupOrDefault<word>("psi", "thermo:psi")),
|
||||||
|
muName_(dict.lookupOrDefault<word>("mu", "thermo:mu")),
|
||||||
|
tauMCName_(dict.lookupOrDefault<word>("tauMC", "tauMC")),
|
||||||
accommodationCoeff_(readScalar(dict.lookup("accommodationCoeff"))),
|
accommodationCoeff_(readScalar(dict.lookup("accommodationCoeff"))),
|
||||||
Uwall_("Uwall", dict, p.size()),
|
Uwall_("Uwall", dict, p.size()),
|
||||||
thermalCreep_(dict.lookupOrDefault("thermalCreep", true)),
|
thermalCreep_(dict.lookupOrDefault("thermalCreep", true)),
|
||||||
@ -88,9 +98,12 @@ maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
|||||||
{
|
{
|
||||||
FatalIOErrorIn
|
FatalIOErrorIn
|
||||||
(
|
(
|
||||||
"maxwellSlipUFvPatchScalarField::"
|
"maxwellSlipUFvPatchScalarField::maxwellSlipUFvPatchScalarField"
|
||||||
"maxwellSlipUFvPatchScalarField"
|
"("
|
||||||
"(const fvPatch&, const scalarField&, const dictionary&)",
|
"const fvPatch&, "
|
||||||
|
"const DimensionedField<vector, volMesh>&, "
|
||||||
|
"const dictionary&"
|
||||||
|
")",
|
||||||
dict
|
dict
|
||||||
) << "unphysical accommodationCoeff_ specified"
|
) << "unphysical accommodationCoeff_ specified"
|
||||||
<< "(0 < accommodationCoeff_ <= 1)" << endl
|
<< "(0 < accommodationCoeff_ <= 1)" << endl
|
||||||
@ -119,23 +132,28 @@ maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
||||||
(
|
(
|
||||||
const maxwellSlipUFvPatchVectorField& tdpvf,
|
const maxwellSlipUFvPatchVectorField& mspvf,
|
||||||
const DimensionedField<vector, volMesh>& iF
|
const DimensionedField<vector, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFixedValueSlipFvPatchVectorField(tdpvf, iF),
|
mixedFixedValueSlipFvPatchVectorField(mspvf, iF),
|
||||||
accommodationCoeff_(tdpvf.accommodationCoeff_),
|
TName_(mspvf.TName_),
|
||||||
Uwall_(tdpvf.Uwall_),
|
rhoName_(mspvf.rhoName_),
|
||||||
thermalCreep_(tdpvf.thermalCreep_),
|
psiName_(mspvf.psiName_),
|
||||||
curvature_(tdpvf.curvature_)
|
muName_(mspvf.muName_),
|
||||||
|
tauMCName_(mspvf.tauMCName_),
|
||||||
|
accommodationCoeff_(mspvf.accommodationCoeff_),
|
||||||
|
Uwall_(mspvf.Uwall_),
|
||||||
|
thermalCreep_(mspvf.thermalCreep_),
|
||||||
|
curvature_(mspvf.curvature_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void maxwellSlipUFvPatchVectorField::updateCoeffs()
|
void Foam::maxwellSlipUFvPatchVectorField::updateCoeffs()
|
||||||
{
|
{
|
||||||
if (updated())
|
if (updated())
|
||||||
{
|
{
|
||||||
@ -143,11 +161,11 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const fvPatchScalarField& pmu =
|
const fvPatchScalarField& pmu =
|
||||||
patch().lookupPatchField<volScalarField, scalar>("mu");
|
patch().lookupPatchField<volScalarField, scalar>(muName_);
|
||||||
const fvPatchScalarField& prho =
|
const fvPatchScalarField& prho =
|
||||||
patch().lookupPatchField<volScalarField, scalar>("rho");
|
patch().lookupPatchField<volScalarField, scalar>(rhoName_);
|
||||||
const fvPatchField<scalar>& ppsi =
|
const fvPatchField<scalar>& ppsi =
|
||||||
patch().lookupPatchField<volScalarField, scalar>("psi");
|
patch().lookupPatchField<volScalarField, scalar>(psiName_);
|
||||||
|
|
||||||
Field<scalar> C1
|
Field<scalar> C1
|
||||||
(
|
(
|
||||||
@ -163,7 +181,7 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs()
|
|||||||
if (thermalCreep_)
|
if (thermalCreep_)
|
||||||
{
|
{
|
||||||
const volScalarField& vsfT =
|
const volScalarField& vsfT =
|
||||||
this->db().objectRegistry::lookupObject<volScalarField>("T");
|
this->db().objectRegistry::lookupObject<volScalarField>(TName_);
|
||||||
label patchi = this->patch().index();
|
label patchi = this->patch().index();
|
||||||
const fvPatchScalarField& pT = vsfT.boundaryField()[patchi];
|
const fvPatchScalarField& pT = vsfT.boundaryField()[patchi];
|
||||||
Field<vector> gradpT(fvc::grad(vsfT)().boundaryField()[patchi]);
|
Field<vector> gradpT(fvc::grad(vsfT)().boundaryField()[patchi]);
|
||||||
@ -175,7 +193,7 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs()
|
|||||||
if (curvature_)
|
if (curvature_)
|
||||||
{
|
{
|
||||||
const fvPatchTensorField& ptauMC =
|
const fvPatchTensorField& ptauMC =
|
||||||
patch().lookupPatchField<volTensorField, tensor>("tauMC");
|
patch().lookupPatchField<volTensorField, tensor>(tauMCName_);
|
||||||
vectorField n(patch().nf());
|
vectorField n(patch().nf());
|
||||||
|
|
||||||
refValue() -= C1/prho*transform(I - n*n, (n & ptauMC));
|
refValue() -= C1/prho*transform(I - n*n, (n & ptauMC));
|
||||||
@ -185,9 +203,15 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void maxwellSlipUFvPatchVectorField::write(Ostream& os) const
|
void Foam::maxwellSlipUFvPatchVectorField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchVectorField::write(os);
|
fvPatchVectorField::write(os);
|
||||||
|
writeEntryIfDifferent<word>(os, "T", "T", TName_);
|
||||||
|
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
||||||
|
writeEntryIfDifferent<word>(os, "psi", "thermo:psi", psiName_);
|
||||||
|
writeEntryIfDifferent<word>(os, "mu", "thermo:mu", muName_);
|
||||||
|
writeEntryIfDifferent<word>(os, "tauMC", "tauMC", tauMCName_);
|
||||||
|
|
||||||
os.writeKeyword("accommodationCoeff")
|
os.writeKeyword("accommodationCoeff")
|
||||||
<< accommodationCoeff_ << token::END_STATEMENT << nl;
|
<< accommodationCoeff_ << token::END_STATEMENT << nl;
|
||||||
Uwall_.writeEntry("Uwall", os);
|
Uwall_.writeEntry("Uwall", os);
|
||||||
@ -204,14 +228,13 @@ void maxwellSlipUFvPatchVectorField::write(Ostream& os) const
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
makePatchTypeField
|
namespace Foam
|
||||||
(
|
{
|
||||||
|
makePatchTypeField
|
||||||
|
(
|
||||||
fvPatchVectorField,
|
fvPatchVectorField,
|
||||||
maxwellSlipUFvPatchVectorField
|
maxwellSlipUFvPatchVectorField
|
||||||
);
|
);
|
||||||
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -54,6 +54,21 @@ class maxwellSlipUFvPatchVectorField
|
|||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
//- Temperature field name, default = "T"
|
||||||
|
word TName_;
|
||||||
|
|
||||||
|
//- Density field name, default = "rho"
|
||||||
|
word rhoName_;
|
||||||
|
|
||||||
|
//- Compressibility field name, default = "thermo:psi"
|
||||||
|
word psiName_;
|
||||||
|
|
||||||
|
//- Dynamic viscosity field name, default = "thermo:mu"
|
||||||
|
word muName_;
|
||||||
|
|
||||||
|
//- tauMC field name, default = "tauMC"
|
||||||
|
word tauMCName_;
|
||||||
|
|
||||||
// Accommodation coefficient
|
// Accommodation coefficient
|
||||||
scalar accommodationCoeff_;
|
scalar accommodationCoeff_;
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -27,27 +27,22 @@ License
|
|||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
#include "fvPatchFieldMapper.H"
|
#include "fvPatchFieldMapper.H"
|
||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "surfaceFields.H"
|
|
||||||
#include "fvCFD.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField
|
Foam::fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField
|
||||||
(
|
(
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(p, iF)
|
fixedValueFvPatchScalarField(p, iF),
|
||||||
|
pName_("p"),
|
||||||
|
psiName_("thermo:psi")
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField
|
Foam::fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField
|
||||||
(
|
(
|
||||||
const fixedRhoFvPatchScalarField& ptf,
|
const fixedRhoFvPatchScalarField& ptf,
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
@ -55,43 +50,51 @@ fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField
|
|||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(ptf, p, iF, mapper)
|
fixedValueFvPatchScalarField(ptf, p, iF, mapper),
|
||||||
|
pName_(ptf.pName_),
|
||||||
|
psiName_(ptf.psiName_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField
|
Foam::fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField
|
||||||
(
|
(
|
||||||
const fvPatch& p,
|
const fvPatch& p,
|
||||||
const DimensionedField<scalar, volMesh>& iF,
|
const DimensionedField<scalar, volMesh>& iF,
|
||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(p, iF, dict)
|
fixedValueFvPatchScalarField(p, iF, dict),
|
||||||
|
pName_(dict.lookupOrDefault<word>("p", "p")),
|
||||||
|
psiName_(dict.lookupOrDefault<word>("psi", "thermo:psi"))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField
|
Foam::fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField
|
||||||
(
|
(
|
||||||
const fixedRhoFvPatchScalarField& tppsf
|
const fixedRhoFvPatchScalarField& frpsf
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(tppsf)
|
fixedValueFvPatchScalarField(frpsf),
|
||||||
|
pName_(frpsf.pName_),
|
||||||
|
psiName_(frpsf.psiName_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField
|
Foam::fixedRhoFvPatchScalarField::fixedRhoFvPatchScalarField
|
||||||
(
|
(
|
||||||
const fixedRhoFvPatchScalarField& tppsf,
|
const fixedRhoFvPatchScalarField& frpsf,
|
||||||
const DimensionedField<scalar, volMesh>& iF
|
const DimensionedField<scalar, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
fixedValueFvPatchScalarField(tppsf, iF)
|
fixedValueFvPatchScalarField(frpsf, iF),
|
||||||
|
pName_(frpsf.pName_),
|
||||||
|
psiName_(frpsf.psiName_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void fixedRhoFvPatchScalarField::updateCoeffs()
|
void Foam::fixedRhoFvPatchScalarField::updateCoeffs()
|
||||||
{
|
{
|
||||||
if (updated())
|
if (updated())
|
||||||
{
|
{
|
||||||
@ -99,10 +102,10 @@ void fixedRhoFvPatchScalarField::updateCoeffs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const fvPatchField<scalar>& psip =
|
const fvPatchField<scalar>& psip =
|
||||||
patch().lookupPatchField<volScalarField, scalar>("psi");
|
patch().lookupPatchField<volScalarField, scalar>(psiName_);
|
||||||
|
|
||||||
const fvPatchField<scalar>& pp =
|
const fvPatchField<scalar>& pp =
|
||||||
patch().lookupPatchField<volScalarField, scalar>("p");
|
patch().lookupPatchField<volScalarField, scalar>(pName_);
|
||||||
|
|
||||||
operator==(psip*pp);
|
operator==(psip*pp);
|
||||||
|
|
||||||
@ -110,16 +113,24 @@ void fixedRhoFvPatchScalarField::updateCoeffs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::fixedRhoFvPatchScalarField::write(Ostream& os) const
|
||||||
|
{
|
||||||
|
fvPatchScalarField::write(os);
|
||||||
|
|
||||||
|
writeEntryIfDifferent<word>(os, "p", "p", this->pName_);
|
||||||
|
writeEntryIfDifferent<word>(os, "psi", "thermo:psi", psiName_);
|
||||||
|
writeEntry("value", os);
|
||||||
|
}
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
makePatchTypeField
|
namespace Foam
|
||||||
(
|
{
|
||||||
|
makePatchTypeField
|
||||||
|
(
|
||||||
fvPatchScalarField,
|
fvPatchScalarField,
|
||||||
fixedRhoFvPatchScalarField
|
fixedRhoFvPatchScalarField
|
||||||
);
|
);
|
||||||
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -24,9 +24,42 @@ License
|
|||||||
Class
|
Class
|
||||||
Foam::fixedRhoFvPatchScalarField
|
Foam::fixedRhoFvPatchScalarField
|
||||||
|
|
||||||
|
Group
|
||||||
|
grpInletBoundaryConditions
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Foam::fixedRhoFvPatchScalarField
|
Foam::fixedRhoFvPatchScalarField
|
||||||
|
|
||||||
|
This boundary condition provides a fixed density inlet condition for
|
||||||
|
compressible solvers, where the density of calculated using:
|
||||||
|
|
||||||
|
\f{
|
||||||
|
\rho = \psi p
|
||||||
|
\f]
|
||||||
|
|
||||||
|
where
|
||||||
|
\vartable
|
||||||
|
p | pressure [Pa]
|
||||||
|
\rho | density [kg/m3]
|
||||||
|
\endvartable
|
||||||
|
|
||||||
|
|
||||||
|
\heading Patch usage
|
||||||
|
|
||||||
|
\table
|
||||||
|
Property | Description | Required | Default value
|
||||||
|
pName | Pressure field name | no | p
|
||||||
|
psiName | Compressibility field name | no | thermo:psi
|
||||||
|
\endtable
|
||||||
|
|
||||||
|
Example of the boundary condition specification:
|
||||||
|
\verbatim
|
||||||
|
myPatch
|
||||||
|
{
|
||||||
|
type fixedRho;
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
fixedRhoFvPatchScalarField.C
|
fixedRhoFvPatchScalarField.C
|
||||||
|
|
||||||
@ -51,6 +84,17 @@ class fixedRhoFvPatchScalarField
|
|||||||
public fixedValueFvPatchScalarField
|
public fixedValueFvPatchScalarField
|
||||||
{
|
{
|
||||||
|
|
||||||
|
private:
|
||||||
|
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
//- Pressure field name, default = "p"
|
||||||
|
word pName_;
|
||||||
|
|
||||||
|
//- Compressibility field name, default = "thermo:psi"
|
||||||
|
word psiName_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
@ -125,6 +169,10 @@ public:
|
|||||||
|
|
||||||
//- Update the coefficients associated with the patch field
|
//- Update the coefficients associated with the patch field
|
||||||
virtual void updateCoeffs();
|
virtual void updateCoeffs();
|
||||||
|
|
||||||
|
|
||||||
|
//- Write
|
||||||
|
virtual void write(Ostream&) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -4,7 +4,6 @@ set -x
|
|||||||
|
|
||||||
wmake
|
wmake
|
||||||
wmake rhoPimplecFoam
|
wmake rhoPimplecFoam
|
||||||
wmake rhoPorousMRFPimpleFoam
|
wmake rhoLTSPimpleFoam
|
||||||
wmake rhoPorousMRFLTSPimpleFoam
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------- end-of-file
|
# ----------------------------------------------------------------- end-of-file
|
||||||
|
|||||||
@ -39,7 +39,7 @@ if (pimple.transonic())
|
|||||||
sources(psi, p, rho.name())
|
sources(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
sources.constrain(pEqn, rho.name());
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
@ -77,7 +77,7 @@ else
|
|||||||
sources(psi, p, rho.name())
|
sources(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
sources.constrain(pEqn, rho.name());
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
|
|||||||
@ -51,7 +51,7 @@ if (pimple.transonic())
|
|||||||
// Relax the pressure equation to maintain diagonal dominance
|
// Relax the pressure equation to maintain diagonal dominance
|
||||||
pEqn.relax();
|
pEqn.relax();
|
||||||
|
|
||||||
sources.constrain(pEqn, rho.name());
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve();
|
pEqn.solve();
|
||||||
|
|
||||||
@ -89,7 +89,7 @@ else
|
|||||||
sources(psi, p, rho.name())
|
sources(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
sources.constrain(pEqn, rho.name());
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve();
|
pEqn.solve();
|
||||||
|
|
||||||
|
|||||||
@ -35,7 +35,7 @@
|
|||||||
// Relax the pressure equation to ensure diagonal-dominance
|
// Relax the pressure equation to ensure diagonal-dominance
|
||||||
pEqn.relax();
|
pEqn.relax();
|
||||||
|
|
||||||
sources.constrain(pEqn, rho.name());
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.setReference(pRefCell, pRefValue);
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
|
|
||||||
@ -71,7 +71,7 @@
|
|||||||
|
|
||||||
pEqn.setReference(pRefCell, pRefValue);
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
|
|
||||||
sources.constrain(pEqn, rho.name());
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve();
|
pEqn.solve();
|
||||||
|
|
||||||
|
|||||||
@ -45,7 +45,7 @@ if (simple.transonic())
|
|||||||
// Relax the pressure equation to maintain diagonal dominance
|
// Relax the pressure equation to maintain diagonal dominance
|
||||||
pEqn.relax();
|
pEqn.relax();
|
||||||
|
|
||||||
sources.constrain(pEqn, rho.name());
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.setReference(pRefCell, pRefValue);
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
|
|
||||||
@ -82,7 +82,7 @@ else
|
|||||||
sources(psi, p, rho.name())
|
sources(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
sources.constrain(pEqn, rho.name());
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.setReference(pRefCell, pRefValue);
|
pEqn.setReference(pRefCell, pRefValue);
|
||||||
|
|
||||||
|
|||||||
28
applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H
Normal file
28
applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H
Normal file
@ -0,0 +1,28 @@
|
|||||||
|
{
|
||||||
|
volScalarField& he = thermo.he();
|
||||||
|
|
||||||
|
fvScalarMatrix EEqn
|
||||||
|
(
|
||||||
|
fvm::ddt(rho, he) + fvm::div(phi, he)
|
||||||
|
+ fvc::ddt(rho, K) + fvc::div(phi, K)
|
||||||
|
+ (
|
||||||
|
he.name() == "e"
|
||||||
|
? fvc::div
|
||||||
|
(
|
||||||
|
fvc::absolute(phi/fvc::interpolate(rho), U),
|
||||||
|
p,
|
||||||
|
"div(phiv,p)"
|
||||||
|
)
|
||||||
|
: -dpdt
|
||||||
|
)
|
||||||
|
- fvm::laplacian(turbulence->alphaEff(), he)
|
||||||
|
==
|
||||||
|
sources(rho, he)
|
||||||
|
);
|
||||||
|
|
||||||
|
EEqn.relax();
|
||||||
|
sources.constrain(EEqn);
|
||||||
|
EEqn.solve();
|
||||||
|
|
||||||
|
thermo.correct();
|
||||||
|
}
|
||||||
@ -1,21 +1,21 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I../../compressible/rhoPimpleFoam \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/sampling/lnInclude \
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
-I$(LIB_SRC)/meshTools/lnInclude \
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/fieldSources/lnInclude \
|
-I$(LIB_SRC)/fieldSources/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
|
||||||
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lmeshTools \
|
|
||||||
-lfluidThermophysicalModels \
|
|
||||||
-lspecie \
|
|
||||||
-lcompressibleTurbulenceModel \
|
|
||||||
-lcompressibleRASModels \
|
|
||||||
-lcompressibleLESModels \
|
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
-lsampling \
|
-lsampling \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lfieldSources
|
-lfieldSources \
|
||||||
|
-lfluidThermophysicalModels \
|
||||||
|
-lradiationModels \
|
||||||
|
-lspecie \
|
||||||
|
-lcompressibleTurbulenceModel \
|
||||||
|
-lcompressibleRASModels \
|
||||||
|
-lcompressibleLESModels
|
||||||
|
|
||||||
|
|||||||
@ -5,10 +5,14 @@
|
|||||||
fvm::ddt(rho, U)
|
fvm::ddt(rho, U)
|
||||||
+ fvm::div(phi, U)
|
+ fvm::div(phi, U)
|
||||||
+ turbulence->divDevRhoReff(U)
|
+ turbulence->divDevRhoReff(U)
|
||||||
|
==
|
||||||
|
sources(rho, U)
|
||||||
);
|
);
|
||||||
|
|
||||||
UEqn.relax();
|
UEqn.relax();
|
||||||
|
|
||||||
|
sources.constrain(UEqn);
|
||||||
|
|
||||||
if (pimple.momentumPredictor())
|
if (pimple.momentumPredictor())
|
||||||
{
|
{
|
||||||
solve
|
solve
|
||||||
@ -22,7 +26,6 @@
|
|||||||
- fvc::snGrad(p_rgh)
|
- fvc::snGrad(p_rgh)
|
||||||
)*mesh.magSf()
|
)*mesh.magSf()
|
||||||
)
|
)
|
||||||
+ sources(rho, U)
|
|
||||||
);
|
);
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,7 +36,7 @@ Description
|
|||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "rhoThermo.H"
|
#include "rhoThermo.H"
|
||||||
#include "turbulenceModel.H"
|
#include "turbulenceModel.H"
|
||||||
#include "fixedGradientFvPatchFields.H"
|
#include "radiationModel.H"
|
||||||
#include "IObasicSourceList.H"
|
#include "IObasicSourceList.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
|
||||||
@ -49,6 +49,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
#include "readGravitationalAcceleration.H"
|
#include "readGravitationalAcceleration.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
|
#include "createRadiationModel.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
#include "readTimeControls.H"
|
#include "readTimeControls.H"
|
||||||
#include "compressibleCourantNo.H"
|
#include "compressibleCourantNo.H"
|
||||||
|
|||||||
@ -1,9 +1,6 @@
|
|||||||
Info<< "Reading thermophysical properties\n" << endl;
|
Info<< "Reading thermophysical properties\n" << endl;
|
||||||
|
|
||||||
autoPtr<rhoThermo> pThermo
|
autoPtr<rhoThermo> pThermo(rhoThermo::New(mesh));
|
||||||
(
|
|
||||||
rhoThermo::New(mesh)
|
|
||||||
);
|
|
||||||
rhoThermo& thermo = pThermo();
|
rhoThermo& thermo = pThermo();
|
||||||
thermo.validate(args.executable(), "h", "e");
|
thermo.validate(args.executable(), "h", "e");
|
||||||
|
|
||||||
|
|||||||
@ -9,7 +9,7 @@
|
|||||||
surfaceScalarField rhorAUf("Dp", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("Dp", fvc::interpolate(rho*rAU));
|
||||||
|
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*(UEqn == sources(rho, U))().H();
|
HbyA = rAU*UEqn.H();
|
||||||
|
|
||||||
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
surfaceScalarField phig(-rhorAUf*ghf*fvc::snGrad(rho)*mesh.magSf());
|
||||||
|
|
||||||
@ -24,6 +24,8 @@
|
|||||||
+ phig
|
+ phig
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
fvScalarMatrix p_rghDDtEqn
|
fvScalarMatrix p_rghDDtEqn
|
||||||
(
|
(
|
||||||
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
|
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
|
||||||
@ -40,7 +42,7 @@
|
|||||||
- fvm::laplacian(rhorAUf, p_rgh)
|
- fvm::laplacian(rhorAUf, p_rgh)
|
||||||
);
|
);
|
||||||
|
|
||||||
sources.constrain(p_rghEqn, rho.name());
|
sources.constrain(p_rghEqn);
|
||||||
|
|
||||||
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
|
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
|
|||||||
@ -1,8 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
cd ${0%/*} || exit 1 # run from this directory
|
|
||||||
set -x
|
|
||||||
|
|
||||||
wmake
|
|
||||||
wmake buoyantSimpleRadiationFoam
|
|
||||||
|
|
||||||
# ----------------------------------------------------------------- end-of-file
|
|
||||||
@ -10,10 +10,17 @@
|
|||||||
: fvc::div(phi, volScalarField("K", 0.5*magSqr(U)))
|
: fvc::div(phi, volScalarField("K", 0.5*magSqr(U)))
|
||||||
)
|
)
|
||||||
- fvm::laplacian(turbulence->alphaEff(), he)
|
- fvm::laplacian(turbulence->alphaEff(), he)
|
||||||
|
==
|
||||||
|
radiation->Sh(thermo)
|
||||||
|
+ sources(rho, he)
|
||||||
);
|
);
|
||||||
|
|
||||||
EEqn.relax();
|
EEqn.relax();
|
||||||
|
|
||||||
|
sources.constrain(EEqn);
|
||||||
|
|
||||||
EEqn.solve();
|
EEqn.solve();
|
||||||
|
|
||||||
thermo.correct();
|
thermo.correct();
|
||||||
|
radiation->correct();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,14 +1,22 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/fieldSources/lnInclude \
|
||||||
|
-I$(LIB_SRC)/sampling/lnInclude \
|
||||||
|
-I$(LIB_SRC)/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
|
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels \
|
-I$(LIB_SRC)/turbulenceModels \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
|
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
|
||||||
-I$(LIB_SRC)/finiteVolume/cfdTools \
|
-I$(LIB_SRC)/turbulenceModels/RAS \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
|
-lfiniteVolume \
|
||||||
|
-lfieldSources \
|
||||||
|
-lsampling \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lfluidThermophysicalModels \
|
-lfluidThermophysicalModels \
|
||||||
-lspecie \
|
-lspecie \
|
||||||
|
-lradiationModels \
|
||||||
-lcompressibleTurbulenceModel \
|
-lcompressibleTurbulenceModel \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
-lfiniteVolume
|
-lmeshTools
|
||||||
|
|||||||
@ -4,11 +4,13 @@
|
|||||||
(
|
(
|
||||||
fvm::div(phi, U)
|
fvm::div(phi, U)
|
||||||
+ turbulence->divDevRhoReff(U)
|
+ turbulence->divDevRhoReff(U)
|
||||||
|
==
|
||||||
|
sources(rho, U)
|
||||||
);
|
);
|
||||||
|
|
||||||
UEqn().relax();
|
UEqn().relax();
|
||||||
|
|
||||||
mrfZones.addCoriolis(rho, UEqn());
|
sources.constrain(UEqn());
|
||||||
|
|
||||||
if (simple.momentumPredictor())
|
if (simple.momentumPredictor())
|
||||||
{
|
{
|
||||||
|
|||||||
@ -22,19 +22,20 @@ License
|
|||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||||
|
|
||||||
Application
|
Application
|
||||||
buoyantSimpleFoam
|
buoyantSimpleRadiationFoam
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Steady-state solver for buoyant, turbulent flow of compressible fluids
|
Steady-state solver for buoyant, turbulent flow of compressible fluids,
|
||||||
|
including radiation, for ventilation and heat-transfer.
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "fvCFD.H"
|
#include "fvCFD.H"
|
||||||
#include "psiThermo.H"
|
#include "psiThermo.H"
|
||||||
#include "RASModel.H"
|
#include "RASModel.H"
|
||||||
#include "fixedGradientFvPatchFields.H"
|
#include "radiationModel.H"
|
||||||
#include "simpleControl.H"
|
#include "simpleControl.H"
|
||||||
#include "IOMRFZoneList.H"
|
#include "IObasicSourceList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -45,7 +46,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "createMesh.H"
|
#include "createMesh.H"
|
||||||
#include "readGravitationalAcceleration.H"
|
#include "readGravitationalAcceleration.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
#include "createZones.H"
|
#include "createRadiationModel.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
|
|
||||||
simpleControl simple(mesh);
|
simpleControl simple(mesh);
|
||||||
|
|||||||
@ -1,22 +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)
|
|
||||||
==
|
|
||||||
radiation->Sh(thermo)
|
|
||||||
);
|
|
||||||
|
|
||||||
EEqn.relax();
|
|
||||||
EEqn.solve();
|
|
||||||
|
|
||||||
thermo.correct();
|
|
||||||
radiation->correct();
|
|
||||||
}
|
|
||||||
@ -1,3 +0,0 @@
|
|||||||
buoyantSimpleRadiationFoam.C
|
|
||||||
|
|
||||||
EXE = $(FOAM_APPBIN)/buoyantSimpleRadiationFoam
|
|
||||||
@ -1,18 +0,0 @@
|
|||||||
EXE_INC = \
|
|
||||||
-I.. \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
|
||||||
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
|
|
||||||
-I$(LIB_SRC)/turbulenceModels \
|
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude \
|
|
||||||
-I$(LIB_SRC)/turbulenceModels/RAS \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/cfdTools \
|
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
|
||||||
|
|
||||||
EXE_LIBS = \
|
|
||||||
-lfluidThermophysicalModels \
|
|
||||||
-lspecie \
|
|
||||||
-lradiationModels \
|
|
||||||
-lcompressibleTurbulenceModel \
|
|
||||||
-lcompressibleRASModels \
|
|
||||||
-lfiniteVolume \
|
|
||||||
-lmeshTools
|
|
||||||
@ -1,86 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
|
||||||
\\/ M anipulation |
|
|
||||||
-------------------------------------------------------------------------------
|
|
||||||
License
|
|
||||||
This file is part of OpenFOAM.
|
|
||||||
|
|
||||||
OpenFOAM is free software: you can redistribute it and/or modify it
|
|
||||||
under the terms of the GNU General Public License as published by
|
|
||||||
the Free Software Foundation, either version 3 of the License, or
|
|
||||||
(at your option) any later version.
|
|
||||||
|
|
||||||
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
|
|
||||||
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
|
|
||||||
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
|
|
||||||
for more details.
|
|
||||||
|
|
||||||
You should have received a copy of the GNU General Public License
|
|
||||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
Application
|
|
||||||
buoyantSimpleRadiationFoam
|
|
||||||
|
|
||||||
Description
|
|
||||||
Steady-state solver for buoyant, turbulent flow of compressible fluids,
|
|
||||||
including radiation, for ventilation and heat-transfer.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#include "fvCFD.H"
|
|
||||||
#include "psiThermo.H"
|
|
||||||
#include "RASModel.H"
|
|
||||||
#include "fixedGradientFvPatchFields.H"
|
|
||||||
#include "radiationModel.H"
|
|
||||||
#include "simpleControl.H"
|
|
||||||
#include "IOMRFZoneList.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
|
||||||
{
|
|
||||||
#include "setRootCase.H"
|
|
||||||
#include "createTime.H"
|
|
||||||
#include "createMesh.H"
|
|
||||||
#include "readGravitationalAcceleration.H"
|
|
||||||
#include "createFields.H"
|
|
||||||
#include "createZones.H"
|
|
||||||
#include "createRadiationModel.H"
|
|
||||||
#include "initContinuityErrs.H"
|
|
||||||
|
|
||||||
simpleControl simple(mesh);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
|
||||||
|
|
||||||
while (simple.loop())
|
|
||||||
{
|
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
|
||||||
|
|
||||||
// Pressure-velocity SIMPLE corrector
|
|
||||||
{
|
|
||||||
#include "UEqn.H"
|
|
||||||
#include "EEqn.H"
|
|
||||||
#include "pEqn.H"
|
|
||||||
}
|
|
||||||
|
|
||||||
turbulence->correct();
|
|
||||||
|
|
||||||
runTime.write();
|
|
||||||
|
|
||||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
|
||||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
|
||||||
<< nl << endl;
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
|
||||||
|
|
||||||
return 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -87,3 +87,5 @@
|
|||||||
|
|
||||||
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
|
dimensionedScalar initialMass = fvc::domainIntegrate(rho);
|
||||||
dimensionedScalar totalVolume = sum(mesh.V());
|
dimensionedScalar totalVolume = sum(mesh.V());
|
||||||
|
|
||||||
|
IObasicSourceList sources(mesh);
|
||||||
|
|||||||
@ -1,3 +0,0 @@
|
|||||||
IOMRFZoneList mrfZones(mesh);
|
|
||||||
mrfZones.correctBoundaryVelocity(U);
|
|
||||||
|
|
||||||
@ -17,7 +17,7 @@
|
|||||||
fvc::interpolate(rho)*(fvc::interpolate(HbyA) & mesh.Sf())
|
fvc::interpolate(rho)*(fvc::interpolate(HbyA) & mesh.Sf())
|
||||||
);
|
);
|
||||||
|
|
||||||
mrfZones.relativeFlux(fvc::interpolate(rho), phiHbyA);
|
sources.relativeFlux(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
bool closedVolume = adjustPhi(phiHbyA, U, p_rgh);
|
bool closedVolume = adjustPhi(phiHbyA, U, p_rgh);
|
||||||
|
|
||||||
@ -45,6 +45,7 @@
|
|||||||
// 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();
|
||||||
|
sources.correct(U);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -36,7 +36,6 @@ Description
|
|||||||
#include "regionProperties.H"
|
#include "regionProperties.H"
|
||||||
#include "solidThermo.H"
|
#include "solidThermo.H"
|
||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
#include "IOporosityModelList.H"
|
|
||||||
#include "IObasicSourceList.H"
|
#include "IObasicSourceList.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -16,6 +16,9 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
EEqn.relax();
|
EEqn.relax();
|
||||||
|
|
||||||
|
sources.constrain(EEqn);
|
||||||
|
|
||||||
EEqn.solve();
|
EEqn.solve();
|
||||||
|
|
||||||
thermo.correct();
|
thermo.correct();
|
||||||
|
|||||||
@ -3,13 +3,13 @@
|
|||||||
(
|
(
|
||||||
fvm::div(phi, U)
|
fvm::div(phi, U)
|
||||||
+ turb.divDevRhoReff(U)
|
+ turb.divDevRhoReff(U)
|
||||||
+ sources(rho, U)
|
==
|
||||||
|
sources(rho, U)
|
||||||
);
|
);
|
||||||
|
|
||||||
UEqn().relax();
|
UEqn().relax();
|
||||||
|
|
||||||
// Add porous resistance
|
sources.constrain(UEqn());
|
||||||
pZones.addResistance(UEqn());
|
|
||||||
|
|
||||||
solve
|
solve
|
||||||
(
|
(
|
||||||
|
|||||||
@ -18,7 +18,6 @@
|
|||||||
PtrList<dimensionedScalar> rhoMin(fluidRegions.size());
|
PtrList<dimensionedScalar> rhoMin(fluidRegions.size());
|
||||||
|
|
||||||
PtrList<IObasicSourceList> heatSources(fluidRegions.size());
|
PtrList<IObasicSourceList> heatSources(fluidRegions.size());
|
||||||
PtrList<IOporosityModelList> porousZonesFluid(fluidRegions.size());
|
|
||||||
|
|
||||||
// Populate fluid field pointer lists
|
// Populate fluid field pointer lists
|
||||||
forAll(fluidRegions, i)
|
forAll(fluidRegions, i)
|
||||||
@ -200,13 +199,6 @@
|
|||||||
i,
|
i,
|
||||||
new IObasicSourceList(fluidRegions[i])
|
new IObasicSourceList(fluidRegions[i])
|
||||||
);
|
);
|
||||||
|
|
||||||
Info<< " Adding porous zones\n" << endl;
|
|
||||||
porousZonesFluid.set
|
|
||||||
(
|
|
||||||
i,
|
|
||||||
new IOporosityModelList(fluidRegions[i])
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -23,6 +23,8 @@
|
|||||||
|
|
||||||
phiHbyA += phig;
|
phiHbyA += phig;
|
||||||
|
|
||||||
|
sources.relativeFlux(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
dimensionedScalar compressibility = fvc::domainIntegrate(psi);
|
dimensionedScalar compressibility = fvc::domainIntegrate(psi);
|
||||||
bool compressible = (compressibility.value() > SMALL);
|
bool compressible = (compressibility.value() > SMALL);
|
||||||
|
|
||||||
@ -54,6 +56,7 @@
|
|||||||
// 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();
|
||||||
|
sources.correct(U);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -14,8 +14,6 @@
|
|||||||
|
|
||||||
IObasicSourceList& sources = heatSources[i];
|
IObasicSourceList& sources = heatSources[i];
|
||||||
|
|
||||||
const IOporosityModelList& pZones = porousZonesFluid[i];
|
|
||||||
|
|
||||||
const dimensionedScalar initialMass
|
const dimensionedScalar initialMass
|
||||||
(
|
(
|
||||||
"initialMass",
|
"initialMass",
|
||||||
|
|||||||
@ -24,6 +24,8 @@
|
|||||||
+ phig
|
+ phig
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
{
|
{
|
||||||
fvScalarMatrix p_rghDDtEqn
|
fvScalarMatrix p_rghDDtEqn
|
||||||
(
|
(
|
||||||
@ -64,6 +66,7 @@
|
|||||||
U = HbyA
|
U = HbyA
|
||||||
+ rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf);
|
+ rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
|
sources.correct(U);
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -10,9 +10,14 @@ if (finalIter)
|
|||||||
(
|
(
|
||||||
fvm::ddt(betav*rho, h)
|
fvm::ddt(betav*rho, h)
|
||||||
- fvm::laplacian(betav*alpha, h, "laplacian(alpha,h)")
|
- fvm::laplacian(betav*alpha, h, "laplacian(alpha,h)")
|
||||||
+ sources(rho, h)
|
==
|
||||||
|
sources(rho, h)
|
||||||
);
|
);
|
||||||
|
|
||||||
hEqn().relax();
|
hEqn().relax();
|
||||||
|
|
||||||
|
sources.constrain(hEqn());
|
||||||
|
|
||||||
hEqn().solve(mesh.solver(h.select(finalIter)));
|
hEqn().solve(mesh.solver(h.select(finalIter)));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -5,7 +5,6 @@ set -x
|
|||||||
wmake
|
wmake
|
||||||
|
|
||||||
wmake SRFSimpleFoam
|
wmake SRFSimpleFoam
|
||||||
wmake MRFSimpleFoam
|
|
||||||
wmake porousSimpleFoam
|
wmake porousSimpleFoam
|
||||||
|
|
||||||
# ----------------------------------------------------------------- end-of-file
|
# ----------------------------------------------------------------- end-of-file
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
rho.dimensionedInternalField()*g
|
rho.dimensionedInternalField()*g
|
||||||
+ coalParcels.SU(U)
|
+ coalParcels.SU(U)
|
||||||
+ limestoneParcels.SU(U)
|
+ limestoneParcels.SU(U)
|
||||||
|
+ sources(rho, U)
|
||||||
);
|
);
|
||||||
|
|
||||||
UEqn.relax();
|
UEqn.relax();
|
||||||
@ -15,6 +16,6 @@
|
|||||||
|
|
||||||
if (pimple.momentumPredictor())
|
if (pimple.momentumPredictor())
|
||||||
{
|
{
|
||||||
solve(UEqn == -fvc::grad(p) + sources(rho, U));
|
solve(UEqn == -fvc::grad(p));
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ rho = thermo.rho();
|
|||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*(UEqn == sources(rho, U))().H();
|
HbyA = rAU*UEqn.H();
|
||||||
|
|
||||||
if (pimple.transonic())
|
if (pimple.transonic())
|
||||||
{
|
{
|
||||||
@ -16,6 +16,8 @@ if (pimple.transonic())
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(fvc::interpolate(psi), phid);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
@ -28,7 +30,7 @@ if (pimple.transonic())
|
|||||||
+ sources(psi, p, rho.name())
|
+ sources(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
sources.constrain(pEqn, rho.name());
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
@ -50,6 +52,8 @@ else
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
@ -62,7 +66,7 @@ else
|
|||||||
+ sources(psi, p, rho.name())
|
+ sources(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
sources.constrain(pEqn, rho.name());
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
|
|||||||
@ -21,9 +21,11 @@
|
|||||||
+ surfaceFilm.Sh()
|
+ surfaceFilm.Sh()
|
||||||
+ radiation->Sh(thermo)
|
+ radiation->Sh(thermo)
|
||||||
+ combustion->Sh()
|
+ combustion->Sh()
|
||||||
|
+ sources(rho, he)
|
||||||
);
|
);
|
||||||
|
|
||||||
EEqn.relax();
|
EEqn.relax();
|
||||||
|
sources.constrain(EEqn);
|
||||||
EEqn.solve();
|
EEqn.solve();
|
||||||
|
|
||||||
thermo.correct();
|
thermo.correct();
|
||||||
|
|||||||
@ -1,5 +1,7 @@
|
|||||||
EXE_INC = \
|
EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
|
-I$(LIB_SRC)/fieldSources/lnInclude \
|
||||||
|
-I${LIB_SRC}/sampling/lnInclude \
|
||||||
-I${LIB_SRC}/meshTools/lnInclude \
|
-I${LIB_SRC}/meshTools/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
|
||||||
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
-I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \
|
||||||
@ -25,6 +27,8 @@ EXE_INC = \
|
|||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
-lfieldSources \
|
||||||
|
-lsampling \
|
||||||
-lmeshTools \
|
-lmeshTools \
|
||||||
-lcompressibleRASModels \
|
-lcompressibleRASModels \
|
||||||
-lcompressibleLESModels \
|
-lcompressibleLESModels \
|
||||||
|
|||||||
@ -5,10 +5,13 @@
|
|||||||
+ turbulence->divDevRhoReff(U)
|
+ turbulence->divDevRhoReff(U)
|
||||||
==
|
==
|
||||||
parcels.SU(U)
|
parcels.SU(U)
|
||||||
|
+ sources(rho, U)
|
||||||
);
|
);
|
||||||
|
|
||||||
UEqn.relax();
|
UEqn.relax();
|
||||||
|
|
||||||
|
sources.constrain(UEqn);
|
||||||
|
|
||||||
if (pimple.momentumPredictor())
|
if (pimple.momentumPredictor())
|
||||||
{
|
{
|
||||||
solve
|
solve
|
||||||
|
|||||||
@ -22,18 +22,24 @@ tmp<fv::convectionScheme<scalar> > mvConvection
|
|||||||
{
|
{
|
||||||
volScalarField& Yi = Y[i];
|
volScalarField& Yi = Y[i];
|
||||||
|
|
||||||
solve
|
fvScalarMatrix YEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(rho, Yi)
|
fvm::ddt(rho, Yi)
|
||||||
+ mvConvection->fvmDiv(phi, Yi)
|
+ mvConvection->fvmDiv(phi, Yi)
|
||||||
- fvm::laplacian(turbulence->alphaEff(), Yi)
|
- fvm::laplacian(turbulence->alphaEff(), Yi)
|
||||||
==
|
==
|
||||||
parcels.SYi(i, Yi)
|
parcels.SYi(i, Yi)
|
||||||
|
+ sources(rho, Yi)
|
||||||
|
+ combustion->R(Yi)
|
||||||
+ surfaceFilm.Srho(i)
|
+ surfaceFilm.Srho(i)
|
||||||
+ combustion->R(Yi),
|
|
||||||
mesh.solver("Yi")
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
YEqn.relax();
|
||||||
|
|
||||||
|
sources.constrain(YEqn);
|
||||||
|
|
||||||
|
YEqn.solve(mesh.solver("Yi"));
|
||||||
|
|
||||||
Yi.max(0.0);
|
Yi.max(0.0);
|
||||||
Yt += Yi;
|
Yt += Yi;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -139,3 +139,5 @@
|
|||||||
mesh,
|
mesh,
|
||||||
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
|
dimensionedScalar("dQ", dimEnergy/dimTime, 0.0)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
IObasicSourceList sources(mesh);
|
||||||
|
|||||||
@ -18,6 +18,7 @@ surfaceScalarField phiHbyA
|
|||||||
+ phig
|
+ phig
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
@ -30,8 +31,11 @@ while (pimple.correctNonOrthogonal())
|
|||||||
==
|
==
|
||||||
parcels.Srho()
|
parcels.Srho()
|
||||||
+ surfaceFilm.Srho()
|
+ surfaceFilm.Srho()
|
||||||
|
+ sources(psi, p_rgh, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.constrain(p_rghEqn);
|
||||||
|
|
||||||
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
|
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
@ -39,6 +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();
|
||||||
|
sources.correct(U);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -37,6 +37,7 @@ Description
|
|||||||
#include "psiCombustionModel.H"
|
#include "psiCombustionModel.H"
|
||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
#include "SLGThermo.H"
|
#include "SLGThermo.H"
|
||||||
|
#include "IObasicSourceList.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -37,6 +37,7 @@ Description
|
|||||||
==
|
==
|
||||||
parcels.Srho(rho)
|
parcels.Srho(rho)
|
||||||
+ surfaceFilm.Srho()
|
+ surfaceFilm.Srho()
|
||||||
|
+ sources(rho)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -7,6 +7,7 @@
|
|||||||
==
|
==
|
||||||
rho.dimensionedInternalField()*g
|
rho.dimensionedInternalField()*g
|
||||||
+ parcels.SU(U)
|
+ parcels.SU(U)
|
||||||
|
+ sources(rho, U)
|
||||||
);
|
);
|
||||||
|
|
||||||
UEqn.relax();
|
UEqn.relax();
|
||||||
@ -17,6 +18,6 @@
|
|||||||
|
|
||||||
if (pimple.momentumPredictor())
|
if (pimple.momentumPredictor())
|
||||||
{
|
{
|
||||||
solve(UEqn == -fvc::grad(p) + sources(rho, U));
|
solve(UEqn == -fvc::grad(p));
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -7,17 +7,19 @@
|
|||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*(UEqn == sources(rho, U))().H();
|
HbyA = rAU*UEqn.H();
|
||||||
|
|
||||||
surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(HbyA) & mesh.Sf());
|
surfaceScalarField phiHbyA
|
||||||
if (!pZones.active())
|
(
|
||||||
{
|
"phiHbyA",
|
||||||
// ddtPhiCorr only used without porosity
|
fvc::interpolate(rho)
|
||||||
phiHbyA += fvc::ddtPhiCorr(rAU, rho, U, phi);
|
*(
|
||||||
}
|
(fvc::interpolate(HbyA) & mesh.Sf())
|
||||||
|
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
||||||
phiHbyA *= fvc::interpolate(rho);
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
fvScalarMatrix pDDtEqn
|
fvScalarMatrix pDDtEqn
|
||||||
(
|
(
|
||||||
@ -36,7 +38,7 @@
|
|||||||
- fvm::laplacian(rho*rAU, p)
|
- fvm::laplacian(rho*rAU, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
sources.constrain(pDDtEqn, rho.name());
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
|
|||||||
@ -6,6 +6,7 @@
|
|||||||
==
|
==
|
||||||
rho.dimensionedInternalField()*g
|
rho.dimensionedInternalField()*g
|
||||||
+ parcels.SU(U)
|
+ parcels.SU(U)
|
||||||
|
+ sources(rho, U)
|
||||||
);
|
);
|
||||||
|
|
||||||
UEqn.relax();
|
UEqn.relax();
|
||||||
@ -14,6 +15,6 @@
|
|||||||
|
|
||||||
if (pimple.momentumPredictor())
|
if (pimple.momentumPredictor())
|
||||||
{
|
{
|
||||||
solve(UEqn == -fvc::grad(p) + sources(rho, U));
|
solve(UEqn == -fvc::grad(p));
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,7 @@ rho = thermo.rho();
|
|||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*(UEqn == sources(rho, U))().H();
|
HbyA = rAU*UEqn.H();
|
||||||
|
|
||||||
if (pimple.transonic())
|
if (pimple.transonic())
|
||||||
{
|
{
|
||||||
@ -16,6 +16,8 @@ if (pimple.transonic())
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(fvc::interpolate(psi), phid);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
@ -28,6 +30,8 @@ if (pimple.transonic())
|
|||||||
+ sources(psi, p, rho.name())
|
+ sources(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
@ -48,6 +52,8 @@ else
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(fvc::interpolate(psi), phiHbyA);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
@ -60,6 +66,8 @@ else
|
|||||||
+ sources(psi, p, rho.name())
|
+ sources(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
|
|||||||
@ -2,7 +2,7 @@ rho = thermo.rho();
|
|||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
volVectorField HbyA("HbyA", U);
|
volVectorField HbyA("HbyA", U);
|
||||||
HbyA = rAU*(UEqn == sources(rho, U))().H();
|
HbyA = rAU*UEqn.H();
|
||||||
|
|
||||||
if (pimple.transonic())
|
if (pimple.transonic())
|
||||||
{
|
{
|
||||||
@ -16,6 +16,8 @@ if (pimple.transonic())
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(fvc::interpolate(psi), phid);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
@ -28,6 +30,8 @@ if (pimple.transonic())
|
|||||||
+ sources(psi, p, rho.name())
|
+ sources(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
@ -48,6 +52,8 @@ else
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.relativeFlux(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
@ -60,6 +66,8 @@ else
|
|||||||
+ sources(psi, p, rho.name())
|
+ sources(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
sources.constrain(pEqn);
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
|
|||||||
@ -56,7 +56,7 @@ Foam::porosityModels::DarcyForchheimer::DarcyForchheimer
|
|||||||
D_("D", dimless/sqr(dimLength), tensor::zero),
|
D_("D", dimless/sqr(dimLength), tensor::zero),
|
||||||
F_("F", dimless/dimLength, tensor::zero),
|
F_("F", dimless/dimLength, tensor::zero),
|
||||||
rhoName_(coeffs_.lookupOrDefault<word>("rho", "rho")),
|
rhoName_(coeffs_.lookupOrDefault<word>("rho", "rho")),
|
||||||
muName_(coeffs_.lookupOrDefault<word>("mu", "mu")),
|
muName_(coeffs_.lookupOrDefault<word>("mu", "thermo:mu")),
|
||||||
nuName_(coeffs_.lookupOrDefault<word>("nu", "nu"))
|
nuName_(coeffs_.lookupOrDefault<word>("nu", "nu"))
|
||||||
{
|
{
|
||||||
// local-to-global transformation tensor
|
// local-to-global transformation tensor
|
||||||
|
|||||||
@ -87,7 +87,7 @@ Foam::porosityModel::porosityModel
|
|||||||
{
|
{
|
||||||
if (zoneName_ == word::null)
|
if (zoneName_ == word::null)
|
||||||
{
|
{
|
||||||
dict.lookup("actuve") >> active_;
|
dict.lookup("active") >> active_;
|
||||||
dict_.lookup("cellZone") >> zoneName_;
|
dict_.lookup("cellZone") >> zoneName_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -38,6 +38,9 @@ supersonicFreestreamFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchVectorField(p, iF),
|
mixedFvPatchVectorField(p, iF),
|
||||||
|
TName_("T"),
|
||||||
|
pName_("p"),
|
||||||
|
psiName_("thermo:psi"),
|
||||||
UInf_(vector::zero),
|
UInf_(vector::zero),
|
||||||
pInf_(0),
|
pInf_(0),
|
||||||
TInf_(0),
|
TInf_(0),
|
||||||
@ -59,6 +62,9 @@ supersonicFreestreamFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchVectorField(ptf, p, iF, mapper),
|
mixedFvPatchVectorField(ptf, p, iF, mapper),
|
||||||
|
TName_(ptf.TName_),
|
||||||
|
pName_(ptf.pName_),
|
||||||
|
psiName_(ptf.psiName_),
|
||||||
UInf_(ptf.UInf_),
|
UInf_(ptf.UInf_),
|
||||||
pInf_(ptf.pInf_),
|
pInf_(ptf.pInf_),
|
||||||
TInf_(ptf.TInf_),
|
TInf_(ptf.TInf_),
|
||||||
@ -75,6 +81,9 @@ supersonicFreestreamFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchVectorField(p, iF),
|
mixedFvPatchVectorField(p, iF),
|
||||||
|
TName_(dict.lookupOrDefault<word>("T", "T")),
|
||||||
|
pName_(dict.lookupOrDefault<word>("p", "p")),
|
||||||
|
psiName_(dict.lookupOrDefault<word>("psi", "thermo:psi")),
|
||||||
UInf_(dict.lookup("UInf")),
|
UInf_(dict.lookup("UInf")),
|
||||||
pInf_(readScalar(dict.lookup("pInf"))),
|
pInf_(readScalar(dict.lookup("pInf"))),
|
||||||
TInf_(readScalar(dict.lookup("TInf"))),
|
TInf_(readScalar(dict.lookup("TInf"))),
|
||||||
@ -120,6 +129,9 @@ supersonicFreestreamFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchVectorField(sfspvf),
|
mixedFvPatchVectorField(sfspvf),
|
||||||
|
TName_(sfspvf.TName_),
|
||||||
|
pName_(sfspvf.pName_),
|
||||||
|
psiName_(sfspvf.psiName_),
|
||||||
UInf_(sfspvf.UInf_),
|
UInf_(sfspvf.UInf_),
|
||||||
pInf_(sfspvf.pInf_),
|
pInf_(sfspvf.pInf_),
|
||||||
TInf_(sfspvf.TInf_),
|
TInf_(sfspvf.TInf_),
|
||||||
@ -135,6 +147,9 @@ supersonicFreestreamFvPatchVectorField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFvPatchVectorField(sfspvf, iF),
|
mixedFvPatchVectorField(sfspvf, iF),
|
||||||
|
TName_(sfspvf.TName_),
|
||||||
|
pName_(sfspvf.pName_),
|
||||||
|
psiName_(sfspvf.psiName_),
|
||||||
UInf_(sfspvf.UInf_),
|
UInf_(sfspvf.UInf_),
|
||||||
pInf_(sfspvf.pInf_),
|
pInf_(sfspvf.pInf_),
|
||||||
TInf_(sfspvf.TInf_),
|
TInf_(sfspvf.TInf_),
|
||||||
@ -152,13 +167,13 @@ void Foam::supersonicFreestreamFvPatchVectorField::updateCoeffs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
const fvPatchField<scalar>& pT =
|
const fvPatchField<scalar>& pT =
|
||||||
patch().lookupPatchField<volScalarField, scalar>("T");
|
patch().lookupPatchField<volScalarField, scalar>(TName_);
|
||||||
|
|
||||||
const fvPatchField<scalar>& pp =
|
const fvPatchField<scalar>& pp =
|
||||||
patch().lookupPatchField<volScalarField, scalar>("p");
|
patch().lookupPatchField<volScalarField, scalar>(pName_);
|
||||||
|
|
||||||
const fvPatchField<scalar>& ppsi =
|
const fvPatchField<scalar>& ppsi =
|
||||||
patch().lookupPatchField<volScalarField, scalar>("psi");
|
patch().lookupPatchField<volScalarField, scalar>(psiName_);
|
||||||
|
|
||||||
// Need R of the free-stream flow. Assume R is independent of location
|
// Need R of the free-stream flow. Assume R is independent of location
|
||||||
// along patch so use face 0
|
// along patch so use face 0
|
||||||
@ -288,6 +303,9 @@ void Foam::supersonicFreestreamFvPatchVectorField::updateCoeffs()
|
|||||||
void Foam::supersonicFreestreamFvPatchVectorField::write(Ostream& os) const
|
void Foam::supersonicFreestreamFvPatchVectorField::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
fvPatchVectorField::write(os);
|
fvPatchVectorField::write(os);
|
||||||
|
writeEntryIfDifferent<word>(os, "T", "T", TName_);
|
||||||
|
writeEntryIfDifferent<word>(os, "p", "p", pName_);
|
||||||
|
writeEntryIfDifferent<word>(os, "psi", "thermo:psi", psiName_);
|
||||||
os.writeKeyword("UInf") << UInf_ << token::END_STATEMENT << nl;
|
os.writeKeyword("UInf") << UInf_ << token::END_STATEMENT << nl;
|
||||||
os.writeKeyword("pInf") << pInf_ << token::END_STATEMENT << nl;
|
os.writeKeyword("pInf") << pInf_ << token::END_STATEMENT << nl;
|
||||||
os.writeKeyword("TInf") << TInf_ << token::END_STATEMENT << nl;
|
os.writeKeyword("TInf") << TInf_ << token::END_STATEMENT << nl;
|
||||||
|
|||||||
@ -40,6 +40,9 @@ Description
|
|||||||
|
|
||||||
\table
|
\table
|
||||||
Property | Description | Required | Default value
|
Property | Description | Required | Default value
|
||||||
|
TName | Temperature field name | no | T
|
||||||
|
pName | Pressure field name | no | p
|
||||||
|
psiName | Compressibility field name | no | thermo:psi
|
||||||
UInf | free-stream velocity | yes |
|
UInf | free-stream velocity | yes |
|
||||||
pInf | free-stream pressure | yes |
|
pInf | free-stream pressure | yes |
|
||||||
TInf | free-stream temperature | yes |
|
TInf | free-stream temperature | yes |
|
||||||
@ -88,6 +91,15 @@ class supersonicFreestreamFvPatchVectorField
|
|||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
//- Name of temperature field, default = "T"
|
||||||
|
word TName_;
|
||||||
|
|
||||||
|
//- Name of pressure field, default = "p"
|
||||||
|
word pName_;
|
||||||
|
|
||||||
|
//- Name of compressibility field field, default = "thermo:psi"
|
||||||
|
word psiName_;
|
||||||
|
|
||||||
//- Velocity of the free stream
|
//- Velocity of the free stream
|
||||||
vector UInf_;
|
vector UInf_;
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,7 @@ Foam::totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
|
|||||||
fixedValueFvPatchScalarField(p, iF),
|
fixedValueFvPatchScalarField(p, iF),
|
||||||
UName_("U"),
|
UName_("U"),
|
||||||
phiName_("phi"),
|
phiName_("phi"),
|
||||||
psiName_("psi"),
|
psiName_("thermo:psi"),
|
||||||
gamma_(0.0),
|
gamma_(0.0),
|
||||||
T0_(p.size(), 0.0)
|
T0_(p.size(), 0.0)
|
||||||
{}
|
{}
|
||||||
@ -73,7 +73,7 @@ Foam::totalTemperatureFvPatchScalarField::totalTemperatureFvPatchScalarField
|
|||||||
fixedValueFvPatchScalarField(p, iF),
|
fixedValueFvPatchScalarField(p, iF),
|
||||||
UName_(dict.lookupOrDefault<word>("U", "U")),
|
UName_(dict.lookupOrDefault<word>("U", "U")),
|
||||||
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
phiName_(dict.lookupOrDefault<word>("phi", "phi")),
|
||||||
psiName_(dict.lookupOrDefault<word>("psi", "psi")),
|
psiName_(dict.lookupOrDefault<word>("psi", "thermo:psi")),
|
||||||
gamma_(readScalar(dict.lookup("gamma"))),
|
gamma_(readScalar(dict.lookup("gamma"))),
|
||||||
T0_("T0", dict, p.size())
|
T0_("T0", dict, p.size())
|
||||||
{
|
{
|
||||||
@ -179,7 +179,7 @@ void Foam::totalTemperatureFvPatchScalarField::write(Ostream& os) const
|
|||||||
fvPatchScalarField::write(os);
|
fvPatchScalarField::write(os);
|
||||||
writeEntryIfDifferent<word>(os, "U", "U", UName_);
|
writeEntryIfDifferent<word>(os, "U", "U", UName_);
|
||||||
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
writeEntryIfDifferent<word>(os, "phi", "phi", phiName_);
|
||||||
writeEntryIfDifferent<word>(os, "psi", "psi", psiName_);
|
writeEntryIfDifferent<word>(os, "psi", "thermo:psi", psiName_);
|
||||||
os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl;
|
os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl;
|
||||||
T0_.writeEntry("T0", os);
|
T0_.writeEntry("T0", os);
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
|
|||||||
@ -2,7 +2,7 @@
|
|||||||
========= |
|
========= |
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -36,7 +36,7 @@ Description
|
|||||||
Property | Description | Required | Default value
|
Property | Description | Required | Default value
|
||||||
U | Velocity field name | no | U
|
U | Velocity field name | no | U
|
||||||
phi | Flux field name | no | phi
|
phi | Flux field name | no | phi
|
||||||
psi | Compressibility field name | no | psi
|
psi | Compressibility field name | no | thermo:psi
|
||||||
gamma | ratio of specific heats (Cp/Cv) | yes |
|
gamma | ratio of specific heats (Cp/Cv) | yes |
|
||||||
T0 | reference temperature | yes |
|
T0 | reference temperature | yes |
|
||||||
\endtable
|
\endtable
|
||||||
|
|||||||
@ -41,7 +41,7 @@ Foam::waveTransmissiveFvPatchField<Type>::waveTransmissiveFvPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
advectiveFvPatchField<Type>(p, iF),
|
advectiveFvPatchField<Type>(p, iF),
|
||||||
psiName_("psi"),
|
psiName_("thermo:psi"),
|
||||||
gamma_(0.0)
|
gamma_(0.0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -70,7 +70,7 @@ Foam::waveTransmissiveFvPatchField<Type>::waveTransmissiveFvPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
advectiveFvPatchField<Type>(p, iF, dict),
|
advectiveFvPatchField<Type>(p, iF, dict),
|
||||||
psiName_(dict.lookupOrDefault<word>("psi", "psi")),
|
psiName_(dict.lookupOrDefault<word>("psi", "thermo:psi")),
|
||||||
gamma_(readScalar(dict.lookup("gamma")))
|
gamma_(readScalar(dict.lookup("gamma")))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -108,27 +108,21 @@ Foam::waveTransmissiveFvPatchField<Type>::advectionSpeed() const
|
|||||||
{
|
{
|
||||||
// Lookup the velocity and compressibility of the patch
|
// Lookup the velocity and compressibility of the patch
|
||||||
const fvPatchField<scalar>& psip =
|
const fvPatchField<scalar>& psip =
|
||||||
this->patch().template lookupPatchField<volScalarField, scalar>
|
this->patch().template
|
||||||
(
|
lookupPatchField<volScalarField, scalar>(psiName_);
|
||||||
psiName_
|
|
||||||
);
|
|
||||||
|
|
||||||
const surfaceScalarField& phi =
|
const surfaceScalarField& phi =
|
||||||
this->db().template lookupObject<surfaceScalarField>(this->phiName_);
|
this->db().template lookupObject<surfaceScalarField>(this->phiName_);
|
||||||
|
|
||||||
fvsPatchField<scalar> phip =
|
fvsPatchField<scalar> phip =
|
||||||
this->patch().template lookupPatchField<surfaceScalarField, scalar>
|
this->patch().template
|
||||||
(
|
lookupPatchField<surfaceScalarField, scalar>(this->phiName_);
|
||||||
this->phiName_
|
|
||||||
);
|
|
||||||
|
|
||||||
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
||||||
{
|
{
|
||||||
const fvPatchScalarField& rhop =
|
const fvPatchScalarField& rhop =
|
||||||
this->patch().template lookupPatchField<volScalarField, scalar>
|
this->patch().template
|
||||||
(
|
lookupPatchField<volScalarField, scalar>(this->rhoName_);
|
||||||
this->rhoName_
|
|
||||||
);
|
|
||||||
|
|
||||||
phip /= rhop;
|
phip /= rhop;
|
||||||
}
|
}
|
||||||
@ -145,18 +139,12 @@ void Foam::waveTransmissiveFvPatchField<Type>::write(Ostream& os) const
|
|||||||
{
|
{
|
||||||
fvPatchField<Type>::write(os);
|
fvPatchField<Type>::write(os);
|
||||||
|
|
||||||
if (this->phiName_ != "phi")
|
this->template
|
||||||
{
|
writeEntryIfDifferent<word>(os, "phi", "phi", this->phiName_);
|
||||||
os.writeKeyword("phi") << this->phiName_ << token::END_STATEMENT << nl;
|
this->template
|
||||||
}
|
writeEntryIfDifferent<word>(os, "rho", "rho", this->rhoName_);
|
||||||
if (this->rhoName_ != "rho")
|
this->template
|
||||||
{
|
writeEntryIfDifferent<word>(os, "psi", "thermo:psi", psiName_);
|
||||||
os.writeKeyword("rho") << this->rhoName_ << token::END_STATEMENT << nl;
|
|
||||||
}
|
|
||||||
if (psiName_ != "psi")
|
|
||||||
{
|
|
||||||
os.writeKeyword("psi") << psiName_ << token::END_STATEMENT << nl;
|
|
||||||
}
|
|
||||||
|
|
||||||
os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl;
|
os.writeKeyword("gamma") << gamma_ << token::END_STATEMENT << nl;
|
||||||
|
|
||||||
|
|||||||
@ -765,7 +765,7 @@ kinematicSingleLayer::kinematicSingleLayer
|
|||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"mu", // must have same name as mu to enable mapping
|
"thermo:mu", // must have same name as mu to enable mapping
|
||||||
time().timeName(),
|
time().timeName(),
|
||||||
regionMesh(),
|
regionMesh(),
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
|
|||||||
@ -52,7 +52,7 @@ Foam::radiation::noRadiation::noRadiation
|
|||||||
const volScalarField& T
|
const volScalarField& T
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
radiationModel(dict, T)
|
radiationModel(T)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -43,6 +43,33 @@ namespace Foam
|
|||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::IOobject Foam::radiation::radiationModel::createIOobject
|
||||||
|
(
|
||||||
|
const fvMesh& mesh
|
||||||
|
) const
|
||||||
|
{
|
||||||
|
IOobject io
|
||||||
|
(
|
||||||
|
"radiationProperties",
|
||||||
|
mesh.time().constant(),
|
||||||
|
mesh,
|
||||||
|
IOobject::MUST_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
);
|
||||||
|
|
||||||
|
if (io.headerOk())
|
||||||
|
{
|
||||||
|
io.readOpt() = IOobject::MUST_READ_IF_MODIFIED;
|
||||||
|
return io;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
io.readOpt() = IOobject::NO_READ;
|
||||||
|
return io;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::radiation::radiationModel::initialise()
|
void Foam::radiation::radiationModel::initialise()
|
||||||
{
|
{
|
||||||
if (radiation_)
|
if (radiation_)
|
||||||
@ -62,35 +89,6 @@ void Foam::radiation::radiationModel::initialise()
|
|||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::radiation::radiationModel::radiationModel(const volScalarField& T)
|
Foam::radiation::radiationModel::radiationModel(const volScalarField& T)
|
||||||
:
|
|
||||||
IOdictionary
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"radiationProperties",
|
|
||||||
T.time().constant(),
|
|
||||||
T.mesh(),
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
)
|
|
||||||
),
|
|
||||||
mesh_(T.mesh()),
|
|
||||||
time_(T.time()),
|
|
||||||
T_(T),
|
|
||||||
radiation_(false),
|
|
||||||
coeffs_(dictionary::null),
|
|
||||||
solverFreq_(0),
|
|
||||||
firstIter_(true),
|
|
||||||
absorptionEmission_(NULL),
|
|
||||||
scatter_(NULL)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
Foam::radiation::radiationModel::radiationModel
|
|
||||||
(
|
|
||||||
const dictionary& dict,
|
|
||||||
const volScalarField& T
|
|
||||||
)
|
|
||||||
:
|
:
|
||||||
IOdictionary
|
IOdictionary
|
||||||
(
|
(
|
||||||
@ -101,8 +99,7 @@ Foam::radiation::radiationModel::radiationModel
|
|||||||
T.mesh(),
|
T.mesh(),
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
)
|
||||||
dict
|
|
||||||
),
|
),
|
||||||
mesh_(T.mesh()),
|
mesh_(T.mesh()),
|
||||||
time_(T.time()),
|
time_(T.time()),
|
||||||
@ -122,17 +119,7 @@ Foam::radiation::radiationModel::radiationModel
|
|||||||
const volScalarField& T
|
const volScalarField& T
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
IOdictionary
|
IOdictionary(createIOobject(T.mesh())),
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"radiationProperties",
|
|
||||||
T.time().constant(),
|
|
||||||
T.mesh(),
|
|
||||||
IOobject::MUST_READ_IF_MODIFIED,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
)
|
|
||||||
),
|
|
||||||
mesh_(T.mesh()),
|
mesh_(T.mesh()),
|
||||||
time_(T.time()),
|
time_(T.time()),
|
||||||
T_(T),
|
T_(T),
|
||||||
@ -143,6 +130,11 @@ Foam::radiation::radiationModel::radiationModel
|
|||||||
absorptionEmission_(NULL),
|
absorptionEmission_(NULL),
|
||||||
scatter_(NULL)
|
scatter_(NULL)
|
||||||
{
|
{
|
||||||
|
if (readOpt() == IOobject::NO_READ)
|
||||||
|
{
|
||||||
|
radiation_ = false;
|
||||||
|
}
|
||||||
|
|
||||||
initialise();
|
initialise();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -109,6 +109,9 @@ private:
|
|||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Create IO object if dictionary is present
|
||||||
|
IOobject createIOobject(const fvMesh& mesh) const;
|
||||||
|
|
||||||
//- Initialise
|
//- Initialise
|
||||||
void initialise();
|
void initialise();
|
||||||
|
|
||||||
@ -156,9 +159,6 @@ public:
|
|||||||
//- Null constructor
|
//- Null constructor
|
||||||
radiationModel(const volScalarField& T);
|
radiationModel(const volScalarField& T);
|
||||||
|
|
||||||
//- Construct with dictionary
|
|
||||||
radiationModel(const dictionary& dict, const volScalarField& T);
|
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from components
|
||||||
radiationModel(const word& type, const volScalarField& T);
|
radiationModel(const word& type, const volScalarField& T);
|
||||||
|
|
||||||
|
|||||||
@ -33,12 +33,7 @@ Foam::radiation::radiationModel::New
|
|||||||
const volScalarField& T
|
const volScalarField& T
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
// get model name, but do not register the dictionary
|
IOobject radIO
|
||||||
const word modelType
|
|
||||||
(
|
|
||||||
IOdictionary
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
(
|
||||||
"radiationProperties",
|
"radiationProperties",
|
||||||
T.time().constant(),
|
T.time().constant(),
|
||||||
@ -46,10 +41,19 @@ Foam::radiation::radiationModel::New
|
|||||||
IOobject::MUST_READ_IF_MODIFIED,
|
IOobject::MUST_READ_IF_MODIFIED,
|
||||||
IOobject::NO_WRITE,
|
IOobject::NO_WRITE,
|
||||||
false
|
false
|
||||||
)
|
|
||||||
).lookup("radiationModel")
|
|
||||||
);
|
);
|
||||||
|
|
||||||
|
word modelType("none");
|
||||||
|
if (radIO.headerOk())
|
||||||
|
{
|
||||||
|
IOdictionary(radIO).lookup("radiationModel") >> modelType;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
Info<< "Radiation model not active: radiationProperties not found"
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
|
||||||
Info<< "Selecting radiationModel " << modelType << endl;
|
Info<< "Selecting radiationModel " << modelType << endl;
|
||||||
|
|
||||||
TConstructorTable::iterator cstrIter =
|
TConstructorTable::iterator cstrIter =
|
||||||
|
|||||||
@ -50,7 +50,7 @@ laplacianSchemes
|
|||||||
default Gauss linear corrected;
|
default Gauss linear corrected;
|
||||||
laplacian(muEff,U) Gauss linear corrected;
|
laplacian(muEff,U) Gauss linear corrected;
|
||||||
laplacian(DkEff,k) Gauss linear corrected;
|
laplacian(DkEff,k) Gauss linear corrected;
|
||||||
laplacian(alphaEff,h) Gauss linear corrected;
|
laplacian(thermo:alpha,h) Gauss linear corrected;
|
||||||
laplacian((((rho*(1|A(U)))*rho)*gh)) Gauss linear corrected;
|
laplacian((((rho*(1|A(U)))*rho)*gh)) Gauss linear corrected;
|
||||||
laplacian(interpolate((rho*(1|A(U)))),p) Gauss linear corrected;
|
laplacian(interpolate((rho*(1|A(U)))),p) Gauss linear corrected;
|
||||||
laplacian(gammaRad,G) Gauss linear corrected;
|
laplacian(gammaRad,G) Gauss linear corrected;
|
||||||
|
|||||||
@ -32,7 +32,7 @@ divSchemes
|
|||||||
laplacianSchemes
|
laplacianSchemes
|
||||||
{
|
{
|
||||||
default none;
|
default none;
|
||||||
laplacian(alpha,h) Gauss linear uncorrected;
|
laplacian(thermo:alpha,h) Gauss linear uncorrected;
|
||||||
}
|
}
|
||||||
|
|
||||||
interpolationSchemes
|
interpolationSchemes
|
||||||
|
|||||||
@ -39,7 +39,7 @@ boundaryField
|
|||||||
U U;
|
U U;
|
||||||
phi phi;
|
phi phi;
|
||||||
rho none;
|
rho none;
|
||||||
psi psi;
|
psi thermo:psi;
|
||||||
gamma 1.4;
|
gamma 1.4;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -1243,7 +1243,7 @@ boundaryField
|
|||||||
type totalTemperature;
|
type totalTemperature;
|
||||||
U U;
|
U U;
|
||||||
phi phi;
|
phi phi;
|
||||||
psi psi;
|
psi thermo:psi;
|
||||||
gamma 1.4;
|
gamma 1.4;
|
||||||
T0 uniform 297;
|
T0 uniform 297;
|
||||||
value nonuniform List<scalar>
|
value nonuniform List<scalar>
|
||||||
|
|||||||
@ -1235,7 +1235,7 @@ boundaryField
|
|||||||
field p;
|
field p;
|
||||||
phi phi;
|
phi phi;
|
||||||
rho rho;
|
rho rho;
|
||||||
psi psi;
|
psi thermo:psi;
|
||||||
gamma 1.4;
|
gamma 1.4;
|
||||||
fieldInf 101325;
|
fieldInf 101325;
|
||||||
lInf 0.025;
|
lInf 0.025;
|
||||||
@ -1275,7 +1275,7 @@ boundaryField
|
|||||||
U U;
|
U U;
|
||||||
phi phi;
|
phi phi;
|
||||||
rho none;
|
rho none;
|
||||||
psi psi;
|
psi thermo:psi;
|
||||||
gamma 1.4;
|
gamma 1.4;
|
||||||
p0 uniform 101325;
|
p0 uniform 101325;
|
||||||
value nonuniform List<scalar>
|
value nonuniform List<scalar>
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user