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:
19
applications/solvers/compressible/rhoSimpleFoam/EEqn.H
Normal file
19
applications/solvers/compressible/rhoSimpleFoam/EEqn.H
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
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)
|
||||
);
|
||||
|
||||
EEqn.relax();
|
||||
EEqn.solve();
|
||||
|
||||
thermo.correct();
|
||||
}
|
||||
@ -5,6 +5,7 @@
|
||||
psiThermo::New(mesh)
|
||||
);
|
||||
psiThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
@ -20,7 +21,6 @@
|
||||
);
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
volScalarField& e = thermo.he();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
|
||||
Info<< "Reading field U\n" << endl;
|
||||
|
||||
@ -1,18 +0,0 @@
|
||||
{
|
||||
// Kinetic + pressure energy
|
||||
volScalarField Ekp("Ekp", 0.5*magSqr(U) + p/rho);
|
||||
|
||||
fvScalarMatrix eEqn
|
||||
(
|
||||
fvm::div(phi, e)
|
||||
- fvm::Sp(fvc::div(phi), e)
|
||||
- fvm::laplacian(turbulence->alphaEff(), e)
|
||||
==
|
||||
fvc::div(phi)*Ekp - fvc::div(phi, Ekp)
|
||||
);
|
||||
|
||||
eEqn.relax();
|
||||
eEqn.solve();
|
||||
|
||||
thermo.correct();
|
||||
}
|
||||
@ -0,0 +1,21 @@
|
||||
{
|
||||
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)
|
||||
);
|
||||
|
||||
pZones.addEnergySource(thermo, rho, EEqn);
|
||||
|
||||
EEqn.relax();
|
||||
EEqn.solve();
|
||||
|
||||
thermo.correct();
|
||||
}
|
||||
@ -5,6 +5,7 @@
|
||||
rhoThermo::New(mesh)
|
||||
);
|
||||
rhoThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
@ -20,7 +21,6 @@
|
||||
);
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
volScalarField& e = thermo.he();
|
||||
|
||||
Info<< "Reading field U\n" << endl;
|
||||
volVectorField U
|
||||
|
||||
@ -1,20 +0,0 @@
|
||||
{
|
||||
// Kinetic + pressure energy
|
||||
volScalarField Ekp("Ekp", 0.5*magSqr(U) + p/rho);
|
||||
|
||||
fvScalarMatrix eEqn
|
||||
(
|
||||
fvm::div(phi, e)
|
||||
- fvm::Sp(fvc::div(phi), e)
|
||||
- fvm::laplacian(turbulence->alphaEff(), e)
|
||||
==
|
||||
fvc::div(phi)*Ekp - fvc::div(phi, Ekp)
|
||||
);
|
||||
|
||||
pZones.addEnergySource(thermo, rho, eEqn);
|
||||
|
||||
eEqn.relax();
|
||||
eEqn.solve();
|
||||
|
||||
thermo.correct();
|
||||
}
|
||||
@ -63,7 +63,7 @@ int main(int argc, char *argv[])
|
||||
// Pressure-velocity SIMPLE corrector
|
||||
{
|
||||
#include "UEqn.H"
|
||||
#include "eEqn.H"
|
||||
#include "EEqn.H"
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
|
||||
@ -59,7 +59,7 @@ int main(int argc, char *argv[])
|
||||
// Pressure-velocity SIMPLE corrector
|
||||
{
|
||||
#include "UEqn.H"
|
||||
#include "eEqn.H"
|
||||
#include "EEqn.H"
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
|
||||
@ -61,7 +61,7 @@ int main(int argc, char *argv[])
|
||||
// Velocity-pressure-enthalpy SIMPLEC corrector
|
||||
{
|
||||
#include "UEqn.H"
|
||||
#include "eEqn.H"
|
||||
#include "EEqn.H"
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
|
||||
10
applications/solvers/compressible/sonicFoam/EEqn.H
Normal file
10
applications/solvers/compressible/sonicFoam/EEqn.H
Normal file
@ -0,0 +1,10 @@
|
||||
{
|
||||
solve
|
||||
(
|
||||
fvm::ddt(rho, e) + fvm::div(phi, e)
|
||||
+ fvc::ddt(rho, K) + fvc::div(phi, volScalarField("Ekp", K + p/rho))
|
||||
- fvm::laplacian(turbulence->alphaEff(), e)
|
||||
);
|
||||
|
||||
thermo.correct();
|
||||
}
|
||||
@ -5,6 +5,7 @@
|
||||
psiThermo::New(mesh)
|
||||
);
|
||||
psiThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "e");
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
volScalarField& e = thermo.he();
|
||||
|
||||
@ -1,12 +0,0 @@
|
||||
{
|
||||
solve
|
||||
(
|
||||
fvm::ddt(rho, e)
|
||||
+ fvm::div(phi, e)
|
||||
- fvm::laplacian(turbulence->alphaEff(), e)
|
||||
==
|
||||
- (fvc::ddt(rho, K) + fvc::div(phi, volScalarField("Ekp", K + p/rho)))
|
||||
);
|
||||
|
||||
thermo.correct();
|
||||
}
|
||||
@ -17,7 +17,8 @@ surfaceScalarField phid
|
||||
|
||||
volScalarField Dp("Dp", rho*rAU);
|
||||
|
||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
// Non-orthogonal pressure corrector loop
|
||||
while (pimple.correctNonOrthogonal())
|
||||
{
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
@ -28,7 +29,7 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||
|
||||
pEqn.solve();
|
||||
|
||||
if (nonOrth == nNonOrthCorr)
|
||||
if (pimple.finalNonOrthogonalIter())
|
||||
{
|
||||
phi = pEqn.flux();
|
||||
}
|
||||
|
||||
@ -0,0 +1,11 @@
|
||||
{
|
||||
solve
|
||||
(
|
||||
fvm::ddt(rho, e) + fvm::div(phi, e)
|
||||
+ fvc::ddt(rho, K) + fvc::div(phi, K)
|
||||
+ fvc::div(phi/fvc::interpolate(rho) + mesh.phi(), p, "div(phiv,p)")
|
||||
- fvm::laplacian(turbulence->alphaEff(), e)
|
||||
);
|
||||
|
||||
thermo.correct();
|
||||
}
|
||||
@ -1,12 +0,0 @@
|
||||
{
|
||||
solve
|
||||
(
|
||||
fvm::ddt(rho, e)
|
||||
+ fvm::div(phi, e)
|
||||
- fvm::laplacian(turbulence->alphaEff(), e)
|
||||
==
|
||||
- p*fvc::div(phi/fvc::interpolate(rho) + mesh.phi())
|
||||
);
|
||||
|
||||
thermo.correct();
|
||||
}
|
||||
@ -34,6 +34,7 @@ Description
|
||||
#include "psiThermo.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "motionSolver.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -45,6 +46,8 @@ int main(int argc, char *argv[])
|
||||
#include "createFields.H"
|
||||
#include "initContinuityErrs.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
@ -62,19 +65,23 @@ int main(int argc, char *argv[])
|
||||
|
||||
#include "rhoEqn.H"
|
||||
|
||||
#include "UEqn.H"
|
||||
|
||||
#include "eEqn.H"
|
||||
|
||||
|
||||
// --- PISO loop
|
||||
|
||||
for (int corr=0; corr<nCorr; corr++)
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
#include "UEqn.H"
|
||||
#include "EEqn.H"
|
||||
|
||||
turbulence->correct();
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
if (pimple.turbCorr())
|
||||
{
|
||||
turbulence->correct();
|
||||
}
|
||||
}
|
||||
|
||||
rho = thermo.rho();
|
||||
|
||||
|
||||
@ -33,6 +33,7 @@ Description
|
||||
#include "fvCFD.H"
|
||||
#include "psiThermo.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -44,6 +45,8 @@ int main(int argc, char *argv[])
|
||||
#include "createFields.H"
|
||||
#include "initContinuityErrs.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
@ -52,20 +55,28 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
#include "readPISOControls.H"
|
||||
#include "readTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
|
||||
#include "rhoEqn.H"
|
||||
#include "UEqn.H"
|
||||
|
||||
// --- PISO loop
|
||||
for (int corr=0; corr<nCorr; corr++)
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
#include "eEqn.H"
|
||||
#include "pEqn.H"
|
||||
}
|
||||
#include "UEqn.H"
|
||||
#include "EEqn.H"
|
||||
|
||||
turbulence->correct();
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
{
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
if (pimple.turbCorr())
|
||||
{
|
||||
turbulence->correct();
|
||||
}
|
||||
}
|
||||
|
||||
rho = thermo.rho();
|
||||
|
||||
|
||||
@ -31,6 +31,7 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "pimpleControl.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -44,6 +45,8 @@ int main(int argc, char *argv[])
|
||||
#include "createFields.H"
|
||||
#include "initContinuityErrs.H"
|
||||
|
||||
pimpleControl pimple(mesh);
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Info<< "\nStarting time loop\n" << endl;
|
||||
@ -52,57 +55,59 @@ int main(int argc, char *argv[])
|
||||
{
|
||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||
|
||||
#include "readPISOControls.H"
|
||||
#include "readTimeControls.H"
|
||||
#include "compressibleCourantNo.H"
|
||||
|
||||
#include "rhoEqn.H"
|
||||
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
fvm::ddt(rho, U)
|
||||
+ fvm::div(phi, U)
|
||||
- fvm::laplacian(mu, U)
|
||||
);
|
||||
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
|
||||
|
||||
// --- PISO loop
|
||||
|
||||
for (int corr=0; corr<nCorr; corr++)
|
||||
// --- Pressure-velocity PIMPLE corrector loop
|
||||
while (pimple.loop())
|
||||
{
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
U = rAU*UEqn.H();
|
||||
|
||||
surfaceScalarField phid
|
||||
fvVectorMatrix UEqn
|
||||
(
|
||||
"phid",
|
||||
psi
|
||||
*(
|
||||
(fvc::interpolate(U) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
||||
)
|
||||
fvm::ddt(rho, U)
|
||||
+ fvm::div(phi, U)
|
||||
- fvm::laplacian(mu, U)
|
||||
);
|
||||
|
||||
phi = (rhoO/psi)*phid;
|
||||
volScalarField Dp("Dp", rho*rAU);
|
||||
solve(UEqn == -fvc::grad(p));
|
||||
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::ddt(psi, p)
|
||||
+ fvc::div(phi)
|
||||
+ fvm::div(phid, p)
|
||||
- fvm::laplacian(Dp, p)
|
||||
);
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
{
|
||||
volScalarField rAU(1.0/UEqn.A());
|
||||
U = rAU*UEqn.H();
|
||||
|
||||
pEqn.solve();
|
||||
surfaceScalarField phid
|
||||
(
|
||||
"phid",
|
||||
psi
|
||||
*(
|
||||
(fvc::interpolate(U) & mesh.Sf())
|
||||
+ fvc::ddtPhiCorr(rAU, rho, U, phi)
|
||||
)
|
||||
);
|
||||
|
||||
phi += pEqn.flux();
|
||||
phi = (rhoO/psi)*phid;
|
||||
volScalarField Dp("Dp", rho*rAU);
|
||||
|
||||
#include "compressibleContinuityErrs.H"
|
||||
fvScalarMatrix pEqn
|
||||
(
|
||||
fvm::ddt(psi, p)
|
||||
+ fvc::div(phi)
|
||||
+ fvm::div(phid, p)
|
||||
- fvm::laplacian(Dp, p)
|
||||
);
|
||||
|
||||
U -= rAU*fvc::grad(p);
|
||||
U.correctBoundaryConditions();
|
||||
pEqn.solve();
|
||||
|
||||
phi += pEqn.flux();
|
||||
|
||||
#include "compressibleContinuityErrs.H"
|
||||
|
||||
U -= rAU*fvc::grad(p);
|
||||
U.correctBoundaryConditions();
|
||||
}
|
||||
}
|
||||
|
||||
rho = rhoO + psi*p;
|
||||
|
||||
20
applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H
Normal file
20
applications/solvers/heatTransfer/buoyantPimpleFoam/EEqn.H
Normal file
@ -0,0 +1,20 @@
|
||||
{
|
||||
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(phi, volScalarField("Ep", p/rho))
|
||||
: -dpdt
|
||||
)
|
||||
- fvm::laplacian(turbulence->alphaEff(), he)
|
||||
);
|
||||
|
||||
EEqn.relax();
|
||||
EEqn.solve();
|
||||
|
||||
thermo.correct();
|
||||
}
|
||||
@ -75,7 +75,7 @@ int main(int argc, char *argv[])
|
||||
while (pimple.loop())
|
||||
{
|
||||
#include "UEqn.H"
|
||||
#include "hEqn.H"
|
||||
#include "EEqn.H"
|
||||
|
||||
// --- Pressure corrector loop
|
||||
while (pimple.correct())
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
rhoThermo::New(mesh)
|
||||
);
|
||||
rhoThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
@ -20,7 +21,6 @@
|
||||
);
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
volScalarField& h = thermo.he();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
|
||||
|
||||
|
||||
@ -1,16 +0,0 @@
|
||||
{
|
||||
fvScalarMatrix hEqn
|
||||
(
|
||||
fvm::ddt(rho, h)
|
||||
+ fvm::div(phi, h)
|
||||
- fvm::laplacian(turbulence->alphaEff(), h)
|
||||
==
|
||||
dpdt
|
||||
- (fvc::ddt(rho, K) + fvc::div(phi, K))
|
||||
);
|
||||
|
||||
hEqn.relax();
|
||||
hEqn.solve();
|
||||
|
||||
thermo.correct();
|
||||
}
|
||||
8
applications/solvers/heatTransfer/buoyantSimpleFoam/Allwmake
Executable file
8
applications/solvers/heatTransfer/buoyantSimpleFoam/Allwmake
Executable file
@ -0,0 +1,8 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # run from this directory
|
||||
set -x
|
||||
|
||||
wmake
|
||||
wmake buoyantSimpleRadiationFoam
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
19
applications/solvers/heatTransfer/buoyantSimpleFoam/EEqn.H
Normal file
19
applications/solvers/heatTransfer/buoyantSimpleFoam/EEqn.H
Normal file
@ -0,0 +1,19 @@
|
||||
{
|
||||
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)
|
||||
);
|
||||
|
||||
EEqn.relax();
|
||||
EEqn.solve();
|
||||
|
||||
thermo.correct();
|
||||
}
|
||||
@ -59,7 +59,7 @@ int main(int argc, char *argv[])
|
||||
// Pressure-velocity SIMPLE corrector
|
||||
{
|
||||
#include "UEqn.H"
|
||||
#include "hEqn.H"
|
||||
#include "EEqn.H"
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
|
||||
@ -0,0 +1,22 @@
|
||||
{
|
||||
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,4 +1,3 @@
|
||||
buoyantSimpleRadiationFoam.C
|
||||
|
||||
EXE = $(FOAM_APPBIN)/buoyantSimpleRadiationFoam
|
||||
|
||||
@ -1,5 +1,5 @@
|
||||
EXE_INC = \
|
||||
-I../buoyantSimpleFoam \
|
||||
-I.. \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/radiationModels/lnInclude \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
@ -62,7 +62,7 @@ int main(int argc, char *argv[])
|
||||
// Pressure-velocity SIMPLE corrector
|
||||
{
|
||||
#include "UEqn.H"
|
||||
#include "hEqn.H"
|
||||
#include "EEqn.H"
|
||||
#include "pEqn.H"
|
||||
}
|
||||
|
||||
@ -5,6 +5,7 @@
|
||||
psiThermo::New(mesh)
|
||||
);
|
||||
psiThermo& thermo = pThermo();
|
||||
thermo.validate(args.executable(), "h", "e");
|
||||
|
||||
volScalarField rho
|
||||
(
|
||||
@ -20,7 +21,6 @@
|
||||
);
|
||||
|
||||
volScalarField& p = thermo.p();
|
||||
volScalarField& h = thermo.he();
|
||||
const volScalarField& psi = thermo.psi();
|
||||
|
||||
Info<< "Reading field U\n" << endl;
|
||||
|
||||
@ -1,15 +0,0 @@
|
||||
{
|
||||
fvScalarMatrix hEqn
|
||||
(
|
||||
fvm::div(phi, h)
|
||||
- fvm::Sp(fvc::div(phi), h)
|
||||
- fvm::laplacian(turbulence->alphaEff(), h)
|
||||
==
|
||||
- fvc::div(phi, 0.5*magSqr(U), "div(phi,K)")
|
||||
);
|
||||
|
||||
hEqn.relax();
|
||||
hEqn.solve();
|
||||
|
||||
thermo.correct();
|
||||
}
|
||||
@ -1,19 +0,0 @@
|
||||
{
|
||||
fvScalarMatrix hEqn
|
||||
(
|
||||
fvm::div(phi, h)
|
||||
- fvm::Sp(fvc::div(phi), h)
|
||||
- fvm::laplacian(turbulence->alphaEff(), h)
|
||||
==
|
||||
- fvc::div(phi, 0.5*magSqr(U), "div(phi,K)")
|
||||
+ radiation->Sh(thermo)
|
||||
);
|
||||
|
||||
hEqn.relax();
|
||||
|
||||
hEqn.solve();
|
||||
|
||||
thermo.correct();
|
||||
|
||||
radiation->correct();
|
||||
}
|
||||
@ -884,6 +884,7 @@ DebugSwitches
|
||||
wallHeatTransfer 0;
|
||||
wallLayerCells 0;
|
||||
wallModel 0;
|
||||
warnUnboundedGauss 1;
|
||||
waveTransmissive 0;
|
||||
wedge 0;
|
||||
weighted 0;
|
||||
|
||||
@ -119,7 +119,7 @@ singleStepCombustion<CombThermoType, ThermoType>::R
|
||||
{
|
||||
const label fNorm = singleMixturePtr_->specieProd()[specieI];
|
||||
const volScalarField fres(singleMixturePtr_->fres(specieI));
|
||||
wSpecie /= max(fNorm*(Y - fres), 1e-2);
|
||||
wSpecie /= max(fNorm*(Y - fres), scalar(1e-2));
|
||||
|
||||
return -fNorm*wSpecie*fres + fNorm*fvm::Sp(wSpecie, Y);
|
||||
}
|
||||
|
||||
@ -345,6 +345,7 @@ convectionSchemes = finiteVolume/convectionSchemes
|
||||
$(convectionSchemes)/convectionScheme/convectionSchemes.C
|
||||
$(convectionSchemes)/gaussConvectionScheme/gaussConvectionSchemes.C
|
||||
$(convectionSchemes)/multivariateGaussConvectionScheme/multivariateGaussConvectionSchemes.C
|
||||
$(convectionSchemes)/boundedConvectionScheme/boundedConvectionSchemes.C
|
||||
|
||||
laplacianSchemes = finiteVolume/laplacianSchemes
|
||||
$(laplacianSchemes)/laplacianScheme/laplacianSchemes.C
|
||||
|
||||
@ -0,0 +1,103 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 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/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "boundedConvectionScheme.H"
|
||||
#include "fvcSurfaceIntegrate.H"
|
||||
#include "fvMatrices.H"
|
||||
#include "fvmSup.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace fv
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
|
||||
boundedConvectionScheme<Type>::interpolate
|
||||
(
|
||||
const surfaceScalarField& phi,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
) const
|
||||
{
|
||||
return scheme_().interpolate(phi, vf);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> >
|
||||
boundedConvectionScheme<Type>::flux
|
||||
(
|
||||
const surfaceScalarField& faceFlux,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
) const
|
||||
{
|
||||
return scheme_().flux(faceFlux, vf);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<fvMatrix<Type> >
|
||||
boundedConvectionScheme<Type>::fvmDiv
|
||||
(
|
||||
const surfaceScalarField& faceFlux,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
) const
|
||||
{
|
||||
return
|
||||
scheme_().fvmDiv(faceFlux, vf)
|
||||
- fvm::Sp(fvc::surfaceIntegrate(faceFlux), vf);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> >
|
||||
boundedConvectionScheme<Type>::fvcDiv
|
||||
(
|
||||
const surfaceScalarField& faceFlux,
|
||||
const GeometricField<Type, fvPatchField, volMesh>& vf
|
||||
) const
|
||||
{
|
||||
return
|
||||
scheme_().fvcDiv(faceFlux, vf)
|
||||
- fvc::surfaceIntegrate(faceFlux)*vf;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace fv
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,150 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 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/>.
|
||||
|
||||
Class
|
||||
Foam::fv::boundedConvectionScheme
|
||||
|
||||
Description
|
||||
Bounded form of the selected convection scheme.
|
||||
|
||||
Boundedness is achieved by subtracting div(phi)*vf or Sp(div(phi), vf)
|
||||
which is non-conservative if div(phi) != 0 but conservative otherwise.
|
||||
|
||||
Can be used for convection of bounded scalar properties in steady-state
|
||||
solvers to improve stability if insufficient convergence of the pressure
|
||||
equation causes temporary divergence of the flux field.
|
||||
|
||||
SourceFiles
|
||||
boundedConvectionScheme.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef boundedConvectionScheme_H
|
||||
#define boundedConvectionScheme_H
|
||||
|
||||
#include "convectionScheme.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace fv
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class boundedConvectionScheme Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class Type>
|
||||
class boundedConvectionScheme
|
||||
:
|
||||
public fv::convectionScheme<Type>
|
||||
{
|
||||
// Private data
|
||||
|
||||
tmp<fv::convectionScheme<Type> > scheme_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Disallow default bitwise copy construct
|
||||
boundedConvectionScheme(const boundedConvectionScheme&);
|
||||
|
||||
//- Disallow default bitwise assignment
|
||||
void operator=(const boundedConvectionScheme&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("bounded");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from flux and Istream
|
||||
boundedConvectionScheme
|
||||
(
|
||||
const fvMesh& mesh,
|
||||
const surfaceScalarField& faceFlux,
|
||||
Istream& is
|
||||
)
|
||||
:
|
||||
convectionScheme<Type>(mesh, faceFlux),
|
||||
scheme_
|
||||
(
|
||||
fv::convectionScheme<Type>::New(mesh, faceFlux, is)
|
||||
)
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > interpolate
|
||||
(
|
||||
const surfaceScalarField&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
) const;
|
||||
|
||||
tmp<GeometricField<Type, fvsPatchField, surfaceMesh> > flux
|
||||
(
|
||||
const surfaceScalarField&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
) const;
|
||||
|
||||
tmp<fvMatrix<Type> > fvmDiv
|
||||
(
|
||||
const surfaceScalarField&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
) const;
|
||||
|
||||
tmp<GeometricField<Type, fvPatchField, volMesh> > fvcDiv
|
||||
(
|
||||
const surfaceScalarField&,
|
||||
const GeometricField<Type, fvPatchField, volMesh>&
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace fv
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "boundedConvectionScheme.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -23,44 +23,17 @@ License
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "boundedConvectionScheme.H"
|
||||
#include "fvMesh.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
const Foam::volVectorField& Foam::VirtualMassForce<CloudType>::DUcDt() const
|
||||
namespace Foam
|
||||
{
|
||||
if (DUcDtPtr_)
|
||||
{
|
||||
return *DUcDtPtr_;
|
||||
}
|
||||
else
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"const volVectorField& VirtualMassForce<CloudType>::DUcDt()"
|
||||
"const"
|
||||
) << "DUcDt field not allocated" << abort(FatalError);
|
||||
|
||||
return *reinterpret_cast<const volVectorField*>(0);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline const Foam::interpolation<Foam::vector>&
|
||||
Foam::VirtualMassForce<CloudType>::DUcDtInterp() const
|
||||
namespace fv
|
||||
{
|
||||
if (!DUcDtInterpPtr_.valid())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"inline const Foam::interpolation<Foam::vector>&"
|
||||
"Foam::VirtualMassForce<CloudType>::DUcDtInterp() const"
|
||||
) << "Carrier pahase DUcDt interpolation object not set"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
return DUcDtInterpPtr_();
|
||||
makeFvConvectionScheme(boundedConvectionScheme)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -47,6 +47,10 @@ namespace Foam
|
||||
namespace fv
|
||||
{
|
||||
|
||||
//- Temporary debug switch to provide warning about backward-compatibility
|
||||
// issue with setting div schemes for steady-state
|
||||
extern int warnUnboundedGauss;
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class gaussConvectionScheme Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -103,7 +107,29 @@ public:
|
||||
(
|
||||
surfaceInterpolationScheme<Type>::New(mesh, faceFlux, is)
|
||||
)
|
||||
{}
|
||||
{
|
||||
is.rewind();
|
||||
word bounded(is);
|
||||
|
||||
if
|
||||
(
|
||||
warnUnboundedGauss
|
||||
&& word(mesh.ddtScheme("default")) == "steadyState"
|
||||
&& bounded != "bounded"
|
||||
)
|
||||
{
|
||||
fileNameList controlDictFiles(findEtcFiles("controlDict"));
|
||||
|
||||
IOWarningIn("gaussConvectionScheme", is)
|
||||
<< "Unbounded 'Gauss' div scheme used in "
|
||||
"steady-state solver, use 'bounded Gauss' "
|
||||
"to ensure boundedness.\n"
|
||||
<< " To remove this warning switch off "
|
||||
<< "'boundedGauss' in "
|
||||
<< controlDictFiles[controlDictFiles.size()-1]
|
||||
<< endl;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -32,6 +32,11 @@ namespace Foam
|
||||
{
|
||||
namespace fv
|
||||
{
|
||||
int warnUnboundedGauss
|
||||
(
|
||||
Foam::debug::debugSwitch("warnUnboundedGauss", true)
|
||||
);
|
||||
|
||||
makeFvConvectionScheme(gaussConvectionScheme)
|
||||
}
|
||||
}
|
||||
|
||||
@ -470,8 +470,8 @@ public:
|
||||
//- Total rotational kinetic energy in the system
|
||||
inline scalar rotationalKineticEnergyOfSystem() const;
|
||||
|
||||
//- Penetration for percentage of the current total mass
|
||||
inline scalar penetration(const scalar& prc) const;
|
||||
//- Penetration for fraction [0-1] of the current total mass
|
||||
inline scalar penetration(const scalar& fraction) const;
|
||||
|
||||
//- Mean diameter Dij
|
||||
inline scalar Dij(const label i, const label j) const;
|
||||
|
||||
@ -24,6 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvmSup.H"
|
||||
#include "SortableList.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
@ -336,106 +337,130 @@ inline Foam::scalar Foam::KinematicCloud<CloudType>::Dmax() const
|
||||
|
||||
reduce(d, maxOp<scalar>());
|
||||
|
||||
return d;
|
||||
return max(0.0, d);
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
inline Foam::scalar Foam::KinematicCloud<CloudType>::penetration
|
||||
(
|
||||
const scalar& prc
|
||||
const scalar& fraction
|
||||
) const
|
||||
{
|
||||
scalar distance = 0.0;
|
||||
scalar mTot = 0.0;
|
||||
|
||||
label np = this->size();
|
||||
|
||||
// arrays containing the parcels mass and
|
||||
// distance from injector in ascending order
|
||||
scalarField mass(np);
|
||||
scalarField dist(np);
|
||||
|
||||
if (np > 0)
|
||||
if ((fraction < 0) || (fraction > 1))
|
||||
{
|
||||
label n = 0;
|
||||
|
||||
// first arrange the parcels in ascending order
|
||||
// the first parcel is closest to its injection position
|
||||
// and the last one is most far away.
|
||||
forAllConstIter(typename KinematicCloud<CloudType>, *this, iter)
|
||||
{
|
||||
const parcelType& p = iter();
|
||||
scalar mi = p.nParticle()*p.mass();
|
||||
scalar di = mag(p.position() - p.position0());
|
||||
mTot += mi;
|
||||
|
||||
// insert at the last place
|
||||
mass[n] = mi;
|
||||
dist[n] = di;
|
||||
|
||||
label i = 0;
|
||||
bool found = false;
|
||||
|
||||
// insert the parcel in the correct place
|
||||
// and move the others
|
||||
while ((i < n) && (!found))
|
||||
{
|
||||
if (di < dist[i])
|
||||
{
|
||||
found = true;
|
||||
for (label j=n; j>i; j--)
|
||||
{
|
||||
mass[j] = mass[j-1];
|
||||
dist[j] = dist[j-1];
|
||||
}
|
||||
mass[i] = mi;
|
||||
dist[i] = di;
|
||||
}
|
||||
i++;
|
||||
}
|
||||
n++;
|
||||
}
|
||||
FatalErrorIn
|
||||
(
|
||||
"inline Foam::scalar Foam::KinematicCloud<CloudType>::penetration"
|
||||
"("
|
||||
"const scalar&"
|
||||
") const"
|
||||
)
|
||||
<< "fraction should be in the range 0 < fraction < 1"
|
||||
<< exit(FatalError);
|
||||
}
|
||||
|
||||
reduce(mTot, sumOp<scalar>());
|
||||
scalar distance = 0.0;
|
||||
|
||||
if (np > 0)
|
||||
const label nParcel = this->size();
|
||||
globalIndex globalParcels(nParcel);
|
||||
const label nParcelSum = globalParcels.size();
|
||||
|
||||
if (nParcelSum == 0)
|
||||
{
|
||||
scalar mLimit = prc*mTot;
|
||||
scalar mOff = (1.0 - prc)*mTot;
|
||||
return distance;
|
||||
}
|
||||
|
||||
if (np > 1)
|
||||
// lists of parcels mass and distance from initial injection point
|
||||
List<scalar> mass(nParcel, 0.0);
|
||||
List<scalar> dist(nParcel, 0.0);
|
||||
|
||||
label i = 0;
|
||||
scalar mSum = 0.0;
|
||||
forAllConstIter(typename KinematicCloud<CloudType>, *this, iter)
|
||||
{
|
||||
const parcelType& p = iter();
|
||||
scalar m = p.nParticle()*p.mass();
|
||||
scalar d = mag(p.position() - p.position0());
|
||||
mSum += m;
|
||||
|
||||
mass[i] = m;
|
||||
dist[i] = d;
|
||||
|
||||
i++;
|
||||
}
|
||||
|
||||
// calculate total mass across all processors
|
||||
reduce(mSum, sumOp<scalar>());
|
||||
|
||||
// flatten the mass list
|
||||
List<scalar> allMass(nParcelSum, 0.0);
|
||||
SubList<scalar>
|
||||
(
|
||||
allMass,
|
||||
globalParcels.localSize(Pstream::myProcNo()),
|
||||
globalParcels.offset(Pstream::myProcNo())
|
||||
).assign(mass);
|
||||
|
||||
// flatten the distance list
|
||||
SortableList<scalar> allDist(nParcelSum, 0.0);
|
||||
SubList<scalar>
|
||||
(
|
||||
allDist,
|
||||
globalParcels.localSize(Pstream::myProcNo()),
|
||||
globalParcels.offset(Pstream::myProcNo())
|
||||
).assign(dist);
|
||||
|
||||
// sort allDist distances into ascending order
|
||||
// note: allMass masses are left unsorted
|
||||
allDist.sort();
|
||||
|
||||
if (nParcelSum > 1)
|
||||
{
|
||||
const scalar mLimit = fraction*mSum;
|
||||
const labelList& indices = allDist.indices();
|
||||
|
||||
if (mLimit > (mSum - allMass[indices.last()]))
|
||||
{
|
||||
// 'prc' is large enough that the parcel most far
|
||||
// away will be used, no need to loop...
|
||||
if (mLimit > mTot - mass[np-1])
|
||||
{
|
||||
distance = dist[np-1];
|
||||
}
|
||||
else
|
||||
{
|
||||
scalar mOffSum = 0.0;
|
||||
label i = np;
|
||||
|
||||
while ((mOffSum < mOff) && (i>0))
|
||||
{
|
||||
i--;
|
||||
mOffSum += mass[i];
|
||||
}
|
||||
distance =
|
||||
dist[i+1]
|
||||
+ (dist[i] - dist[i+1])*(mOffSum - mOff)
|
||||
/mass[i+1] ;
|
||||
}
|
||||
distance = allDist.last();
|
||||
}
|
||||
else
|
||||
{
|
||||
distance = dist[0];
|
||||
// assuming that 'fraction' is generally closer to 1 than 0, loop
|
||||
// through in reverse distance order
|
||||
const scalar mThreshold = (1.0 - fraction)*mSum;
|
||||
scalar mCurrent = 0.0;
|
||||
label i0 = 0;
|
||||
|
||||
forAllReverse(indices, i)
|
||||
{
|
||||
label indI = indices[i];
|
||||
|
||||
mCurrent += allMass[indI];
|
||||
|
||||
if (mCurrent > mThreshold)
|
||||
{
|
||||
i0 = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (i0 == indices.size() - 1)
|
||||
{
|
||||
distance = allDist.last();
|
||||
}
|
||||
else
|
||||
{
|
||||
// linearly interpolate to determine distance
|
||||
scalar alpha = (mCurrent - mThreshold)/allMass[indices[i0]];
|
||||
distance = allDist[i0] + alpha*(allDist[i0+1] - allDist[i0]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
reduce(distance, maxOp<scalar>());
|
||||
else
|
||||
{
|
||||
distance = allDist.first();
|
||||
}
|
||||
|
||||
return distance;
|
||||
}
|
||||
|
||||
@ -89,7 +89,7 @@ public:
|
||||
virtual scalar rotationalKineticEnergyOfSystem() const = 0;
|
||||
|
||||
//- Penetration for percentage of the current total mass
|
||||
// virtual scalar penetration(const scalar& prc) const = 0;
|
||||
// virtual scalar penetration(const scalar& fraction) const = 0;
|
||||
|
||||
//- Mean diameter Dij
|
||||
virtual scalar Dij(const label i, const label j) const = 0;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -24,6 +24,7 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "PressureGradientForce.H"
|
||||
#include "fvcDdt.H"
|
||||
#include "fvcGrad.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
@ -33,12 +34,13 @@ Foam::PressureGradientForce<CloudType>::PressureGradientForce
|
||||
(
|
||||
CloudType& owner,
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
const word& forceType
|
||||
)
|
||||
:
|
||||
ParticleForce<CloudType>(owner, mesh, dict, typeName, true),
|
||||
UName_(this->coeffs().lookup("U")),
|
||||
gradUPtr_(NULL)
|
||||
ParticleForce<CloudType>(owner, mesh, dict, forceType, true),
|
||||
UName_(this->coeffs().template lookupOrDefault<word>("U", "U")),
|
||||
DUcDtInterpPtr_(NULL)
|
||||
{}
|
||||
|
||||
|
||||
@ -50,7 +52,7 @@ Foam::PressureGradientForce<CloudType>::PressureGradientForce
|
||||
:
|
||||
ParticleForce<CloudType>(pgf),
|
||||
UName_(pgf.UName_),
|
||||
gradUPtr_(NULL)
|
||||
DUcDtInterpPtr_(NULL)
|
||||
{}
|
||||
|
||||
|
||||
@ -66,18 +68,48 @@ Foam::PressureGradientForce<CloudType>::~PressureGradientForce()
|
||||
template<class CloudType>
|
||||
void Foam::PressureGradientForce<CloudType>::cacheFields(const bool store)
|
||||
{
|
||||
static word fName("DUcDt");
|
||||
|
||||
bool fieldExists = this->mesh().template foundObject<volVectorField>(fName);
|
||||
|
||||
if (store)
|
||||
{
|
||||
const volVectorField& U = this->mesh().template
|
||||
lookupObject<volVectorField>(UName_);
|
||||
gradUPtr_ = fvc::grad(U).ptr();
|
||||
if (!fieldExists)
|
||||
{
|
||||
const volVectorField& Uc = this->mesh().template
|
||||
lookupObject<volVectorField>(UName_);
|
||||
|
||||
volVectorField* DUcDtPtr = new volVectorField
|
||||
(
|
||||
fName,
|
||||
fvc::ddt(Uc) + (Uc & fvc::grad(Uc))
|
||||
);
|
||||
|
||||
DUcDtPtr->store();
|
||||
}
|
||||
|
||||
const volVectorField& DUcDt = this->mesh().template
|
||||
lookupObject<volVectorField>(fName);
|
||||
|
||||
DUcDtInterpPtr_.reset
|
||||
(
|
||||
interpolation<vector>::New
|
||||
(
|
||||
this->owner().solution().interpolationSchemes(),
|
||||
DUcDt
|
||||
).ptr()
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
if (gradUPtr_)
|
||||
DUcDtInterpPtr_.clear();
|
||||
|
||||
if (fieldExists)
|
||||
{
|
||||
delete gradUPtr_;
|
||||
gradUPtr_ = NULL;
|
||||
const volVectorField& DUcDt = this->mesh().template
|
||||
lookupObject<volVectorField>(fName);
|
||||
|
||||
const_cast<volVectorField&>(DUcDt).checkOut();
|
||||
}
|
||||
}
|
||||
}
|
||||
@ -95,11 +127,24 @@ Foam::forceSuSp Foam::PressureGradientForce<CloudType>::calcCoupled
|
||||
{
|
||||
forceSuSp value(vector::zero, 0.0);
|
||||
|
||||
const volTensorField& gradU = *gradUPtr_;
|
||||
value.Su() = mass*p.rhoc()/p.rho()*(p.U() & gradU[p.cell()]);
|
||||
vector DUcDt =
|
||||
DUcDtInterp().interpolate(p.position(), p.currentTetIndices());
|
||||
|
||||
value.Su() = mass*p.rhoc()/p.rho()*DUcDt;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::PressureGradientForce<CloudType>::massAdd
|
||||
(
|
||||
const typename CloudType::parcelType&,
|
||||
const scalar
|
||||
) const
|
||||
{
|
||||
return 0.0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -38,6 +38,7 @@ SourceFiles
|
||||
|
||||
#include "ParticleForce.H"
|
||||
#include "volFields.H"
|
||||
#include "interpolation.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -53,13 +54,15 @@ class PressureGradientForce
|
||||
:
|
||||
public ParticleForce<CloudType>
|
||||
{
|
||||
// Private data
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
//- Name of velocity field
|
||||
const word UName_;
|
||||
|
||||
//- Velocity gradient field
|
||||
const volTensorField* gradUPtr_;
|
||||
//- Rate of change of carrier phase velocity interpolator
|
||||
autoPtr<interpolation<vector> > DUcDtInterpPtr_;
|
||||
|
||||
|
||||
public:
|
||||
@ -75,7 +78,8 @@ public:
|
||||
(
|
||||
CloudType& owner,
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
const word& forceType = typeName
|
||||
);
|
||||
|
||||
//- Construct copy
|
||||
@ -99,8 +103,8 @@ public:
|
||||
|
||||
// Access
|
||||
|
||||
//- Return const access to the velocity gradient field
|
||||
inline const volTensorField& gradU() const;
|
||||
//- Return the rate of change of carrier phase velocity interpolator
|
||||
inline const interpolation<vector>& DUcDtInterp() const;
|
||||
|
||||
|
||||
// Evaluation
|
||||
@ -117,6 +121,13 @@ public:
|
||||
const scalar Re,
|
||||
const scalar muc
|
||||
) const;
|
||||
|
||||
//- Return the added mass
|
||||
virtual scalar massAdd
|
||||
(
|
||||
const typename CloudType::parcelType& p,
|
||||
const scalar mass
|
||||
) const;
|
||||
};
|
||||
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -26,23 +26,20 @@ License
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
const Foam::volTensorField& Foam::PressureGradientForce<CloudType>::gradU()
|
||||
const
|
||||
inline const Foam::interpolation<Foam::vector>&
|
||||
Foam::PressureGradientForce<CloudType>::DUcDtInterp() const
|
||||
{
|
||||
if (gradUPtr_)
|
||||
{
|
||||
return *gradUPtr_;
|
||||
}
|
||||
else
|
||||
if (!DUcDtInterpPtr_.valid())
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"const volTensorField& PressureGradientForce<CloudType>::gradU()"
|
||||
"const"
|
||||
) << "gradU field not allocated" << abort(FatalError);
|
||||
|
||||
return *reinterpret_cast<const volTensorField*>(0);
|
||||
"inline const Foam::interpolation<Foam::vector>&"
|
||||
"Foam::PressureGradientForce<CloudType>::DUcDtInterp() const"
|
||||
) << "Carrier phase DUcDt interpolation object not set"
|
||||
<< abort(FatalError);
|
||||
}
|
||||
|
||||
return DUcDtInterpPtr_();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -24,8 +24,6 @@ License
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "VirtualMassForce.H"
|
||||
#include "fvcDdt.H"
|
||||
#include "fvcGrad.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
@ -34,14 +32,12 @@ Foam::VirtualMassForce<CloudType>::VirtualMassForce
|
||||
(
|
||||
CloudType& owner,
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
const word& forceType
|
||||
)
|
||||
:
|
||||
ParticleForce<CloudType>(owner, mesh, dict, typeName, true),
|
||||
UName_(this->coeffs().template lookupOrDefault<word>("U", "U")),
|
||||
Cvm_(readScalar(this->coeffs().lookup("Cvm"))),
|
||||
DUcDtPtr_(NULL),
|
||||
DUcDtInterpPtr_(NULL)
|
||||
PressureGradientForce<CloudType>(owner, mesh, dict, forceType),
|
||||
Cvm_(readScalar(this->coeffs().lookup("Cvm")))
|
||||
{}
|
||||
|
||||
|
||||
@ -51,11 +47,8 @@ Foam::VirtualMassForce<CloudType>::VirtualMassForce
|
||||
const VirtualMassForce& vmf
|
||||
)
|
||||
:
|
||||
ParticleForce<CloudType>(vmf),
|
||||
UName_(vmf.UName_),
|
||||
Cvm_(vmf.Cvm_),
|
||||
DUcDtPtr_(NULL),
|
||||
DUcDtInterpPtr_(NULL)
|
||||
PressureGradientForce<CloudType>(vmf),
|
||||
Cvm_(vmf.Cvm_)
|
||||
{}
|
||||
|
||||
|
||||
@ -71,36 +64,7 @@ Foam::VirtualMassForce<CloudType>::~VirtualMassForce()
|
||||
template<class CloudType>
|
||||
void Foam::VirtualMassForce<CloudType>::cacheFields(const bool store)
|
||||
{
|
||||
if (store && !DUcDtPtr_)
|
||||
{
|
||||
const volVectorField& Uc = this->mesh().template
|
||||
lookupObject<volVectorField>(UName_);
|
||||
|
||||
DUcDtPtr_ = new volVectorField
|
||||
(
|
||||
"DUcDt",
|
||||
fvc::ddt(Uc) + (Uc & fvc::grad(Uc))
|
||||
);
|
||||
|
||||
DUcDtInterpPtr_.reset
|
||||
(
|
||||
interpolation<vector>::New
|
||||
(
|
||||
this->owner().solution().interpolationSchemes(),
|
||||
*DUcDtPtr_
|
||||
).ptr()
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
DUcDtInterpPtr_.clear();
|
||||
|
||||
if (DUcDtPtr_)
|
||||
{
|
||||
delete DUcDtPtr_;
|
||||
DUcDtPtr_ = NULL;
|
||||
}
|
||||
}
|
||||
PressureGradientForce<CloudType>::cacheFields(store);
|
||||
}
|
||||
|
||||
|
||||
@ -114,12 +78,10 @@ Foam::forceSuSp Foam::VirtualMassForce<CloudType>::calcCoupled
|
||||
const scalar muc
|
||||
) const
|
||||
{
|
||||
forceSuSp value(vector::zero, 0.0);
|
||||
forceSuSp value =
|
||||
PressureGradientForce<CloudType>::calcCoupled(p, dt, mass, Re, muc);
|
||||
|
||||
vector DUcDt =
|
||||
DUcDtInterp().interpolate(p.position(), p.currentTetIndices());
|
||||
|
||||
value.Su() = mass*p.rhoc()/p.rho()*Cvm_*DUcDt;
|
||||
value.Su() *= Cvm_;
|
||||
|
||||
return value;
|
||||
}
|
||||
|
||||
@ -28,7 +28,6 @@ Description
|
||||
Calculates particle virtual mass force
|
||||
|
||||
SourceFiles
|
||||
VirtualMassForceI.H
|
||||
VirtualMassForce.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
@ -36,9 +35,7 @@ SourceFiles
|
||||
#ifndef VirtualMassForce_H
|
||||
#define VirtualMassForce_H
|
||||
|
||||
#include "ParticleForce.H"
|
||||
#include "volFields.H"
|
||||
#include "interpolation.H"
|
||||
#include "PressureGradientForce.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
@ -52,22 +49,13 @@ namespace Foam
|
||||
template<class CloudType>
|
||||
class VirtualMassForce
|
||||
:
|
||||
public ParticleForce<CloudType>
|
||||
public PressureGradientForce<CloudType>
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Name of velocity field
|
||||
const word UName_;
|
||||
|
||||
//- Virtual mass coefficient - typically 0.5
|
||||
scalar Cvm_;
|
||||
|
||||
//- Rate of change of carrier phase velocity
|
||||
volVectorField* DUcDtPtr_;
|
||||
|
||||
//- Rate of change of carrier phase velocity interpolator
|
||||
autoPtr<interpolation<vector> > DUcDtInterpPtr_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -82,7 +70,8 @@ public:
|
||||
(
|
||||
CloudType& owner,
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
const dictionary& dict,
|
||||
const word& forceType = typeName
|
||||
);
|
||||
|
||||
//- Construct copy
|
||||
@ -104,15 +93,6 @@ public:
|
||||
|
||||
// Member Functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return the rate of change of carrier phase velocity
|
||||
inline const volVectorField& DUcDt() const;
|
||||
|
||||
//- Return the rate of change of carrier phase velocity interpolator
|
||||
inline const interpolation<vector>& DUcDtInterp() const;
|
||||
|
||||
|
||||
// Evaluation
|
||||
|
||||
//- Cache fields
|
||||
@ -143,8 +123,6 @@ public:
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "VirtualMassForceI.H"
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "VirtualMassForce.C"
|
||||
#endif
|
||||
|
||||
@ -123,7 +123,7 @@ temperatureThermoBaffleFvPatchScalarField
|
||||
&& !owner_
|
||||
)
|
||||
{
|
||||
Info << "Creating thermal baffle..." << nbrMesh << endl;
|
||||
Info << "Creating thermal baffle" << nbrMesh << endl;
|
||||
baffle_.reset(baffle::New(thisMesh, dict).ptr());
|
||||
owner_ = true;
|
||||
dict.lookup("thermoType") >> solidThermoType_;
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -132,11 +132,9 @@ public:
|
||||
const word& modelType,
|
||||
const fvMesh& mesh,
|
||||
const dictionary& dict
|
||||
|
||||
);
|
||||
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~thermoBaffle2D();
|
||||
|
||||
@ -182,6 +180,7 @@ public:
|
||||
//- Return sensible enthalpy/internal energy
|
||||
inline tmp<volScalarField> he() const;
|
||||
|
||||
|
||||
// Evolution
|
||||
|
||||
//- Pre-evolve thermal baffle
|
||||
@ -191,7 +190,6 @@ public:
|
||||
virtual void evolveRegion();
|
||||
|
||||
|
||||
|
||||
// I-O
|
||||
|
||||
//- Provide some feedback
|
||||
|
||||
@ -164,6 +164,89 @@ Foam::basicThermo::~basicThermo()
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
void Foam::basicThermo::validate
|
||||
(
|
||||
const word& app,
|
||||
const word& a
|
||||
) const
|
||||
{
|
||||
if (!(he().name() == a))
|
||||
{
|
||||
FatalErrorIn(app)
|
||||
<< "Supported energy type is " << a
|
||||
<< ", thermodynamics package provides " << he().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
void Foam::basicThermo::validate
|
||||
(
|
||||
const word& app,
|
||||
const word& a,
|
||||
const word& b
|
||||
) const
|
||||
{
|
||||
if (!(he().name() == a || he().name() == b))
|
||||
{
|
||||
FatalErrorIn(app)
|
||||
<< "Supported energy types are " << a << " and " << b
|
||||
<< ", thermodynamics package provides " << he().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
void Foam::basicThermo::validate
|
||||
(
|
||||
const word& app,
|
||||
const word& a,
|
||||
const word& b,
|
||||
const word& c
|
||||
) const
|
||||
{
|
||||
if
|
||||
(
|
||||
!(
|
||||
he().name() == a
|
||||
|| he().name() == b
|
||||
|| he().name() == c
|
||||
)
|
||||
)
|
||||
{
|
||||
FatalErrorIn(app)
|
||||
<< "Supported energy types are " << a << ", " << b << " and " << c
|
||||
<< ", thermodynamics package provides " << he().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
void Foam::basicThermo::validate
|
||||
(
|
||||
const word& app,
|
||||
const word& a,
|
||||
const word& b,
|
||||
const word& c,
|
||||
const word& d
|
||||
) const
|
||||
{
|
||||
if
|
||||
(
|
||||
!(
|
||||
he().name() == a
|
||||
|| he().name() == b
|
||||
|| he().name() == c
|
||||
|| he().name() == d
|
||||
)
|
||||
)
|
||||
{
|
||||
FatalErrorIn(app)
|
||||
<< "Supported energy types are " << a << ", " << b
|
||||
<< ", " << c << " and " << d
|
||||
<< ", thermodynamics package provides " << he().name()
|
||||
<< exit(FatalError);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Foam::volScalarField& Foam::basicThermo::p()
|
||||
{
|
||||
return p_;
|
||||
|
||||
@ -111,6 +111,45 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
//- Check that the thermodynamics package is consistent
|
||||
// with energy forms supported by the application
|
||||
void validate
|
||||
(
|
||||
const word& app,
|
||||
const word&
|
||||
) const;
|
||||
|
||||
//- Check that the thermodynamics package is consistent
|
||||
// with energy forms supported by the application
|
||||
void validate
|
||||
(
|
||||
const word& app,
|
||||
const word&,
|
||||
const word&
|
||||
) const;
|
||||
|
||||
//- Check that the thermodynamics package is consistent
|
||||
// with energy forms supported by the application
|
||||
void validate
|
||||
(
|
||||
const word& app,
|
||||
const word&,
|
||||
const word&,
|
||||
const word&
|
||||
) const;
|
||||
|
||||
//- Check that the thermodynamics package is consistent
|
||||
// with energy forms supported by the application
|
||||
void validate
|
||||
(
|
||||
const word& app,
|
||||
const word&,
|
||||
const word&,
|
||||
const word&,
|
||||
const word&
|
||||
) const;
|
||||
|
||||
|
||||
//- Update properties
|
||||
virtual void correct() = 0;
|
||||
|
||||
|
||||
@ -142,6 +142,24 @@ makeBasicMixture
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
makeBasicMixture
|
||||
(
|
||||
pureMixture,
|
||||
constTransport,
|
||||
sensibleInternalEnergy,
|
||||
eConstThermo,
|
||||
perfectGas
|
||||
);
|
||||
|
||||
makeBasicMixture
|
||||
(
|
||||
pureMixture,
|
||||
sutherlandTransport,
|
||||
sensibleInternalEnergy,
|
||||
eConstThermo,
|
||||
perfectGas
|
||||
);
|
||||
|
||||
makeBasicMixture
|
||||
(
|
||||
pureMixture,
|
||||
|
||||
@ -84,27 +84,27 @@ makeThermo
|
||||
|
||||
/* * * * * * * * * * * * * * Internal-energy-based * * * * * * * * * * * * * */
|
||||
|
||||
// makeThermo
|
||||
// (
|
||||
// psiThermo,
|
||||
// hePsiThermo,
|
||||
// pureMixture,
|
||||
// constTransport,
|
||||
// sensibleInternalEnergy,
|
||||
// eConstThermo,
|
||||
// perfectGas
|
||||
// );
|
||||
makeThermo
|
||||
(
|
||||
psiThermo,
|
||||
hePsiThermo,
|
||||
pureMixture,
|
||||
constTransport,
|
||||
sensibleInternalEnergy,
|
||||
eConstThermo,
|
||||
perfectGas
|
||||
);
|
||||
|
||||
// makeThermo
|
||||
// (
|
||||
// psiThermo,
|
||||
// hePsiThermo,
|
||||
// pureMixture,
|
||||
// sutherlandTransport,
|
||||
// sensibleInternalEnergy,
|
||||
// eConstThermo,
|
||||
// perfectGas
|
||||
// );
|
||||
makeThermo
|
||||
(
|
||||
psiThermo,
|
||||
hePsiThermo,
|
||||
pureMixture,
|
||||
sutherlandTransport,
|
||||
sensibleInternalEnergy,
|
||||
eConstThermo,
|
||||
perfectGas
|
||||
);
|
||||
|
||||
makeThermo
|
||||
(
|
||||
|
||||
@ -43,6 +43,21 @@ constSolidRad<thermo>::constSolidRad(const dictionary& dict)
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class thermo>
|
||||
void Foam::constSolidRad<thermo>::constSolidRad::write(Ostream& os) const
|
||||
{
|
||||
thermo::write(os);
|
||||
|
||||
dictionary dict("radiation");
|
||||
dict.add("kappaRad", kappaRad_);
|
||||
dict.add("sigmaS", sigmaS_);
|
||||
dict.add("emissivity", emissivity_);
|
||||
os << indent << dict.dictName() << dict;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Ostream Operator * * * * * * * * * * * * * //
|
||||
|
||||
template<class thermo>
|
||||
|
||||
@ -58,7 +58,7 @@ Ostream& operator<<
|
||||
);
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class constSolidRad Declaration
|
||||
Class constSolidRad Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class thermo>
|
||||
@ -116,6 +116,9 @@ public:
|
||||
//- Return emissivity[]
|
||||
inline scalar emissivity(scalar T) const;
|
||||
|
||||
//- Write to Ostream
|
||||
void write(Ostream& os) const;
|
||||
|
||||
|
||||
// Member operators
|
||||
|
||||
|
||||
@ -39,6 +39,22 @@ Foam::constAnIsoSolidTransport<thermo>::constAnIsoSolidTransport
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class thermo>
|
||||
void Foam::constAnIsoSolidTransport<thermo>::constAnIsoSolidTransport::write
|
||||
(
|
||||
Ostream& os
|
||||
) const
|
||||
{
|
||||
thermo::write(os);
|
||||
|
||||
dictionary dict("transport");
|
||||
dict.add("kappa", kappa_);
|
||||
os << indent << dict.dictName() << dict;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
template<class thermo>
|
||||
|
||||
@ -62,7 +62,7 @@ Ostream& operator<<
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class constAnIsoSolidTransport Declaration
|
||||
Class constAnIsoSolidTransport Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class thermo>
|
||||
@ -79,11 +79,7 @@ class constAnIsoSolidTransport
|
||||
// Private Member Functions
|
||||
|
||||
//- Construct from components
|
||||
inline constAnIsoSolidTransport
|
||||
(
|
||||
const thermo& t,
|
||||
const vector kappa
|
||||
);
|
||||
inline constAnIsoSolidTransport(const thermo& t, const vector kappa);
|
||||
|
||||
|
||||
public:
|
||||
@ -110,6 +106,9 @@ public:
|
||||
//- Un-isotropic thermal conductivity [W/mK]
|
||||
inline vector Kappa(const scalar T) const;
|
||||
|
||||
//- Write to Ostream
|
||||
void write(Ostream& os) const;
|
||||
|
||||
|
||||
// Member operators
|
||||
|
||||
|
||||
@ -39,6 +39,22 @@ Foam::constIsoSolidTransport<thermo>::constIsoSolidTransport
|
||||
{}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class thermo>
|
||||
void Foam::constIsoSolidTransport<thermo>::constIsoSolidTransport::write
|
||||
(
|
||||
Ostream& os
|
||||
) const
|
||||
{
|
||||
thermo::write(os);
|
||||
|
||||
dictionary dict("transport");
|
||||
dict.add("kappa", kappa_);
|
||||
os << indent << dict.dictName() << dict;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
template<class thermo>
|
||||
|
||||
@ -63,7 +63,7 @@ Ostream& operator<<
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class constIsoSolidTransport Declaration
|
||||
Class constIsoSolidTransport Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class thermo>
|
||||
@ -73,18 +73,14 @@ class constIsoSolidTransport
|
||||
{
|
||||
// Private data
|
||||
|
||||
//- Constant isotropic thermal conductivity.
|
||||
//- Constant isotropic thermal conductivity
|
||||
scalar kappa_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Construct from components
|
||||
inline constIsoSolidTransport
|
||||
(
|
||||
const thermo& t,
|
||||
const scalar kappa
|
||||
);
|
||||
inline constIsoSolidTransport(const thermo& t, const scalar kappa);
|
||||
|
||||
|
||||
public:
|
||||
@ -99,8 +95,7 @@ public:
|
||||
);
|
||||
|
||||
//- Construct from Istream
|
||||
//constIsoSolidTransport(Istream&);
|
||||
constIsoSolidTransport(const dictionary&);
|
||||
constIsoSolidTransport(const dictionary& dict);
|
||||
|
||||
|
||||
// Member functions
|
||||
@ -111,6 +106,9 @@ public:
|
||||
//- Un-isotropic thermal conductivity [W/mK]
|
||||
inline vector Kappa(const scalar T) const;
|
||||
|
||||
//- Write to Ostream
|
||||
void write(Ostream& os) const;
|
||||
|
||||
|
||||
// Member operators
|
||||
|
||||
|
||||
@ -46,6 +46,24 @@ Foam::exponentialSolidTransport<thermo>::exponentialSolidTransport
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class thermo>
|
||||
void Foam::exponentialSolidTransport<thermo>::exponentialSolidTransport::write
|
||||
(
|
||||
Ostream& os
|
||||
) const
|
||||
{
|
||||
thermo::write(os);
|
||||
|
||||
dictionary dict("transport");
|
||||
dict.add("kappa0", kappa0_);
|
||||
dict.add("n0", n0_);
|
||||
dict.add("Tref", Tref_);
|
||||
os << indent << dict.dictName() << dict;
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
|
||||
|
||||
template<class thermo>
|
||||
|
||||
@ -60,7 +60,7 @@ Ostream& operator<<
|
||||
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class exponentialSolidTransport Declaration
|
||||
Class exponentialSolidTransport Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class thermo>
|
||||
@ -116,6 +116,9 @@ public:
|
||||
//- Thermal conductivity [W/mK]
|
||||
inline vector Kappa(const scalar T) const;
|
||||
|
||||
//- Write to Ostream
|
||||
void write(Ostream& os) const;
|
||||
|
||||
|
||||
// Member operators
|
||||
|
||||
|
||||
@ -45,7 +45,7 @@ namespace Foam
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class heSolidThermo Declaration
|
||||
Class heSolidThermo Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class MixtureType, class BasicSolidThermo>
|
||||
@ -62,6 +62,7 @@ class heSolidThermo
|
||||
//- Construct as copy (not implemented)
|
||||
heSolidThermo(const heSolidThermo<MixtureType, BasicSolidThermo>&);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -104,30 +105,17 @@ public:
|
||||
|
||||
// Per patch calculation
|
||||
|
||||
//- Anisotropic thermal conductivity [W//m/K]
|
||||
virtual tmp<vectorField> Kappa
|
||||
(
|
||||
const label patchI
|
||||
) const;
|
||||
//- Anisotropic thermal conductivity [W/m/K]
|
||||
virtual tmp<vectorField> Kappa(const label patchI) const;
|
||||
|
||||
//- Absorption coefficient [1/m]
|
||||
virtual tmp<scalarField> kappaRad
|
||||
(
|
||||
const label patchI
|
||||
) const;
|
||||
virtual tmp<scalarField> kappaRad(const label patchI) const;
|
||||
|
||||
//- Scatter coefficient
|
||||
virtual tmp<scalarField> sigmaS
|
||||
(
|
||||
const label patchI
|
||||
) const;
|
||||
virtual tmp<scalarField> sigmaS(const label patchI) const;
|
||||
|
||||
//- Emissivity coefficient [1/m]
|
||||
virtual tmp<scalarField> emissivity
|
||||
(
|
||||
const label patchI
|
||||
) const;
|
||||
|
||||
virtual tmp<scalarField> emissivity(const label patchI) const;
|
||||
};
|
||||
|
||||
|
||||
@ -135,7 +123,7 @@ public:
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
# include "heSolidThermo.C"
|
||||
|
||||
@ -292,7 +292,7 @@ void kEpsilon::correct()
|
||||
(
|
||||
fvm::ddt(rho_, epsilon_)
|
||||
+ fvm::div(phi_, epsilon_)
|
||||
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), epsilon_)
|
||||
//***HGW - fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), epsilon_)
|
||||
- fvm::laplacian(DepsilonEff(), epsilon_)
|
||||
==
|
||||
C1_*G*epsilon_/k_
|
||||
@ -314,7 +314,7 @@ void kEpsilon::correct()
|
||||
(
|
||||
fvm::ddt(rho_, k_)
|
||||
+ fvm::div(phi_, k_)
|
||||
- fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), k_)
|
||||
//***HGW - fvm::Sp(fvc::ddt(rho_) + fvc::div(phi_), k_)
|
||||
- fvm::laplacian(DkEff(), k_)
|
||||
==
|
||||
G
|
||||
|
||||
@ -51,7 +51,7 @@ temperatureThermoBaffle1DFvPatchScalarField
|
||||
baffleActivated_(true),
|
||||
thickness_(p.size()),
|
||||
Qs_(p.size()),
|
||||
solid_(NULL)
|
||||
solidPtr_(NULL)
|
||||
{}
|
||||
|
||||
|
||||
@ -70,7 +70,7 @@ temperatureThermoBaffle1DFvPatchScalarField
|
||||
baffleActivated_(ptf.baffleActivated_),
|
||||
thickness_(ptf.thickness_),
|
||||
Qs_(ptf.Qs_),
|
||||
solid_(ptf.solid_)
|
||||
solidPtr_(ptf.solidPtr_)
|
||||
{}
|
||||
|
||||
|
||||
@ -88,19 +88,19 @@ temperatureThermoBaffle1DFvPatchScalarField
|
||||
baffleActivated_(readBool(dict.lookup("baffleActivated"))),
|
||||
thickness_(scalarField("thickness", dict, p.size())),
|
||||
Qs_(scalarField("Qs", dict, p.size())),
|
||||
solid_(new solidThermoData(dict))
|
||||
solidPtr_(new solidType(dict))
|
||||
{
|
||||
if (!isA<mappedPatchBase>(this->patch().patch()))
|
||||
{
|
||||
FatalErrorIn
|
||||
(
|
||||
"temperatureThermoBaffle1DFvPatchScalarField::"
|
||||
"temperatureThermoBaffle1DFvPatchScalarField\n"
|
||||
"(\n"
|
||||
" const fvPatch& p,\n"
|
||||
" const DimensionedField<scalar, volMesh>& iF,\n"
|
||||
" const dictionary& dict\n"
|
||||
")\n"
|
||||
"temperatureThermoBaffle1DFvPatchScalarField"
|
||||
"("
|
||||
"const fvPatch&,\n"
|
||||
"const DimensionedField<scalar, volMesh>&, "
|
||||
"const dictionary&"
|
||||
")"
|
||||
) << "\n patch type '" << patch().type()
|
||||
<< "' not type '" << mappedPatchBase::typeName << "'"
|
||||
<< "\n for patch " << patch().name()
|
||||
@ -141,7 +141,7 @@ temperatureThermoBaffle1DFvPatchScalarField
|
||||
baffleActivated_(ptf.baffleActivated_),
|
||||
thickness_(ptf.thickness_),
|
||||
Qs_(ptf.Qs_),
|
||||
solid_(ptf.solid_)
|
||||
solidPtr_(ptf.solidPtr_)
|
||||
{}
|
||||
|
||||
|
||||
@ -158,7 +158,7 @@ temperatureThermoBaffle1DFvPatchScalarField
|
||||
baffleActivated_(ptf.baffleActivated_),
|
||||
thickness_(ptf.thickness_),
|
||||
Qs_(ptf.Qs_),
|
||||
solid_(ptf.solid_)
|
||||
solidPtr_(ptf.solidPtr_)
|
||||
{}
|
||||
|
||||
|
||||
@ -197,10 +197,8 @@ void temperatureThermoBaffle1DFvPatchScalarField<solidType>::updateCoeffs()
|
||||
int oldTag = UPstream::msgType();
|
||||
UPstream::msgType() = oldTag+1;
|
||||
|
||||
const mappedPatchBase& mpp = refCast<const mappedPatchBase>
|
||||
(
|
||||
patch().patch()
|
||||
);
|
||||
const mappedPatchBase& mpp =
|
||||
refCast<const mappedPatchBase>(patch().patch());
|
||||
|
||||
const label patchI = patch().index();
|
||||
|
||||
@ -208,8 +206,7 @@ void temperatureThermoBaffle1DFvPatchScalarField<solidType>::updateCoeffs()
|
||||
|
||||
if (baffleActivated_)
|
||||
{
|
||||
const fvPatch& nbrPatch =
|
||||
patch().boundaryMesh()[mpp.samplePolyPatch().index()];
|
||||
const fvPatch& nbrPatch = patch().boundaryMesh()[nbrPatchI];
|
||||
|
||||
const compressible::turbulenceModel& model =
|
||||
db().template lookupObject<compressible::turbulenceModel>
|
||||
@ -248,10 +245,7 @@ void temperatureThermoBaffle1DFvPatchScalarField<solidType>::updateCoeffs()
|
||||
const temperatureThermoBaffle1DFvPatchScalarField& nbrField =
|
||||
refCast<const temperatureThermoBaffle1DFvPatchScalarField>
|
||||
(
|
||||
nbrPatch.template lookupPatchField<volScalarField, scalar>
|
||||
(
|
||||
TName_
|
||||
)
|
||||
nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
|
||||
);
|
||||
|
||||
scalarField nbrTi(nbrField.patchInternalField());
|
||||
@ -278,7 +272,8 @@ void temperatureThermoBaffle1DFvPatchScalarField<solidType>::updateCoeffs()
|
||||
// Create fields for solid properties
|
||||
forAll(KDeltaw, i)
|
||||
{
|
||||
KDeltaw[i] = solid_().kappa((Tp[i] + nbrTw[i])/2.0)/thickness_[i];
|
||||
KDeltaw[i] =
|
||||
solidPtr_().kappa((Tp[i] + nbrTw[i])/2.0)/thickness_[i];
|
||||
}
|
||||
|
||||
const scalarField q
|
||||
@ -362,7 +357,7 @@ write(Ostream& os) const
|
||||
os.writeKeyword("baffleActivated")
|
||||
<< baffleActivated_ << token::END_STATEMENT << nl;
|
||||
Qs_.writeEntry("Qs", os);
|
||||
solid_().write(os);
|
||||
solidPtr_->write(os);
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -48,7 +48,7 @@ namespace compressible
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class temperatureThermoBaffle1DFvPatchScalarField Declaration
|
||||
Class temperatureThermoBaffle1DFvPatchScalarField Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class solidType>
|
||||
@ -58,74 +58,6 @@ class temperatureThermoBaffle1DFvPatchScalarField
|
||||
{
|
||||
// Private data
|
||||
|
||||
class solidThermoData
|
||||
{
|
||||
// Solid thermo
|
||||
autoPtr<solidType> solidPtr_;
|
||||
|
||||
// Solid dictionaries
|
||||
dictionary specieDict_;
|
||||
dictionary transportDict_;
|
||||
dictionary radiationDict_;
|
||||
dictionary thermoDict_;
|
||||
dictionary densityDict_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
// Constructor from components
|
||||
solidThermoData(const dictionary& dict)
|
||||
:
|
||||
solidPtr_(new solidType(dict)),
|
||||
specieDict_(dict.subDict("specie")),
|
||||
transportDict_(dict.subDict("transport")),
|
||||
radiationDict_(dict.subDict("radiation")),
|
||||
thermoDict_(dict.subDict("thermodynamics")),
|
||||
densityDict_(dict.subDict("equationOfState"))
|
||||
{}
|
||||
|
||||
|
||||
// Null constructor
|
||||
solidThermoData()
|
||||
:
|
||||
solidPtr_(),
|
||||
specieDict_(),
|
||||
transportDict_(),
|
||||
radiationDict_(),
|
||||
thermoDict_(),
|
||||
densityDict_()
|
||||
{}
|
||||
|
||||
|
||||
// Destructor
|
||||
virtual ~solidThermoData()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
void write(Ostream& os) const
|
||||
{
|
||||
os.writeKeyword("specie");
|
||||
os << specieDict_ << nl;
|
||||
os.writeKeyword("transport");
|
||||
os << transportDict_ << nl;
|
||||
os.writeKeyword("radiation");
|
||||
os << radiationDict_ << nl;
|
||||
os.writeKeyword("thermodynamics");
|
||||
os << thermoDict_ << nl;
|
||||
os.writeKeyword("density");
|
||||
os << densityDict_ << nl;
|
||||
}
|
||||
|
||||
|
||||
scalar kappa(const scalar T) const
|
||||
{
|
||||
return solidPtr_().kappa(T);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
//- Name of the temperature field
|
||||
word TName_;
|
||||
|
||||
@ -138,8 +70,16 @@ class temperatureThermoBaffle1DFvPatchScalarField
|
||||
//- Superficial heat source [W/m2]
|
||||
scalarField Qs_;
|
||||
|
||||
//- Solid thermo
|
||||
autoPtr<solidThermoData> solid_;
|
||||
// Solid thermo
|
||||
autoPtr<solidType> solidPtr_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
scalar kappa(const scalar T) const
|
||||
{
|
||||
return solidPtr_().kappa(T);
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
|
||||
@ -79,7 +79,8 @@ turbulentHeatFluxTemperatureFvPatchScalarField
|
||||
fixedGradientFvPatchScalarField(p, iF),
|
||||
temperatureCoupledBase(patch(), "undefined", "undefined-K"),
|
||||
heatSource_(hsPower),
|
||||
q_(p.size(), 0.0)
|
||||
q_(p.size(), 0.0),
|
||||
QrName_("undefinedQr")
|
||||
{}
|
||||
|
||||
|
||||
@ -95,7 +96,8 @@ turbulentHeatFluxTemperatureFvPatchScalarField
|
||||
fixedGradientFvPatchScalarField(ptf, p, iF, mapper),
|
||||
temperatureCoupledBase(patch(), ptf.KMethod(), ptf.kappaName()),
|
||||
heatSource_(ptf.heatSource_),
|
||||
q_(ptf.q_, mapper)
|
||||
q_(ptf.q_, mapper),
|
||||
QrName_(ptf.QrName_)
|
||||
{}
|
||||
|
||||
|
||||
@ -110,7 +112,8 @@ turbulentHeatFluxTemperatureFvPatchScalarField
|
||||
fixedGradientFvPatchScalarField(p, iF),
|
||||
temperatureCoupledBase(patch(), dict),
|
||||
heatSource_(heatSourceTypeNames_.read(dict.lookup("heatSource"))),
|
||||
q_("q", dict, p.size())
|
||||
q_("q", dict, p.size()),
|
||||
QrName_(dict.lookupOrDefault<word>("Qr", "none"))
|
||||
{
|
||||
fvPatchField<scalar>::operator=(patchInternalField());
|
||||
gradient() = 0.0;
|
||||
@ -126,7 +129,8 @@ turbulentHeatFluxTemperatureFvPatchScalarField
|
||||
fixedGradientFvPatchScalarField(thftpsf),
|
||||
temperatureCoupledBase(patch(), thftpsf.KMethod(), thftpsf.kappaName()),
|
||||
heatSource_(thftpsf.heatSource_),
|
||||
q_(thftpsf.q_)
|
||||
q_(thftpsf.q_),
|
||||
QrName_(thftpsf.QrName_)
|
||||
{}
|
||||
|
||||
|
||||
@ -140,7 +144,8 @@ turbulentHeatFluxTemperatureFvPatchScalarField
|
||||
fixedGradientFvPatchScalarField(thftpsf, iF),
|
||||
temperatureCoupledBase(patch(), thftpsf.KMethod(), thftpsf.kappaName()),
|
||||
heatSource_(thftpsf.heatSource_),
|
||||
q_(thftpsf.q_)
|
||||
q_(thftpsf.q_),
|
||||
QrName_(thftpsf.QrName_)
|
||||
{}
|
||||
|
||||
|
||||
@ -183,17 +188,25 @@ void turbulentHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
|
||||
|
||||
const scalarField& Tp = *this;
|
||||
|
||||
scalarField qr(this->size(), 0.0);
|
||||
|
||||
//- qr is negative going into the domain
|
||||
if (QrName_ != "none")
|
||||
{
|
||||
qr = patch().lookupPatchField<volScalarField, scalar>(QrName_);
|
||||
}
|
||||
|
||||
switch (heatSource_)
|
||||
{
|
||||
case hsPower:
|
||||
{
|
||||
const scalar Ap = gSum(patch().magSf());
|
||||
gradient() = q_/(Ap*kappa(Tp));
|
||||
gradient() = (q_/Ap + qr)/kappa(Tp);
|
||||
break;
|
||||
}
|
||||
case hsFlux:
|
||||
{
|
||||
gradient() = q_/kappa(Tp);
|
||||
gradient() = (q_ + qr)/kappa(Tp);
|
||||
break;
|
||||
}
|
||||
default:
|
||||
@ -220,6 +233,7 @@ void turbulentHeatFluxTemperatureFvPatchScalarField::write
|
||||
<< token::END_STATEMENT << nl;
|
||||
temperatureCoupledBase::write(os);
|
||||
q_.writeEntry("q", os);
|
||||
os.writeKeyword("Qr")<< QrName_ << token::END_STATEMENT << nl;
|
||||
writeEntry("value", os);
|
||||
}
|
||||
|
||||
|
||||
@ -37,6 +37,7 @@ Description
|
||||
heatSource flux; // power [W]; flux [W/m2]
|
||||
q uniform 10; // heat power or flux
|
||||
kappa fluidThermo; // calculate kappa=alphaEff*thermo.Cp
|
||||
Qr none; // name of the radiative flux
|
||||
value uniform 300; // initial temperature value
|
||||
}
|
||||
|
||||
@ -93,6 +94,9 @@ private:
|
||||
//- Heat power [W] or flux [W/m2]
|
||||
scalarField q_;
|
||||
|
||||
//- Name of radiative in flux field
|
||||
word QrName_;
|
||||
|
||||
|
||||
public:
|
||||
|
||||
|
||||
@ -53,7 +53,7 @@ boundaryField
|
||||
|
||||
"(region0_to.*)"
|
||||
{
|
||||
type buoyantPressure;
|
||||
type fixedFluxPressure;
|
||||
value $internalField;
|
||||
}
|
||||
}
|
||||
|
||||
@ -26,6 +26,7 @@ FoamFile
|
||||
empty
|
||||
{
|
||||
type empty;
|
||||
inGroups 1(empty);
|
||||
nFaces 400;
|
||||
startFace 101;
|
||||
}
|
||||
|
||||
@ -32,12 +32,14 @@ FoamFile
|
||||
bottom
|
||||
{
|
||||
type symmetryPlane;
|
||||
inGroups 1(symmetryPlane);
|
||||
nFaces 25;
|
||||
startFace 10415;
|
||||
}
|
||||
top
|
||||
{
|
||||
type symmetryPlane;
|
||||
inGroups 1(symmetryPlane);
|
||||
nFaces 125;
|
||||
startFace 10440;
|
||||
}
|
||||
@ -50,6 +52,7 @@ FoamFile
|
||||
defaultFaces
|
||||
{
|
||||
type empty;
|
||||
inGroups 1(empty);
|
||||
nFaces 10500;
|
||||
startFace 10675;
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ FoamFile
|
||||
|
||||
solvers
|
||||
{
|
||||
p
|
||||
"p.*"
|
||||
{
|
||||
solver PBiCG;
|
||||
preconditioner DILU;
|
||||
@ -25,14 +25,14 @@ solvers
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
"(U|e)"
|
||||
"(U|e).*"
|
||||
{
|
||||
$p;
|
||||
tolerance 1e-05;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
rho
|
||||
"rho.*"
|
||||
{
|
||||
solver PCG;
|
||||
preconditioner DIC;
|
||||
@ -41,9 +41,10 @@ solvers
|
||||
}
|
||||
}
|
||||
|
||||
PISO
|
||||
PIMPLE
|
||||
{
|
||||
nCorrectors 2;
|
||||
nOuterCorrectors 2;
|
||||
nCorrectors 1;
|
||||
nNonOrthogonalCorrectors 0;
|
||||
}
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@ FoamFile
|
||||
empty
|
||||
{
|
||||
type empty;
|
||||
inGroups 1(empty);
|
||||
nFaces 4000;
|
||||
startFace 1001;
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ FoamFile
|
||||
|
||||
solvers
|
||||
{
|
||||
"(p|U|e)"
|
||||
"(p|U|e).*"
|
||||
{
|
||||
solver PBiCG;
|
||||
preconditioner DILU;
|
||||
@ -25,7 +25,7 @@ solvers
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
rho
|
||||
"rho.*"
|
||||
{
|
||||
solver PCG;
|
||||
preconditioner DIC;
|
||||
@ -34,9 +34,10 @@ solvers
|
||||
}
|
||||
}
|
||||
|
||||
PISO
|
||||
PIMPLE
|
||||
{
|
||||
nCorrectors 2;
|
||||
nOuterCorrectors 2;
|
||||
nCorrectors 1;
|
||||
nNonOrthogonalCorrectors 0;
|
||||
}
|
||||
|
||||
|
||||
@ -32,6 +32,7 @@ FoamFile
|
||||
SYMP3
|
||||
{
|
||||
type empty;
|
||||
inGroups 1(empty);
|
||||
nFaces 80000;
|
||||
startFace 80170;
|
||||
}
|
||||
|
||||
@ -17,12 +17,12 @@ FoamFile
|
||||
|
||||
solvers
|
||||
{
|
||||
rho
|
||||
"rho.*"
|
||||
{
|
||||
solver diagonal;
|
||||
}
|
||||
|
||||
p
|
||||
"p.*"
|
||||
{
|
||||
solver PBiCG;
|
||||
preconditioner DILU;
|
||||
@ -30,22 +30,23 @@ solvers
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
"(U|e)"
|
||||
"(U|e).*"
|
||||
{
|
||||
$p;
|
||||
tolerance 1e-9;
|
||||
}
|
||||
|
||||
"(k|epsilon)"
|
||||
"(k|epsilon).*"
|
||||
{
|
||||
$p;
|
||||
tolerance 1e-10;
|
||||
}
|
||||
}
|
||||
|
||||
PISO
|
||||
PIMPLE
|
||||
{
|
||||
nCorrectors 2;
|
||||
nOuterCorrectors 1;
|
||||
nCorrectors 2;
|
||||
nNonOrthogonalCorrectors 0;
|
||||
}
|
||||
|
||||
|
||||
@ -50,6 +50,7 @@ FoamFile
|
||||
defaultFaces
|
||||
{
|
||||
type empty;
|
||||
inGroups 1(empty);
|
||||
nFaces 13272;
|
||||
startFace 13463;
|
||||
}
|
||||
|
||||
@ -17,12 +17,12 @@ FoamFile
|
||||
|
||||
solvers
|
||||
{
|
||||
rho
|
||||
"rho.*"
|
||||
{
|
||||
solver diagonal;
|
||||
}
|
||||
|
||||
p
|
||||
"p.*"
|
||||
{
|
||||
solver PBiCG;
|
||||
preconditioner DILU;
|
||||
@ -30,22 +30,23 @@ solvers
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
"(U|e|R)"
|
||||
"(U|e|R).*"
|
||||
{
|
||||
$p;
|
||||
tolerance 1e-05;
|
||||
}
|
||||
|
||||
"(k|epsilon)"
|
||||
"(k|epsilon).*"
|
||||
{
|
||||
$p;
|
||||
tolerance 1e-08;
|
||||
}
|
||||
}
|
||||
|
||||
PISO
|
||||
PIMPLE
|
||||
{
|
||||
nCorrectors 2;
|
||||
nOuterCorrectors 2;
|
||||
nCorrectors 1;
|
||||
nNonOrthogonalCorrectors 0;
|
||||
}
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@ FoamFile
|
||||
axis
|
||||
{
|
||||
type symmetryPlane;
|
||||
inGroups 1(symmetryPlane);
|
||||
nFaces 120;
|
||||
startFace 7500;
|
||||
}
|
||||
@ -38,12 +39,14 @@ FoamFile
|
||||
back
|
||||
{
|
||||
type empty;
|
||||
inGroups 1(empty);
|
||||
nFaces 3725;
|
||||
startFace 7625;
|
||||
}
|
||||
front
|
||||
{
|
||||
type empty;
|
||||
inGroups 1(empty);
|
||||
nFaces 3725;
|
||||
startFace 11350;
|
||||
}
|
||||
|
||||
@ -17,7 +17,7 @@ FoamFile
|
||||
|
||||
solvers
|
||||
{
|
||||
p
|
||||
"p.*"
|
||||
{
|
||||
solver PBiCG;
|
||||
preconditioner DILU;
|
||||
@ -25,14 +25,14 @@ solvers
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
U
|
||||
"U.*"
|
||||
{
|
||||
$p;
|
||||
tolerance 1e-05;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
rho
|
||||
"rho.*"
|
||||
{
|
||||
solver PCG;
|
||||
preconditioner DIC;
|
||||
@ -41,9 +41,10 @@ solvers
|
||||
}
|
||||
}
|
||||
|
||||
PISO
|
||||
PIMPLE
|
||||
{
|
||||
nCorrectors 2;
|
||||
nOuterCorrectors 2;
|
||||
nCorrectors 1;
|
||||
nNonOrthogonalCorrectors 0;
|
||||
}
|
||||
|
||||
|
||||
@ -15,7 +15,8 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
thermoType heRhoThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>,sensibleEnthalpy>>>>;
|
||||
thermoType heRhoThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>,sensibleEnthalpy>>>>;
|
||||
//thermoType heRhoThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>,sensibleInternalEnergy>>>>;
|
||||
|
||||
pRef 100000;
|
||||
|
||||
|
||||
@ -30,23 +30,19 @@ divSchemes
|
||||
default none;
|
||||
div(phi,U) Gauss upwind;
|
||||
div(phi,h) Gauss upwind;
|
||||
div(phi,e) Gauss upwind;
|
||||
div(phi,k) Gauss upwind;
|
||||
div(phi,epsilon) Gauss upwind;
|
||||
div(phi,R) Gauss upwind;
|
||||
div(phi,K) Gauss linear;
|
||||
div(phi,Ekp) Gauss linear;
|
||||
div(R) Gauss linear;
|
||||
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default none;
|
||||
laplacian(muEff,U) Gauss linear corrected;
|
||||
laplacian(Dp,p_rgh) Gauss linear corrected;
|
||||
laplacian(alphaEff,h) Gauss linear corrected;
|
||||
laplacian(DkEff,k) Gauss linear corrected;
|
||||
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
|
||||
laplacian(DREff,R) Gauss linear corrected;
|
||||
default Gauss linear corrected;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
|
||||
@ -39,7 +39,7 @@ solvers
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
"(U|h|k|epsilon|R)"
|
||||
"(U|h|e|k|epsilon|R)"
|
||||
{
|
||||
solver PBiCG;
|
||||
preconditioner DILU;
|
||||
@ -47,7 +47,7 @@ solvers
|
||||
relTol 0.1;
|
||||
}
|
||||
|
||||
"(U|h|k|epsilon|R)Final"
|
||||
"(U|h|e|k|epsilon|R)Final"
|
||||
{
|
||||
$U;
|
||||
relTol 0;
|
||||
|
||||
@ -27,12 +27,12 @@ gradSchemes
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
div(phi,U) Gauss limitedLinear 0.2;
|
||||
div(phi,K) Gauss limitedLinear 0.2;
|
||||
div(phi,h) Gauss limitedLinear 0.2;
|
||||
div(phi,k) Gauss limitedLinear 0.2;
|
||||
div(phi,epsilon) Gauss limitedLinear 0.2;
|
||||
div(phi,omega) Gauss limitedLinear 0.2;
|
||||
div(phi,U) bounded Gauss limitedLinear 0.2;
|
||||
div(phi,K) bounded Gauss limitedLinear 0.2;
|
||||
div(phi,h) bounded Gauss limitedLinear 0.2;
|
||||
div(phi,k) bounded Gauss limitedLinear 0.2;
|
||||
div(phi,epsilon) bounded Gauss limitedLinear 0.2;
|
||||
div(phi,omega) bounded Gauss limitedLinear 0.2;
|
||||
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
||||
}
|
||||
|
||||
|
||||
@ -15,32 +15,32 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [ 0 1 -1 0 0 0 0 ];
|
||||
dimensions [0 1 -1 0 0 0 0];
|
||||
|
||||
internalField uniform ( 0.1 0 0 );
|
||||
internalField uniform (0.1 0 0);
|
||||
|
||||
boundaryField
|
||||
{
|
||||
floor
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform ( 0 0 0 );
|
||||
value uniform (0 0 0);
|
||||
}
|
||||
ceiling
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform ( 0 0 0 );
|
||||
value uniform (0 0 0);
|
||||
}
|
||||
inlet
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform ( 0.1 0 0 );
|
||||
value uniform (0.1 0 0);
|
||||
}
|
||||
outlet
|
||||
{
|
||||
type inletOutlet;
|
||||
inletValue uniform ( 0 0 0 );
|
||||
value uniform ( 0 0 0 );
|
||||
inletValue uniform (0 0 0);
|
||||
value uniform (0.1 0 0);
|
||||
}
|
||||
fixedWalls
|
||||
{
|
||||
|
||||
@ -44,6 +44,7 @@ FoamFile
|
||||
fixedWalls
|
||||
{
|
||||
type empty;
|
||||
inGroups 1(empty);
|
||||
nFaces 4000;
|
||||
startFace 4062;
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ dictionaryReplacement
|
||||
{
|
||||
"baffle.*"
|
||||
{
|
||||
type buoyantPressure;
|
||||
type fixedFluxPressure;
|
||||
value uniform 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ dictionaryReplacement
|
||||
{
|
||||
"baffle1.*"
|
||||
{
|
||||
type buoyantPressure;
|
||||
type fixedFluxPressure;
|
||||
value $internalField;
|
||||
}
|
||||
}
|
||||
|
||||
@ -78,7 +78,7 @@ dictionaryReplacement
|
||||
{
|
||||
"region0_to_.*"
|
||||
{
|
||||
type buoyantPressure;
|
||||
type fixedFluxPressure;
|
||||
value $internalField;
|
||||
}
|
||||
|
||||
|
||||
@ -27,12 +27,12 @@ gradSchemes
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
div(phi,U) Gauss limitedLinear 0.2;
|
||||
div(phi,K) Gauss limitedLinear 0.2;
|
||||
div(phi,h) Gauss limitedLinear 0.2;
|
||||
div(phi,k) Gauss limitedLinear 0.2;
|
||||
div(phi,epsilon) Gauss limitedLinear 0.2;
|
||||
div(phi,omega) Gauss limitedLinear 0.2;
|
||||
div(phi,U) bounded Gauss limitedLinear 0.2;
|
||||
div(phi,K) bounded Gauss limitedLinear 0.2;
|
||||
div(phi,h) bounded Gauss limitedLinear 0.2;
|
||||
div(phi,k) bounded Gauss limitedLinear 0.2;
|
||||
div(phi,epsilon) bounded Gauss limitedLinear 0.2;
|
||||
div(phi,omega) bounded Gauss limitedLinear 0.2;
|
||||
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
||||
}
|
||||
|
||||
|
||||
@ -16,7 +16,6 @@ FoamFile
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 1 -2 0 0 0 0];
|
||||
value ( 0 -9.81 0 );
|
||||
|
||||
value (0 -9.81 0);
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -15,7 +15,7 @@ FoamFile
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
thermoType hePsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>,sensibleEnthalpy>>>>;
|
||||
thermoType hePsiThermo<pureMixture<constTransport<specieThermo<hConstThermo<perfectGas>,sensibleEnthalpy>>>>;
|
||||
|
||||
pRef 100000;
|
||||
|
||||
|
||||
@ -28,25 +28,17 @@ gradSchemes
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
div(phi,U) Gauss upwind;
|
||||
div(phi,h) Gauss upwind;
|
||||
div(phi,K) Gauss upwind;
|
||||
div(phi,k) Gauss upwind;
|
||||
div(phi,epsilon) Gauss upwind;
|
||||
div(phi,R) Gauss upwind;
|
||||
div(R) Gauss linear;
|
||||
div(phi,U) bounded Gauss upwind;
|
||||
div(phi,h) bounded Gauss upwind;
|
||||
div(phi,K) bounded Gauss upwind;
|
||||
div(phi,k) bounded Gauss upwind;
|
||||
div(phi,epsilon) bounded Gauss upwind;
|
||||
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default none;
|
||||
laplacian(muEff,U) Gauss linear uncorrected;
|
||||
laplacian(Dp,p_rgh) Gauss linear uncorrected;
|
||||
laplacian(alphaEff,h) Gauss linear uncorrected;
|
||||
laplacian(DkEff,k) Gauss linear uncorrected;
|
||||
laplacian(DepsilonEff,epsilon) Gauss linear uncorrected;
|
||||
laplacian(DREff,R) Gauss linear uncorrected;
|
||||
default Gauss linear uncorrected;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
|
||||
@ -21,15 +21,15 @@ solvers
|
||||
{
|
||||
solver PCG;
|
||||
preconditioner DIC;
|
||||
tolerance 1e-08;
|
||||
tolerance 1e-8;
|
||||
relTol 0.01;
|
||||
}
|
||||
|
||||
"(U|h|k|epsilon|R)"
|
||||
"(U|h|e|k|epsilon|R)"
|
||||
{
|
||||
solver PBiCG;
|
||||
preconditioner DILU;
|
||||
tolerance 1e-05;
|
||||
tolerance 1e-6;
|
||||
relTol 0.1;
|
||||
}
|
||||
}
|
||||
@ -45,6 +45,7 @@ SIMPLE
|
||||
p_rgh 1e-2;
|
||||
U 1e-3;
|
||||
h 1e-3;
|
||||
e 1e-3;
|
||||
|
||||
// possibly check turbulence fields
|
||||
"(k|epsilon|omega)" 1e-3;
|
||||
@ -60,8 +61,8 @@ relaxationFactors
|
||||
}
|
||||
equations
|
||||
{
|
||||
U 0.2;
|
||||
h 0.2;
|
||||
U 0.3;
|
||||
"(h|e)" 0.3;
|
||||
"(k|epsilon|R)" 0.5;
|
||||
}
|
||||
}
|
||||
|
||||
@ -28,26 +28,17 @@ gradSchemes
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
div(phi,U) Gauss upwind;
|
||||
div(phi,K) Gauss upwind;
|
||||
div(phi,h) Gauss upwind;
|
||||
div(phi,k) Gauss upwind;
|
||||
div(phi,epsilon) Gauss upwind;
|
||||
div(phi,R) Gauss upwind;
|
||||
div(R) Gauss linear;
|
||||
div(phi,U) bounded Gauss upwind;
|
||||
div(phi,K) bounded Gauss upwind;
|
||||
div(phi,h) bounded Gauss upwind;
|
||||
div(phi,k) bounded Gauss upwind;
|
||||
div(phi,epsilon) bounded Gauss upwind;
|
||||
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default none;
|
||||
laplacian(muEff,U) Gauss linear corrected;
|
||||
laplacian(Dp,p_rgh) Gauss linear corrected;
|
||||
laplacian(alphaEff,h) Gauss linear corrected;
|
||||
laplacian(DkEff,k) Gauss linear corrected;
|
||||
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
|
||||
laplacian(DREff,R) Gauss linear corrected;
|
||||
laplacian(gammaRad,G) Gauss linear corrected;
|
||||
default Gauss linear corrected;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
|
||||
@ -28,27 +28,18 @@ gradSchemes
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
div(phi,U) Gauss upwind;
|
||||
div(phi,K) Gauss upwind;
|
||||
div(phi,h) Gauss upwind;
|
||||
div(phi,k) Gauss upwind;
|
||||
div(phi,epsilon) Gauss upwind;
|
||||
div(phi,R) Gauss upwind;
|
||||
div(R) Gauss linear;
|
||||
div(phi,U) bounded Gauss upwind;
|
||||
div(phi,K) bounded Gauss upwind;
|
||||
div(phi,h) bounded Gauss upwind;
|
||||
div(phi,k) bounded Gauss upwind;
|
||||
div(phi,epsilon) bounded Gauss upwind;
|
||||
div(Ji,Ii_h) Gauss linearUpwind grad(Ii_h);
|
||||
div((muEff*dev2(T(grad(U))))) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default none;
|
||||
laplacian(muEff,U) Gauss linear corrected;
|
||||
laplacian(Dp,p_rgh) Gauss linear corrected;
|
||||
laplacian(alphaEff,h) Gauss linear corrected;
|
||||
laplacian(DkEff,k) Gauss linear corrected;
|
||||
laplacian(DepsilonEff,epsilon) Gauss linear corrected;
|
||||
laplacian(DREff,R) Gauss linear corrected;
|
||||
laplacian(gammaRad,G) Gauss linear corrected;
|
||||
default Gauss linear corrected;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
|
||||
@ -100,7 +100,7 @@ dictionaryReplacement
|
||||
{
|
||||
".*"
|
||||
{
|
||||
type buoyantPressure;
|
||||
type fixedFluxPressure;
|
||||
value uniform 1e5;
|
||||
}
|
||||
}
|
||||
|
||||
@ -135,7 +135,7 @@ dictionaryReplacement
|
||||
{
|
||||
".*"
|
||||
{
|
||||
type buoyantPressure;
|
||||
type fixedFluxPressure;
|
||||
value uniform 1e5;
|
||||
}
|
||||
|
||||
|
||||
@ -149,7 +149,7 @@ dictionaryReplacement
|
||||
|
||||
".*"
|
||||
{
|
||||
type buoyantPressure;
|
||||
type fixedFluxPressure;
|
||||
value uniform 0;
|
||||
}
|
||||
}
|
||||
|
||||
@ -100,7 +100,7 @@ dictionaryReplacement
|
||||
{
|
||||
".*"
|
||||
{
|
||||
type buoyantPressure;
|
||||
type fixedFluxPressure;
|
||||
value uniform 1e5;
|
||||
}
|
||||
}
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user