mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop
This commit is contained in:
@ -52,27 +52,7 @@ volScalarField& p = thermo.p();
|
|||||||
|
|
||||||
#include "compressibleCreatePhi.H"
|
#include "compressibleCreatePhi.H"
|
||||||
|
|
||||||
dimensionedScalar rhoMax
|
pressureControl pressureControl(p, rho, pimple.dict(), false);
|
||||||
(
|
|
||||||
dimensionedScalar::lookupOrDefault
|
|
||||||
(
|
|
||||||
"rhoMax",
|
|
||||||
pimple.dict(),
|
|
||||||
dimDensity,
|
|
||||||
GREAT
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
dimensionedScalar rhoMin
|
|
||||||
(
|
|
||||||
dimensionedScalar::lookupOrDefault
|
|
||||||
(
|
|
||||||
"rhoMin",
|
|
||||||
pimple.dict(),
|
|
||||||
dimDensity,
|
|
||||||
0
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
mesh.setFluxRequired(p.name());
|
mesh.setFluxRequired(p.name());
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,4 @@
|
|||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
rho = max(rho, rhoMin);
|
|
||||||
rho = min(rho, rhoMax);
|
|
||||||
rho.relax();
|
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
@ -87,19 +84,17 @@ else
|
|||||||
// Explicitly relax pressure for momentum corrector
|
// Explicitly relax pressure for momentum corrector
|
||||||
p.relax();
|
p.relax();
|
||||||
|
|
||||||
// Recalculate density from the relaxed pressure
|
|
||||||
rho = thermo.rho();
|
|
||||||
rho = max(rho, rhoMin);
|
|
||||||
rho = min(rho, rhoMax);
|
|
||||||
rho.relax();
|
|
||||||
Info<< "rho max/min : " << max(rho).value()
|
|
||||||
<< " " << min(rho).value() << endl;
|
|
||||||
|
|
||||||
U = HbyA - rAU*fvc::grad(p);
|
U = HbyA - rAU*fvc::grad(p);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
|
|
||||||
|
if (pressureControl.limit(p))
|
||||||
|
{
|
||||||
|
p.correctBoundaryConditions();
|
||||||
|
rho = thermo.rho();
|
||||||
|
}
|
||||||
|
|
||||||
if (thermo.dpdt())
|
if (thermo.dpdt())
|
||||||
{
|
{
|
||||||
dpdt = fvc::ddt(p);
|
dpdt = fvc::ddt(p);
|
||||||
|
|||||||
@ -1,7 +1,4 @@
|
|||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
rho = max(rho, rhoMin);
|
|
||||||
rho = min(rho, rhoMax);
|
|
||||||
rho.relax();
|
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()));
|
volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()));
|
||||||
@ -109,19 +106,13 @@ U.correctBoundaryConditions();
|
|||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
|
|
||||||
|
if (pressureControl.limit(p))
|
||||||
|
{
|
||||||
|
p.correctBoundaryConditions();
|
||||||
|
rho = thermo.rho();
|
||||||
|
}
|
||||||
|
|
||||||
if (thermo.dpdt())
|
if (thermo.dpdt())
|
||||||
{
|
{
|
||||||
dpdt = fvc::ddt(p);
|
dpdt = fvc::ddt(p);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recalculate density from the relaxed pressure
|
|
||||||
rho = thermo.rho();
|
|
||||||
rho = max(rho, rhoMin);
|
|
||||||
rho = min(rho, rhoMax);
|
|
||||||
|
|
||||||
if (!pimple.transonic())
|
|
||||||
{
|
|
||||||
rho.relax();
|
|
||||||
}
|
|
||||||
|
|
||||||
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value() << endl;
|
|
||||||
|
|||||||
@ -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-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -37,6 +37,7 @@ Description
|
|||||||
#include "psiCombustionModel.H"
|
#include "psiCombustionModel.H"
|
||||||
#include "multivariateScheme.H"
|
#include "multivariateScheme.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "pressureControl.H"
|
||||||
#include "fvOptions.H"
|
#include "fvOptions.H"
|
||||||
#include "localEulerDdtScheme.H"
|
#include "localEulerDdtScheme.H"
|
||||||
#include "fvcSmooth.H"
|
#include "fvcSmooth.H"
|
||||||
@ -114,6 +115,8 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rho = thermo.rho();
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
|
|
||||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
{
|
|
||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
// Thermodynamic density needs to be updated by psi*d(p) after the
|
// Thermodynamic density needs to be updated by psi*d(p) after the
|
||||||
// pressure solution - done in 2 parts. Part 1:
|
// pressure solution
|
||||||
thermo.rho() -= psi*p;
|
const volScalarField psip0(psi*p);
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
@ -63,8 +62,8 @@
|
|||||||
|
|
||||||
p = p_rgh + rho*gh;
|
p = p_rgh + rho*gh;
|
||||||
|
|
||||||
// Second part of thermodynamic density update
|
// Thermodynamic density update
|
||||||
thermo.rho() += psi*p;
|
thermo.correctRho(psi*p - psip0);
|
||||||
|
|
||||||
if (thermo.dpdt())
|
if (thermo.dpdt())
|
||||||
{
|
{
|
||||||
@ -73,4 +72,3 @@
|
|||||||
|
|
||||||
#include "rhoEqn.H"
|
#include "rhoEqn.H"
|
||||||
#include "compressibleContinuityErrs.H"
|
#include "compressibleContinuityErrs.H"
|
||||||
}
|
|
||||||
|
|||||||
@ -52,6 +52,8 @@ volScalarField& p = thermo.p();
|
|||||||
|
|
||||||
#include "compressibleCreatePhi.H"
|
#include "compressibleCreatePhi.H"
|
||||||
|
|
||||||
|
pressureControl pressureControl(p, rho, pimple.dict(), false);
|
||||||
|
|
||||||
mesh.setFluxRequired(p.name());
|
mesh.setFluxRequired(p.name());
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -1,109 +0,0 @@
|
|||||||
{
|
|
||||||
rho = thermo.rho();
|
|
||||||
|
|
||||||
// Thermodynamic density needs to be updated by psi*d(p) after the
|
|
||||||
// pressure solution - done in 2 parts. Part 1:
|
|
||||||
thermo.rho() -= psi*p;
|
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
|
||||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
|
||||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
|
||||||
|
|
||||||
if (pimple.transonic())
|
|
||||||
{
|
|
||||||
surfaceScalarField phiHbyA
|
|
||||||
(
|
|
||||||
"phiHbyA",
|
|
||||||
(
|
|
||||||
fvc::flux(HbyA)
|
|
||||||
+ rhorAUf*fvc::ddtCorr(rho, U, phi)/fvc::interpolate(rho)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
MRF.makeRelative(phiHbyA);
|
|
||||||
|
|
||||||
surfaceScalarField phid("phid", fvc::interpolate(thermo.psi())*phiHbyA);
|
|
||||||
|
|
||||||
phiHbyA *= fvc::interpolate(rho);
|
|
||||||
|
|
||||||
fvScalarMatrix pDDtEqn
|
|
||||||
(
|
|
||||||
fvc::ddt(rho) + fvc::div(phiHbyA)
|
|
||||||
+ correction(psi*fvm::ddt(p) + fvm::div(phid, p))
|
|
||||||
);
|
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
|
||||||
{
|
|
||||||
fvScalarMatrix pEqn
|
|
||||||
(
|
|
||||||
pDDtEqn
|
|
||||||
- fvm::laplacian(rhorAUf, p)
|
|
||||||
==
|
|
||||||
fvOptions(psi, p, rho.name())
|
|
||||||
);
|
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
|
||||||
{
|
|
||||||
phi = phiHbyA + pEqn.flux();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
surfaceScalarField phiHbyA
|
|
||||||
(
|
|
||||||
"phiHbyA",
|
|
||||||
(
|
|
||||||
fvc::flux(rho*HbyA)
|
|
||||||
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
|
||||||
|
|
||||||
// Update the pressure BCs to ensure flux consistency
|
|
||||||
constrainPressure(p, rho, U, phiHbyA, rhorAUf, MRF);
|
|
||||||
|
|
||||||
fvScalarMatrix pDDtEqn
|
|
||||||
(
|
|
||||||
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
|
|
||||||
+ fvc::div(phiHbyA)
|
|
||||||
==
|
|
||||||
fvOptions(psi, p, rho.name())
|
|
||||||
);
|
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
|
||||||
{
|
|
||||||
fvScalarMatrix pEqn
|
|
||||||
(
|
|
||||||
pDDtEqn
|
|
||||||
- fvm::laplacian(rhorAUf, p)
|
|
||||||
);
|
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
|
||||||
{
|
|
||||||
phi = phiHbyA + pEqn.flux();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// Second part of thermodynamic density update
|
|
||||||
thermo.rho() += psi*p;
|
|
||||||
|
|
||||||
#include "rhoEqn.H"
|
|
||||||
#include "compressibleContinuityErrs.H"
|
|
||||||
|
|
||||||
U = HbyA - rAU*fvc::grad(p);
|
|
||||||
U.correctBoundaryConditions();
|
|
||||||
fvOptions.correct(U);
|
|
||||||
K = 0.5*magSqr(U);
|
|
||||||
|
|
||||||
if (thermo.dpdt())
|
|
||||||
{
|
|
||||||
dpdt = fvc::ddt(p);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
@ -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-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -38,6 +38,7 @@ Description
|
|||||||
#include "turbulentFluidThermoModel.H"
|
#include "turbulentFluidThermoModel.H"
|
||||||
#include "multivariateScheme.H"
|
#include "multivariateScheme.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "pressureControl.H"
|
||||||
#include "fvOptions.H"
|
#include "fvOptions.H"
|
||||||
#include "localEulerDdtScheme.H"
|
#include "localEulerDdtScheme.H"
|
||||||
#include "fvcSmooth.H"
|
#include "fvcSmooth.H"
|
||||||
@ -100,7 +101,14 @@ int main(int argc, char *argv[])
|
|||||||
// --- Pressure corrector loop
|
// --- Pressure corrector loop
|
||||||
while (pimple.correct())
|
while (pimple.correct())
|
||||||
{
|
{
|
||||||
#include "pEqn.H"
|
if (pimple.consistent())
|
||||||
|
{
|
||||||
|
#include "../../../compressible/rhoPimpleFoam/pcEqn.H"
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
#include "../../../compressible/rhoPimpleFoam/pEqn.H"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (pimple.turbCorr())
|
if (pimple.turbCorr())
|
||||||
|
|||||||
@ -42,6 +42,8 @@ volVectorField U
|
|||||||
|
|
||||||
pressureControl pressureControl(p, rho, pimple.dict(), false);
|
pressureControl pressureControl(p, rho, pimple.dict(), false);
|
||||||
|
|
||||||
|
mesh.setFluxRequired(p.name());
|
||||||
|
|
||||||
Info<< "Creating turbulence model\n" << endl;
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
autoPtr<compressible::turbulenceModel> turbulence
|
autoPtr<compressible::turbulenceModel> turbulence
|
||||||
(
|
(
|
||||||
@ -54,8 +56,6 @@ autoPtr<compressible::turbulenceModel> turbulence
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
mesh.setFluxRequired(p.name());
|
|
||||||
|
|
||||||
Info<< "Creating field dpdt\n" << endl;
|
Info<< "Creating field dpdt\n" << endl;
|
||||||
volScalarField dpdt
|
volScalarField dpdt
|
||||||
(
|
(
|
||||||
@ -73,3 +73,26 @@ Info<< "Creating field kinetic energy K\n" << endl;
|
|||||||
volScalarField K("K", 0.5*magSqr(U));
|
volScalarField K("K", 0.5*magSqr(U));
|
||||||
|
|
||||||
#include "createMRF.H"
|
#include "createMRF.H"
|
||||||
|
|
||||||
|
|
||||||
|
dimensionedScalar rhoMax
|
||||||
|
(
|
||||||
|
dimensionedScalar::lookupOrDefault
|
||||||
|
(
|
||||||
|
"rhoMax",
|
||||||
|
pimple.dict(),
|
||||||
|
dimDensity,
|
||||||
|
GREAT
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
dimensionedScalar rhoMin
|
||||||
|
(
|
||||||
|
dimensionedScalar::lookupOrDefault
|
||||||
|
(
|
||||||
|
"rhoMin",
|
||||||
|
pimple.dict(),
|
||||||
|
dimDensity,
|
||||||
|
0
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|||||||
@ -1,3 +1,12 @@
|
|||||||
|
if (!pimple.SIMPLErho())
|
||||||
|
{
|
||||||
|
rho = thermo.rho();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Thermodynamic density needs to be updated by psi*d(p) after the
|
||||||
|
// pressure solution
|
||||||
|
const volScalarField psip0(psi*p);
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||||
@ -10,7 +19,7 @@ if (pimple.nCorrPISO() <= 1)
|
|||||||
surfaceScalarField phiHbyA
|
surfaceScalarField phiHbyA
|
||||||
(
|
(
|
||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
fvc::flux(rho*HbyA)
|
fvc::interpolate(rho)*fvc::flux(HbyA)
|
||||||
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
+ rhorAUf*fvc::ddtCorr(rho, U, phi)
|
||||||
);
|
);
|
||||||
|
|
||||||
@ -26,20 +35,21 @@ if (pimple.transonic())
|
|||||||
"phid",
|
"phid",
|
||||||
(fvc::interpolate(psi)/fvc::interpolate(rho))*phiHbyA
|
(fvc::interpolate(psi)/fvc::interpolate(rho))*phiHbyA
|
||||||
);
|
);
|
||||||
phiHbyA -= fvc::interpolate(p)*phid;
|
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
phiHbyA -= fvc::interpolate(psi*p)*phiHbyA/fvc::interpolate(rho);
|
||||||
{
|
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pDDtEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA) + fvm::div(phid, p)
|
||||||
+ fvm::div(phid, p)
|
|
||||||
- fvm::laplacian(rhorAUf, p)
|
|
||||||
==
|
==
|
||||||
fvOptions(psi, p, rho.name())
|
fvOptions(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
while (pimple.correctNonOrthogonal())
|
||||||
|
{
|
||||||
|
fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAUf, p));
|
||||||
|
|
||||||
// Relax the pressure equation to ensure diagonal-dominance
|
// Relax the pressure equation to ensure diagonal-dominance
|
||||||
pEqn.relax();
|
pEqn.relax();
|
||||||
|
|
||||||
@ -53,17 +63,18 @@ if (pimple.transonic())
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
while (pimple.correctNonOrthogonal())
|
fvScalarMatrix pDDtEqn
|
||||||
{
|
|
||||||
fvScalarMatrix pEqn
|
|
||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA)
|
||||||
- fvm::laplacian(rhorAUf, p)
|
|
||||||
==
|
==
|
||||||
fvOptions(psi, p, rho.name())
|
fvOptions(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
while (pimple.correctNonOrthogonal())
|
||||||
|
{
|
||||||
|
fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAUf, p));
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
@ -84,15 +95,14 @@ U.correctBoundaryConditions();
|
|||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
|
|
||||||
pressureControl.limit(p);
|
if (pressureControl.limit(p))
|
||||||
p.correctBoundaryConditions();
|
|
||||||
rho = thermo.rho();
|
|
||||||
|
|
||||||
if (!pimple.transonic())
|
|
||||||
{
|
{
|
||||||
rho.relax();
|
p.correctBoundaryConditions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
thermo.correctRho(psi*p - psip0, rhoMin, rhoMax) ;
|
||||||
|
rho = thermo.rho();
|
||||||
|
|
||||||
if (thermo.dpdt())
|
if (thermo.dpdt())
|
||||||
{
|
{
|
||||||
dpdt = fvc::ddt(p);
|
dpdt = fvc::ddt(p);
|
||||||
|
|||||||
@ -1,3 +1,12 @@
|
|||||||
|
if (!pimple.SIMPLErho())
|
||||||
|
{
|
||||||
|
rho = thermo.rho();
|
||||||
|
}
|
||||||
|
|
||||||
|
// Thermodynamic density needs to be updated by psi*d(p) after the
|
||||||
|
// pressure solution
|
||||||
|
const volScalarField psip0(psi*p);
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()));
|
volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()));
|
||||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||||
@ -11,7 +20,7 @@ surfaceScalarField phiHbyA
|
|||||||
(
|
(
|
||||||
"phiHbyA",
|
"phiHbyA",
|
||||||
(
|
(
|
||||||
fvc::flux(rho*HbyA)
|
fvc::interpolate(rho)*fvc::flux(HbyA)
|
||||||
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi)
|
+ fvc::interpolate(rho*rAU)*fvc::ddtCorr(rho, U, phi)
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
@ -33,22 +42,22 @@ if (pimple.transonic())
|
|||||||
|
|
||||||
phiHbyA +=
|
phiHbyA +=
|
||||||
fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf()
|
fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf()
|
||||||
- fvc::interpolate(p)*phid;
|
- fvc::interpolate(psi*p)*phiHbyA/fvc::interpolate(rho);
|
||||||
|
|
||||||
HbyA -= (rAU - rAtU)*fvc::grad(p);
|
HbyA -= (rAU - rAtU)*fvc::grad(p);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
fvScalarMatrix pDDtEqn
|
||||||
{
|
|
||||||
fvScalarMatrix pEqn
|
|
||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA) + fvm::div(phid, p)
|
||||||
+ fvm::div(phid, p)
|
|
||||||
- fvm::laplacian(rhorAtU, p)
|
|
||||||
==
|
==
|
||||||
fvOptions(psi, p, rho.name())
|
fvOptions(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
while (pimple.correctNonOrthogonal())
|
||||||
|
{
|
||||||
|
fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAtU, p));
|
||||||
|
|
||||||
// Relax the pressure equation to ensure diagonal-dominance
|
// Relax the pressure equation to ensure diagonal-dominance
|
||||||
pEqn.relax();
|
pEqn.relax();
|
||||||
|
|
||||||
@ -65,17 +74,18 @@ else
|
|||||||
phiHbyA += fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf();
|
phiHbyA += fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf();
|
||||||
HbyA -= (rAU - rAtU)*fvc::grad(p);
|
HbyA -= (rAU - rAtU)*fvc::grad(p);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
fvScalarMatrix pDDtEqn
|
||||||
{
|
|
||||||
fvScalarMatrix pEqn
|
|
||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA)
|
||||||
- fvm::laplacian(rhorAtU, p)
|
|
||||||
==
|
==
|
||||||
fvOptions(psi, p, rho.name())
|
fvOptions(psi, p, rho.name())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
while (pimple.correctNonOrthogonal())
|
||||||
|
{
|
||||||
|
fvScalarMatrix pEqn(pDDtEqn - fvm::laplacian(rhorAtU, p));
|
||||||
|
|
||||||
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
pEqn.solve(mesh.solver(p.select(pimple.finalInnerIter())));
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
@ -96,13 +106,20 @@ U.correctBoundaryConditions();
|
|||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
|
|
||||||
pressureControl.limit(p);
|
if (pressureControl.limit(p))
|
||||||
p.correctBoundaryConditions();
|
|
||||||
rho = thermo.rho();
|
|
||||||
|
|
||||||
if (!pimple.transonic())
|
|
||||||
{
|
{
|
||||||
rho.relax();
|
p.correctBoundaryConditions();
|
||||||
|
thermo.correctRho(psi*p - psip0, rhoMin, rhoMax);
|
||||||
|
rho = thermo.rho();
|
||||||
|
}
|
||||||
|
else if (pimple.SIMPLErho())
|
||||||
|
{
|
||||||
|
thermo.correctRho(psi*p - psip0, rhoMin, rhoMax);
|
||||||
|
rho = thermo.rho();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
thermo.correctRho(psi*p - psip0, rhoMin, rhoMax);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (thermo.dpdt())
|
if (thermo.dpdt())
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
rho = thermo.rho();
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||||
@ -27,13 +29,14 @@ if (pimple.transonic())
|
|||||||
"phid",
|
"phid",
|
||||||
(fvc::interpolate(psi)/fvc::interpolate(rho))*phiHbyA
|
(fvc::interpolate(psi)/fvc::interpolate(rho))*phiHbyA
|
||||||
);
|
);
|
||||||
phiHbyA -= fvc::interpolate(p)*phid;
|
|
||||||
|
phiHbyA -= fvc::interpolate(psi*p)*phiHbyA/fvc::interpolate(rho);
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
- fvm::laplacian(rhorAUf, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
@ -59,7 +62,7 @@ else
|
|||||||
// Pressure corrector
|
// Pressure corrector
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvc::ddt(rho) + psi*correction(fvm::ddt(p))
|
||||||
+ fvc::div(phiHbyA)
|
+ fvc::div(phiHbyA)
|
||||||
- fvm::laplacian(rhorAUf, p)
|
- fvm::laplacian(rhorAUf, p)
|
||||||
==
|
==
|
||||||
@ -86,13 +89,10 @@ U.correctBoundaryConditions();
|
|||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
K = 0.5*magSqr(U);
|
K = 0.5*magSqr(U);
|
||||||
|
|
||||||
pressureControl.limit(p);
|
if (pressureControl.limit(p))
|
||||||
|
{
|
||||||
p.correctBoundaryConditions();
|
p.correctBoundaryConditions();
|
||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
if (!pimple.transonic())
|
|
||||||
{
|
|
||||||
rho.relax();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
{
|
||||||
|
|||||||
@ -122,6 +122,8 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
rho = thermo.rho();
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
|
|
||||||
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
Info<< "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
{
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||||
@ -6,7 +5,7 @@
|
|||||||
|
|
||||||
bool closedVolume = false;
|
bool closedVolume = false;
|
||||||
|
|
||||||
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
|
surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(rho)*fvc::flux(HbyA));
|
||||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
// Update the pressure BCs to ensure flux consistency
|
// Update the pressure BCs to ensure flux consistency
|
||||||
@ -19,7 +18,8 @@
|
|||||||
"phid",
|
"phid",
|
||||||
(fvc::interpolate(psi)/fvc::interpolate(rho))*phiHbyA
|
(fvc::interpolate(psi)/fvc::interpolate(rho))*phiHbyA
|
||||||
);
|
);
|
||||||
phiHbyA -= fvc::interpolate(p)*phid;
|
|
||||||
|
phiHbyA -= fvc::interpolate(psi*p)*phiHbyA/fvc::interpolate(rho);
|
||||||
|
|
||||||
while (simple.correctNonOrthogonal())
|
while (simple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
@ -78,7 +78,6 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
#include "incompressible/continuityErrs.H"
|
#include "incompressible/continuityErrs.H"
|
||||||
|
|
||||||
// Explicitly relax pressure for momentum corrector
|
// Explicitly relax pressure for momentum corrector
|
||||||
@ -88,7 +87,7 @@
|
|||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
|
|
||||||
pressureControl.limit(p);
|
bool pLimited = pressureControl.limit(p);
|
||||||
|
|
||||||
// For closed-volume cases adjust the pressure and density levels
|
// For closed-volume cases adjust the pressure and density levels
|
||||||
// to obey overall mass continuity
|
// to obey overall mass continuity
|
||||||
@ -98,7 +97,10 @@
|
|||||||
/fvc::domainIntegrate(psi);
|
/fvc::domainIntegrate(psi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pLimited || closedVolume)
|
||||||
|
{
|
||||||
p.correctBoundaryConditions();
|
p.correctBoundaryConditions();
|
||||||
|
}
|
||||||
|
|
||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
@ -106,4 +108,3 @@
|
|||||||
{
|
{
|
||||||
rho.relax();
|
rho.relax();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|||||||
@ -1,3 +1,5 @@
|
|||||||
|
rho = thermo.rho();
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()));
|
volScalarField rAtU(1.0/(1.0/rAU - UEqn.H1()));
|
||||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p));
|
||||||
@ -5,7 +7,7 @@ tUEqn.clear();
|
|||||||
|
|
||||||
bool closedVolume = false;
|
bool closedVolume = false;
|
||||||
|
|
||||||
surfaceScalarField phiHbyA("phiHbyA", fvc::flux(rho*HbyA));
|
surfaceScalarField phiHbyA("phiHbyA", fvc::interpolate(rho)*fvc::flux(HbyA));
|
||||||
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
MRF.makeRelative(fvc::interpolate(rho), phiHbyA);
|
||||||
|
|
||||||
volScalarField rhorAtU("rhorAtU", rho*rAtU);
|
volScalarField rhorAtU("rhorAtU", rho*rAtU);
|
||||||
@ -23,7 +25,7 @@ if (simple.transonic())
|
|||||||
|
|
||||||
phiHbyA +=
|
phiHbyA +=
|
||||||
fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf()
|
fvc::interpolate(rho*(rAtU - rAU))*fvc::snGrad(p)*mesh.magSf()
|
||||||
- fvc::interpolate(p)*phid;
|
- fvc::interpolate(psi*p)*phiHbyA/fvc::interpolate(rho);
|
||||||
|
|
||||||
HbyA -= (rAU - rAtU)*fvc::grad(p);
|
HbyA -= (rAU - rAtU)*fvc::grad(p);
|
||||||
|
|
||||||
@ -98,7 +100,7 @@ U = HbyA - rAtU*fvc::grad(p);
|
|||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
fvOptions.correct(U);
|
fvOptions.correct(U);
|
||||||
|
|
||||||
pressureControl.limit(p);
|
bool pLimited = pressureControl.limit(p);
|
||||||
|
|
||||||
// For closed-volume cases adjust the pressure and density levels
|
// For closed-volume cases adjust the pressure and density levels
|
||||||
// to obey overall mass continuity
|
// to obey overall mass continuity
|
||||||
@ -108,9 +110,11 @@ if (closedVolume)
|
|||||||
/fvc::domainIntegrate(psi);
|
/fvc::domainIntegrate(psi);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (pLimited || closedVolume)
|
||||||
|
{
|
||||||
p.correctBoundaryConditions();
|
p.correctBoundaryConditions();
|
||||||
|
}
|
||||||
|
|
||||||
// Recalculate density from the relaxed pressure
|
|
||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
if (!simple.transonic())
|
if (!simple.transonic())
|
||||||
|
|||||||
@ -1,5 +1,3 @@
|
|||||||
{
|
|
||||||
bool closedVolume = p_rgh.needReference();
|
|
||||||
|
|
||||||
dimensionedScalar compressibility = fvc::domainIntegrate(psi);
|
dimensionedScalar compressibility = fvc::domainIntegrate(psi);
|
||||||
bool compressible = (compressibility.value() > SMALL);
|
bool compressible = (compressibility.value() > SMALL);
|
||||||
@ -7,8 +5,8 @@
|
|||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
// Thermodynamic density needs to be updated by psi*d(p) after the
|
// Thermodynamic density needs to be updated by psi*d(p) after the
|
||||||
// pressure solution - done in 2 parts. Part 1:
|
// pressure solution
|
||||||
thermo.rho() -= psi*p_rgh;
|
const volScalarField psip0(psi*p);
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
@ -31,28 +29,26 @@
|
|||||||
// Update the pressure BCs to ensure flux consistency
|
// Update the pressure BCs to ensure flux consistency
|
||||||
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF);
|
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF);
|
||||||
|
|
||||||
tmp<fvScalarMatrix> p_rghDDtEqn
|
fvScalarMatrix p_rghDDtEqn
|
||||||
(
|
|
||||||
new fvScalarMatrix(p_rgh, dimMass/dimTime)
|
|
||||||
);
|
|
||||||
|
|
||||||
if (compressible)
|
|
||||||
{
|
|
||||||
p_rghDDtEqn =
|
|
||||||
(
|
(
|
||||||
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
|
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
|
||||||
|
+ fvc::div(phiHbyA)
|
||||||
|
==
|
||||||
|
fvOptions(psi, p_rgh, rho.name())
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
while (pimple.correctNonOrthogonal())
|
while (pimple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
fvScalarMatrix p_rghEqn
|
fvScalarMatrix p_rghEqn
|
||||||
(
|
(
|
||||||
p_rghDDtEqn()
|
p_rghDDtEqn
|
||||||
+ fvc::div(phiHbyA)
|
|
||||||
- fvm::laplacian(rhorAUf, p_rgh)
|
- fvm::laplacian(rhorAUf, p_rgh)
|
||||||
==
|
);
|
||||||
fvOptions(psi, p_rgh, rho.name())
|
|
||||||
|
p_rghEqn.setReference
|
||||||
|
(
|
||||||
|
pRefCell,
|
||||||
|
compressible ? getRefCellValue(p_rgh, pRefCell) : pRefValue
|
||||||
);
|
);
|
||||||
|
|
||||||
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
|
p_rghEqn.solve(mesh.solver(p_rgh.select(pimple.finalInnerIter())));
|
||||||
@ -76,21 +72,10 @@
|
|||||||
|
|
||||||
p = p_rgh + rho*gh;
|
p = p_rgh + rho*gh;
|
||||||
|
|
||||||
// Second part of thermodynamic density update
|
|
||||||
thermo.rho() += psi*p_rgh;
|
|
||||||
|
|
||||||
if (thermo.dpdt())
|
|
||||||
{
|
|
||||||
dpdt = fvc::ddt(p);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (compressible)
|
|
||||||
{
|
|
||||||
#include "rhoEqn.H"
|
#include "rhoEqn.H"
|
||||||
}
|
|
||||||
#include "compressibleContinuityErrs.H"
|
#include "compressibleContinuityErrs.H"
|
||||||
|
|
||||||
if (closedVolume)
|
if (p_rgh.needReference())
|
||||||
{
|
{
|
||||||
if (!compressible)
|
if (!compressible)
|
||||||
{
|
{
|
||||||
@ -103,13 +88,21 @@
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
p += (initialMass - fvc::domainIntegrate(thermo.rho()))
|
p += (initialMass - fvc::domainIntegrate(psi*p))
|
||||||
/compressibility;
|
/compressibility;
|
||||||
|
thermo.correctRho(psi*p - psip0);
|
||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
}
|
|
||||||
p_rgh = p - rho*gh;
|
p_rgh = p - rho*gh;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
Info<< "rho max/min : " << max(rho).value() << " " << min(rho).value()
|
else
|
||||||
<< endl;
|
{
|
||||||
|
thermo.correctRho(psi*p - psip0);
|
||||||
|
}
|
||||||
|
|
||||||
|
rho = thermo.rho();
|
||||||
|
|
||||||
|
if (thermo.dpdt())
|
||||||
|
{
|
||||||
|
dpdt = fvc::ddt(p);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -88,3 +88,26 @@ dimensionedScalar totalVolume = sum(mesh.V());
|
|||||||
|
|
||||||
#include "createMRF.H"
|
#include "createMRF.H"
|
||||||
#include "createRadiationModel.H"
|
#include "createRadiationModel.H"
|
||||||
|
|
||||||
|
dimensionedScalar rhoMax
|
||||||
|
(
|
||||||
|
dimensionedScalar::lookupOrDefault
|
||||||
|
(
|
||||||
|
"rhoMax",
|
||||||
|
simple.dict(),
|
||||||
|
dimDensity,
|
||||||
|
GREAT
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
dimensionedScalar rhoMin
|
||||||
|
(
|
||||||
|
dimensionedScalar::lookupOrDefault
|
||||||
|
(
|
||||||
|
"rhoMin",
|
||||||
|
simple.dict(),
|
||||||
|
dimDensity,
|
||||||
|
0
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
|||||||
@ -1,7 +1,4 @@
|
|||||||
{
|
{
|
||||||
rho = thermo.rho();
|
|
||||||
rho.relax();
|
|
||||||
|
|
||||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
|
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
|
||||||
@ -24,6 +21,8 @@
|
|||||||
// Update the pressure BCs to ensure flux consistency
|
// Update the pressure BCs to ensure flux consistency
|
||||||
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF);
|
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF);
|
||||||
|
|
||||||
|
dimensionedScalar compressibility = fvc::domainIntegrate(psi);
|
||||||
|
bool compressible = (compressibility.value() > SMALL);
|
||||||
|
|
||||||
while (simple.correctNonOrthogonal())
|
while (simple.correctNonOrthogonal())
|
||||||
{
|
{
|
||||||
@ -32,7 +31,12 @@
|
|||||||
fvm::laplacian(rhorAUf, p_rgh) == fvc::div(phiHbyA)
|
fvm::laplacian(rhorAUf, p_rgh) == fvc::div(phiHbyA)
|
||||||
);
|
);
|
||||||
|
|
||||||
p_rghEqn.setReference(pRefCell, getRefCellValue(p_rgh, pRefCell));
|
p_rghEqn.setReference
|
||||||
|
(
|
||||||
|
pRefCell,
|
||||||
|
compressible ? getRefCellValue(p_rgh, pRefCell) : pRefValue
|
||||||
|
);
|
||||||
|
|
||||||
p_rghEqn.solve();
|
p_rghEqn.solve();
|
||||||
|
|
||||||
if (simple.finalNonOrthogonalIter())
|
if (simple.finalNonOrthogonalIter())
|
||||||
@ -51,12 +55,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "continuityErrs.H"
|
|
||||||
|
|
||||||
p = p_rgh + rho*gh;
|
p = p_rgh + rho*gh;
|
||||||
|
|
||||||
dimensionedScalar compressibility = fvc::domainIntegrate(psi);
|
#include "continuityErrs.H"
|
||||||
bool compressible = (compressibility.value() > SMALL);
|
|
||||||
|
|
||||||
// For closed-volume cases adjust the pressure level
|
// For closed-volume cases adjust the pressure level
|
||||||
// to obey overall mass continuity
|
// to obey overall mass continuity
|
||||||
@ -75,9 +76,9 @@
|
|||||||
{
|
{
|
||||||
p += (initialMass - fvc::domainIntegrate(psi*p))
|
p += (initialMass - fvc::domainIntegrate(psi*p))
|
||||||
/fvc::domainIntegrate(psi);
|
/fvc::domainIntegrate(psi);
|
||||||
}
|
|
||||||
p_rgh = p - rho*gh;
|
p_rgh = p - rho*gh;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
rho.relax();
|
rho.relax();
|
||||||
|
|||||||
@ -1,8 +1,10 @@
|
|||||||
{
|
{
|
||||||
|
/*
|
||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
rho = max(rho, rhoMin[i]);
|
rho = max(rho, rhoMin[i]);
|
||||||
rho = min(rho, rhoMax[i]);
|
rho = min(rho, rhoMax[i]);
|
||||||
rho.relax();
|
rho.relax();
|
||||||
|
*/
|
||||||
|
|
||||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
@ -67,12 +69,24 @@
|
|||||||
|
|
||||||
// For closed-volume cases adjust the pressure level
|
// For closed-volume cases adjust the pressure level
|
||||||
// to obey overall mass continuity
|
// to obey overall mass continuity
|
||||||
if (closedVolume && compressible)
|
if (closedVolume)
|
||||||
{
|
{
|
||||||
p += (initialMass - fvc::domainIntegrate(thermo.rho()))
|
if (!compressible)
|
||||||
|
{
|
||||||
|
p += dimensionedScalar
|
||||||
|
(
|
||||||
|
"p",
|
||||||
|
p.dimensions(),
|
||||||
|
pRefValue - getRefCellValue(p, pRefCell)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p += (initialMass - fvc::domainIntegrate(psi*p))
|
||||||
/compressibility;
|
/compressibility;
|
||||||
p_rgh = p - rho*gh;
|
p_rgh = p - rho*gh;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
rho = max(rho, rhoMin[i]);
|
rho = max(rho, rhoMin[i]);
|
||||||
|
|||||||
@ -19,6 +19,9 @@ List<bool> frozenFlowFluid(fluidRegions.size(), false);
|
|||||||
PtrList<IOMRFZoneList> MRFfluid(fluidRegions.size());
|
PtrList<IOMRFZoneList> MRFfluid(fluidRegions.size());
|
||||||
PtrList<fv::options> fluidFvOptions(fluidRegions.size());
|
PtrList<fv::options> fluidFvOptions(fluidRegions.size());
|
||||||
|
|
||||||
|
List<label> refCellFluid(fluidRegions.size());
|
||||||
|
List<scalar> refValueFluid(fluidRegions.size());
|
||||||
|
|
||||||
// Populate fluid field pointer lists
|
// Populate fluid field pointer lists
|
||||||
forAll(fluidRegions, i)
|
forAll(fluidRegions, i)
|
||||||
{
|
{
|
||||||
@ -248,4 +251,20 @@ forAll(fluidRegions, i)
|
|||||||
);
|
);
|
||||||
|
|
||||||
turbulence[i].validate();
|
turbulence[i].validate();
|
||||||
|
|
||||||
|
refCellFluid[i] = 0;
|
||||||
|
refValueFluid[i] = 0.0;
|
||||||
|
|
||||||
|
if (p_rghFluid[i].needReference())
|
||||||
|
{
|
||||||
|
setRefCell
|
||||||
|
(
|
||||||
|
thermoFluid[i].p(),
|
||||||
|
p_rghFluid[i],
|
||||||
|
pimpleDict,
|
||||||
|
refCellFluid[i],
|
||||||
|
refValueFluid[i]
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,13 @@
|
|||||||
{
|
|
||||||
bool closedVolume = p_rgh.needReference();
|
bool closedVolume = p_rgh.needReference();
|
||||||
dimensionedScalar compressibility = fvc::domainIntegrate(psi);
|
dimensionedScalar compressibility = fvc::domainIntegrate(psi);
|
||||||
bool compressible = (compressibility.value() > SMALL);
|
bool compressible = (compressibility.value() > SMALL);
|
||||||
|
|
||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
|
// Thermodynamic density needs to be updated by psi*d(p) after the
|
||||||
|
// pressure solution
|
||||||
|
const volScalarField psip0(psi*p);
|
||||||
|
|
||||||
volScalarField rAU("rAU", 1.0/UEqn.A());
|
volScalarField rAU("rAU", 1.0/UEqn.A());
|
||||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
|
volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U, p_rgh));
|
||||||
@ -26,35 +29,27 @@
|
|||||||
// Update the pressure BCs to ensure flux consistency
|
// Update the pressure BCs to ensure flux consistency
|
||||||
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF);
|
constrainPressure(p_rgh, rho, U, phiHbyA, rhorAUf, MRF);
|
||||||
|
|
||||||
tmp<fvScalarMatrix> p_rghDDtEqn
|
|
||||||
(
|
|
||||||
new fvScalarMatrix(p_rgh, dimMass/dimTime)
|
|
||||||
);
|
|
||||||
|
|
||||||
{
|
{
|
||||||
if (compressible)
|
fvScalarMatrix p_rghDDtEqn
|
||||||
{
|
|
||||||
p_rghDDtEqn =
|
|
||||||
(
|
(
|
||||||
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
|
fvc::ddt(rho) + psi*correction(fvm::ddt(p_rgh))
|
||||||
==
|
+ fvc::div(phiHbyA)
|
||||||
fvOptions(psi, p_rgh, rho.name())
|
|
||||||
);
|
);
|
||||||
}
|
|
||||||
|
|
||||||
// Thermodynamic density needs to be updated by psi*d(p) after the
|
|
||||||
// pressure solution - done in 2 parts. Part 1:
|
|
||||||
thermo.rho() -= psi*p_rgh;
|
|
||||||
|
|
||||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
||||||
{
|
{
|
||||||
fvScalarMatrix p_rghEqn
|
fvScalarMatrix p_rghEqn
|
||||||
(
|
(
|
||||||
p_rghDDtEqn()
|
p_rghDDtEqn
|
||||||
+ fvc::div(phiHbyA)
|
|
||||||
- fvm::laplacian(rhorAUf, p_rgh)
|
- fvm::laplacian(rhorAUf, p_rgh)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
p_rghEqn.setReference
|
||||||
|
(
|
||||||
|
pRefCell,
|
||||||
|
compressible ? getRefCellValue(p_rgh, pRefCell) : pRefValue
|
||||||
|
);
|
||||||
|
|
||||||
p_rghEqn.solve
|
p_rghEqn.solve
|
||||||
(
|
(
|
||||||
mesh.solver
|
mesh.solver
|
||||||
@ -73,6 +68,9 @@
|
|||||||
if (nonOrth == nNonOrthCorr)
|
if (nonOrth == nNonOrthCorr)
|
||||||
{
|
{
|
||||||
phi = phiHbyA + p_rghEqn.flux();
|
phi = phiHbyA + p_rghEqn.flux();
|
||||||
|
|
||||||
|
p_rgh.relax();
|
||||||
|
|
||||||
U = HbyA
|
U = HbyA
|
||||||
+ rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf);
|
+ rAU*fvc::reconstruct((phig + p_rghEqn.flux())/rhorAUf);
|
||||||
U.correctBoundaryConditions();
|
U.correctBoundaryConditions();
|
||||||
@ -81,34 +79,51 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Second part of thermodynamic density update
|
|
||||||
thermo.rho() += psi*p_rgh;
|
|
||||||
}
|
|
||||||
|
|
||||||
p = p_rgh + rho*gh;
|
p = p_rgh + rho*gh;
|
||||||
|
|
||||||
// Update pressure time derivative if needed
|
// Thermodynamic density update
|
||||||
if (thermo.dpdt())
|
//thermo.correctRho(psi*p - psip0);
|
||||||
{
|
|
||||||
dpdt = fvc::ddt(p);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (compressible)
|
|
||||||
{
|
|
||||||
// Solve continuity
|
// Solve continuity
|
||||||
#include "rhoEqn.H"
|
#include "rhoEqn.H"
|
||||||
}
|
|
||||||
|
|
||||||
// Update continuity errors
|
// Update continuity errors
|
||||||
#include "compressibleContinuityErrors.H"
|
#include "compressibleContinuityErrors.H"
|
||||||
|
|
||||||
// For closed-volume cases adjust the pressure and density levels
|
// For closed-volume cases adjust the pressure and density levels
|
||||||
// to obey overall mass continuity
|
// to obey overall mass continuity
|
||||||
if (closedVolume && compressible)
|
if (closedVolume)
|
||||||
{
|
{
|
||||||
p += (initialMass - fvc::domainIntegrate(thermo.rho()))
|
if (!compressible)
|
||||||
|
{
|
||||||
|
p += dimensionedScalar
|
||||||
|
(
|
||||||
|
"p",
|
||||||
|
p.dimensions(),
|
||||||
|
pRefValue - getRefCellValue(p, pRefCell)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
p += (initialMass - fvc::domainIntegrate(psi*p))
|
||||||
/compressibility;
|
/compressibility;
|
||||||
|
thermo.correctRho(psi*p - psip0);
|
||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
p_rgh = p - rho*gh;
|
p_rgh = p - rho*gh;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
thermo.correctRho(psi*p - psip0);
|
||||||
|
}
|
||||||
|
|
||||||
|
rho = thermo.rho();
|
||||||
|
|
||||||
|
// Update pressure time derivative if needed
|
||||||
|
if (thermo.dpdt())
|
||||||
|
{
|
||||||
|
dpdt = fvc::ddt(p);
|
||||||
|
}
|
||||||
|
|||||||
@ -33,3 +33,6 @@
|
|||||||
);
|
);
|
||||||
|
|
||||||
const bool frozenFlow = frozenFlowFluid[i];
|
const bool frozenFlow = frozenFlowFluid[i];
|
||||||
|
|
||||||
|
const label pRefCell = refCellFluid[i];
|
||||||
|
const scalar pRefValue = refValueFluid[i];
|
||||||
|
|||||||
@ -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-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -42,6 +42,7 @@ Description
|
|||||||
#include "radiationModel.H"
|
#include "radiationModel.H"
|
||||||
#include "SLGThermo.H"
|
#include "SLGThermo.H"
|
||||||
#include "pimpleControl.H"
|
#include "pimpleControl.H"
|
||||||
|
#include "pressureControl.H"
|
||||||
#include "localEulerDdtScheme.H"
|
#include "localEulerDdtScheme.H"
|
||||||
#include "fvcSmooth.H"
|
#include "fvcSmooth.H"
|
||||||
|
|
||||||
|
|||||||
@ -1,9 +1,8 @@
|
|||||||
{
|
|
||||||
rho = thermo.rho();
|
rho = thermo.rho();
|
||||||
|
|
||||||
// Thermodynamic density needs to be updated by psi*d(p) after the
|
// Thermodynamic density needs to be updated by psi*d(p) after the
|
||||||
// pressure solution - done in 2 parts. Part 1:
|
// pressure solution
|
||||||
thermo.rho() -= psi*p;
|
const volScalarField psip0(psi*p);
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
@ -49,8 +48,8 @@
|
|||||||
|
|
||||||
p.relax();
|
p.relax();
|
||||||
|
|
||||||
// Second part of thermodynamic density update
|
// Thermodynamic density update
|
||||||
thermo.rho() += psi*p;
|
thermo.correctRho(psi*p - psip0);
|
||||||
|
|
||||||
#include "rhoEqn.H" // NOTE: flux and time scales now inconsistent
|
#include "rhoEqn.H" // NOTE: flux and time scales now inconsistent
|
||||||
#include "compressibleContinuityErrs.H"
|
#include "compressibleContinuityErrs.H"
|
||||||
@ -70,4 +69,3 @@
|
|||||||
rho = min(rho, rhoMax);
|
rho = min(rho, rhoMax);
|
||||||
|
|
||||||
Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
|
Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
|
||||||
}
|
|
||||||
|
|||||||
@ -1,7 +1,6 @@
|
|||||||
{
|
|
||||||
// Thermodynamic density needs to be updated by psi*d(p) after the
|
// Thermodynamic density needs to be updated by psi*d(p) after the
|
||||||
// pressure solution - done in 2 parts. Part 1:
|
// pressure solution
|
||||||
thermo.rho() -= psi*p;
|
const volScalarField psip0(psi*p);
|
||||||
|
|
||||||
volScalarField rAU(1.0/UEqn.A());
|
volScalarField rAU(1.0/UEqn.A());
|
||||||
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
surfaceScalarField rhorAUf("rhorAUf", fvc::interpolate(rho*rAU));
|
||||||
@ -39,8 +38,8 @@
|
|||||||
|
|
||||||
p.relax();
|
p.relax();
|
||||||
|
|
||||||
// Second part of thermodynamic density update
|
// Thermodynamic density update
|
||||||
thermo.rho() += psi*p;
|
thermo.correctRho(psi*p - psip0);
|
||||||
|
|
||||||
#include "compressibleContinuityErrs.H"
|
#include "compressibleContinuityErrs.H"
|
||||||
|
|
||||||
@ -54,4 +53,3 @@
|
|||||||
rho.relax();
|
rho.relax();
|
||||||
|
|
||||||
Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
|
Info<< "p min/max = " << min(p).value() << ", " << max(p).value() << endl;
|
||||||
}
|
|
||||||
|
|||||||
@ -104,8 +104,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update densities from change in p_rgh
|
// Update densities from change in p_rgh
|
||||||
rho1 += psi1*(p_rgh - p_rgh_0);
|
mixture.thermo1().correctRho(psi1*(p_rgh - p_rgh_0));
|
||||||
rho2 += psi2*(p_rgh - p_rgh_0);
|
mixture.thermo2().correctRho(psi2*(p_rgh - p_rgh_0));
|
||||||
|
|
||||||
rho = alpha1*rho1 + alpha2*rho2;
|
rho = alpha1*rho1 + alpha2*rho2;
|
||||||
|
|
||||||
|
|||||||
@ -38,8 +38,8 @@ volScalarField& alpha2(mixture.alpha2());
|
|||||||
|
|
||||||
Info<< "Reading thermophysical properties\n" << endl;
|
Info<< "Reading thermophysical properties\n" << endl;
|
||||||
|
|
||||||
volScalarField& rho1 = mixture.thermo1().rho();
|
const volScalarField& rho1 = mixture.thermo1().rho();
|
||||||
volScalarField& rho2 = mixture.thermo2().rho();
|
const volScalarField& rho2 = mixture.thermo2().rho();
|
||||||
|
|
||||||
volScalarField rho
|
volScalarField rho
|
||||||
(
|
(
|
||||||
|
|||||||
@ -104,8 +104,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Update densities from change in p_rgh
|
// Update densities from change in p_rgh
|
||||||
rho1 += psi1*(p_rgh - p_rgh_0);
|
mixture.thermo1().correctRho(psi1*(p_rgh - p_rgh_0));
|
||||||
rho2 += psi2*(p_rgh - p_rgh_0);
|
mixture.thermo2().correctRho(psi2*(p_rgh - p_rgh_0));
|
||||||
|
|
||||||
rho = alpha1*rho1 + alpha2*rho2;
|
rho = alpha1*rho1 + alpha2*rho2;
|
||||||
|
|
||||||
|
|||||||
@ -45,7 +45,7 @@ fixedIncidentRadiationFvPatchScalarField
|
|||||||
:
|
:
|
||||||
fixedGradientFvPatchScalarField(p, iF),
|
fixedGradientFvPatchScalarField(p, iF),
|
||||||
temperatureCoupledBase(patch(), "undefined", "undefined", "undefined-K"),
|
temperatureCoupledBase(patch(), "undefined", "undefined", "undefined-K"),
|
||||||
QrIncident_(p.size(), 0.0)
|
qrIncident_(p.size(), 0.0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ fixedIncidentRadiationFvPatchScalarField
|
|||||||
:
|
:
|
||||||
fixedGradientFvPatchScalarField(psf, p, iF, mapper),
|
fixedGradientFvPatchScalarField(psf, p, iF, mapper),
|
||||||
temperatureCoupledBase(patch(), psf),
|
temperatureCoupledBase(patch(), psf),
|
||||||
QrIncident_(psf.QrIncident_)
|
qrIncident_(psf.qrIncident_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -74,7 +74,7 @@ fixedIncidentRadiationFvPatchScalarField
|
|||||||
:
|
:
|
||||||
fixedGradientFvPatchScalarField(p, iF),
|
fixedGradientFvPatchScalarField(p, iF),
|
||||||
temperatureCoupledBase(patch(), dict),
|
temperatureCoupledBase(patch(), dict),
|
||||||
QrIncident_("QrIncident", dict, p.size())
|
qrIncident_("qrIncident", dict, p.size())
|
||||||
{
|
{
|
||||||
if (dict.found("value") && dict.found("gradient"))
|
if (dict.found("value") && dict.found("gradient"))
|
||||||
{
|
{
|
||||||
@ -99,7 +99,7 @@ fixedIncidentRadiationFvPatchScalarField
|
|||||||
:
|
:
|
||||||
fixedGradientFvPatchScalarField(psf, iF),
|
fixedGradientFvPatchScalarField(psf, iF),
|
||||||
temperatureCoupledBase(patch(), psf),
|
temperatureCoupledBase(patch(), psf),
|
||||||
QrIncident_(psf.QrIncident_)
|
qrIncident_(psf.qrIncident_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -111,7 +111,7 @@ fixedIncidentRadiationFvPatchScalarField
|
|||||||
:
|
:
|
||||||
fixedGradientFvPatchScalarField(ptf),
|
fixedGradientFvPatchScalarField(ptf),
|
||||||
temperatureCoupledBase(patch(), ptf),
|
temperatureCoupledBase(patch(), ptf),
|
||||||
QrIncident_(ptf.QrIncident_)
|
qrIncident_(ptf.qrIncident_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ void Foam::radiation::fixedIncidentRadiationFvPatchScalarField::autoMap
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
fixedGradientFvPatchScalarField::autoMap(m);
|
fixedGradientFvPatchScalarField::autoMap(m);
|
||||||
QrIncident_.autoMap(m);
|
qrIncident_.autoMap(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -141,7 +141,7 @@ void Foam::radiation::fixedIncidentRadiationFvPatchScalarField::rmap
|
|||||||
psf
|
psf
|
||||||
);
|
);
|
||||||
|
|
||||||
QrIncident_.rmap(thftpsf.QrIncident_, addr);
|
qrIncident_.rmap(thftpsf.qrIncident_, addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -165,7 +165,7 @@ void Foam::radiation::fixedIncidentRadiationFvPatchScalarField::updateCoeffs()
|
|||||||
gradient() =
|
gradient() =
|
||||||
emissivity
|
emissivity
|
||||||
*(
|
*(
|
||||||
QrIncident_
|
qrIncident_
|
||||||
- physicoChemical::sigma.value()*pow4(*this)
|
- physicoChemical::sigma.value()*pow4(*this)
|
||||||
)/kappa(*this);
|
)/kappa(*this);
|
||||||
|
|
||||||
@ -173,11 +173,11 @@ void Foam::radiation::fixedIncidentRadiationFvPatchScalarField::updateCoeffs()
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
scalar Qr = gSum(kappa(*this)*gradient()*patch().magSf());
|
scalar qr = gSum(kappa(*this)*gradient()*patch().magSf());
|
||||||
Info<< patch().boundaryMesh().mesh().name() << ':'
|
Info<< patch().boundaryMesh().mesh().name() << ':'
|
||||||
<< patch().name() << ':'
|
<< patch().name() << ':'
|
||||||
<< this->internalField().name() << " -> "
|
<< this->internalField().name() << " -> "
|
||||||
<< " radiativeFlux:" << Qr
|
<< " radiativeFlux:" << qr
|
||||||
<< " walltemperature "
|
<< " walltemperature "
|
||||||
<< " min:" << gMin(*this)
|
<< " min:" << gMin(*this)
|
||||||
<< " max:" << gMax(*this)
|
<< " max:" << gMax(*this)
|
||||||
@ -194,7 +194,7 @@ void Foam::radiation::fixedIncidentRadiationFvPatchScalarField::write
|
|||||||
{
|
{
|
||||||
fixedGradientFvPatchScalarField::write(os);
|
fixedGradientFvPatchScalarField::write(os);
|
||||||
temperatureCoupledBase::write(os);
|
temperatureCoupledBase::write(os);
|
||||||
QrIncident_.writeEntry("QrIncident", os);
|
qrIncident_.writeEntry("qrIncident", os);
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -34,19 +34,19 @@ Description
|
|||||||
|
|
||||||
the gradient heat flux is calculated as :
|
the gradient heat flux is calculated as :
|
||||||
|
|
||||||
Qr = emissivity*(QrIncident - sigma_*T^4)
|
qr = emissivity*(qrIncident - sigma_*T^4)
|
||||||
|
|
||||||
where:
|
where:
|
||||||
|
|
||||||
emissivity is the emissivity of the solid.
|
emissivity is the emissivity of the solid.
|
||||||
QrIncident is the specified fixed incident radiation.
|
qrIncident is the specified fixed incident radiation.
|
||||||
|
|
||||||
Example usage:
|
Example usage:
|
||||||
|
|
||||||
wall
|
wall
|
||||||
{
|
{
|
||||||
type fixedIncidentRadiation;
|
type fixedIncidentRadiation;
|
||||||
QrIncident uniform 500;
|
qrIncident uniform 500;
|
||||||
kappa solidThermo;
|
kappa solidThermo;
|
||||||
KappaName none;
|
KappaName none;
|
||||||
}
|
}
|
||||||
@ -89,7 +89,7 @@ class fixedIncidentRadiationFvPatchScalarField
|
|||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Incident radiative heat flux
|
//- Incident radiative heat flux
|
||||||
scalarField QrIncident_;
|
scalarField qrIncident_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|||||||
@ -150,18 +150,18 @@ void Foam::lumpedMassWallTemperatureFvPatchScalarField::updateCoeffs()
|
|||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
scalar qin(0);
|
scalar Qin(0);
|
||||||
scalar qout(0);
|
scalar Qout(0);
|
||||||
|
|
||||||
forAll(q, facei)
|
forAll(q, facei)
|
||||||
{
|
{
|
||||||
if (q[facei] > 0.0) // out the wall
|
if (q[facei] > 0.0) // out the wall
|
||||||
{
|
{
|
||||||
qout += q[facei]*magSf[facei];
|
Qout += q[facei]*magSf[facei];
|
||||||
}
|
}
|
||||||
else if (q[facei] < 0.0) // into the wall
|
else if (q[facei] < 0.0) // into the wall
|
||||||
{
|
{
|
||||||
qin += q[facei]*magSf[facei];
|
Qin += q[facei]*magSf[facei];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -173,8 +173,8 @@ void Foam::lumpedMassWallTemperatureFvPatchScalarField::updateCoeffs()
|
|||||||
<< " min:" << gMin(*this)
|
<< " min:" << gMin(*this)
|
||||||
<< " max:" << gMax(*this)
|
<< " max:" << gMax(*this)
|
||||||
<< " avg:" << gAverage(*this)
|
<< " avg:" << gAverage(*this)
|
||||||
<< " Qin [W]:" << qin
|
<< " Qin [W]:" << Qin
|
||||||
<< " Qout [W]:" << qout
|
<< " Qout [W]:" << Qout
|
||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -50,7 +50,7 @@ thermalBaffle1DFvPatchScalarField
|
|||||||
TName_("T"),
|
TName_("T"),
|
||||||
baffleActivated_(true),
|
baffleActivated_(true),
|
||||||
thickness_(p.size()),
|
thickness_(p.size()),
|
||||||
Qs_(p.size()),
|
qs_(p.size()),
|
||||||
solidDict_(),
|
solidDict_(),
|
||||||
solidPtr_(nullptr),
|
solidPtr_(nullptr),
|
||||||
qrPrevious_(p.size()),
|
qrPrevious_(p.size()),
|
||||||
@ -74,7 +74,7 @@ thermalBaffle1DFvPatchScalarField
|
|||||||
TName_(ptf.TName_),
|
TName_(ptf.TName_),
|
||||||
baffleActivated_(ptf.baffleActivated_),
|
baffleActivated_(ptf.baffleActivated_),
|
||||||
thickness_(ptf.thickness_, mapper),
|
thickness_(ptf.thickness_, mapper),
|
||||||
Qs_(ptf.Qs_, mapper),
|
qs_(ptf.qs_, mapper),
|
||||||
solidDict_(ptf.solidDict_),
|
solidDict_(ptf.solidDict_),
|
||||||
solidPtr_(ptf.solidPtr_),
|
solidPtr_(ptf.solidPtr_),
|
||||||
qrPrevious_(ptf.qrPrevious_, mapper),
|
qrPrevious_(ptf.qrPrevious_, mapper),
|
||||||
@ -97,7 +97,7 @@ thermalBaffle1DFvPatchScalarField
|
|||||||
TName_("T"),
|
TName_("T"),
|
||||||
baffleActivated_(dict.lookupOrDefault<bool>("baffleActivated", true)),
|
baffleActivated_(dict.lookupOrDefault<bool>("baffleActivated", true)),
|
||||||
thickness_(),
|
thickness_(),
|
||||||
Qs_(p.size(), 0),
|
qs_(p.size(), 0),
|
||||||
solidDict_(dict),
|
solidDict_(dict),
|
||||||
solidPtr_(),
|
solidPtr_(),
|
||||||
qrPrevious_(p.size(), 0.0),
|
qrPrevious_(p.size(), 0.0),
|
||||||
@ -111,9 +111,9 @@ thermalBaffle1DFvPatchScalarField
|
|||||||
thickness_ = scalarField("thickness", dict, p.size());
|
thickness_ = scalarField("thickness", dict, p.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dict.found("Qs"))
|
if (dict.found("qs"))
|
||||||
{
|
{
|
||||||
Qs_ = scalarField("Qs", dict, p.size());
|
qs_ = scalarField("qs", dict, p.size());
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dict.found("qrPrevious"))
|
if (dict.found("qrPrevious"))
|
||||||
@ -151,7 +151,7 @@ thermalBaffle1DFvPatchScalarField
|
|||||||
TName_(ptf.TName_),
|
TName_(ptf.TName_),
|
||||||
baffleActivated_(ptf.baffleActivated_),
|
baffleActivated_(ptf.baffleActivated_),
|
||||||
thickness_(ptf.thickness_),
|
thickness_(ptf.thickness_),
|
||||||
Qs_(ptf.Qs_),
|
qs_(ptf.qs_),
|
||||||
solidDict_(ptf.solidDict_),
|
solidDict_(ptf.solidDict_),
|
||||||
solidPtr_(ptf.solidPtr_),
|
solidPtr_(ptf.solidPtr_),
|
||||||
qrPrevious_(ptf.qrPrevious_),
|
qrPrevious_(ptf.qrPrevious_),
|
||||||
@ -173,7 +173,7 @@ thermalBaffle1DFvPatchScalarField
|
|||||||
TName_(ptf.TName_),
|
TName_(ptf.TName_),
|
||||||
baffleActivated_(ptf.baffleActivated_),
|
baffleActivated_(ptf.baffleActivated_),
|
||||||
thickness_(ptf.thickness_),
|
thickness_(ptf.thickness_),
|
||||||
Qs_(ptf.Qs_),
|
qs_(ptf.qs_),
|
||||||
solidDict_(ptf.solidDict_),
|
solidDict_(ptf.solidDict_),
|
||||||
solidPtr_(ptf.solidPtr_),
|
solidPtr_(ptf.solidPtr_),
|
||||||
qrPrevious_(ptf.qrPrevious_),
|
qrPrevious_(ptf.qrPrevious_),
|
||||||
@ -264,11 +264,11 @@ baffleThickness() const
|
|||||||
|
|
||||||
|
|
||||||
template<class solidType>
|
template<class solidType>
|
||||||
tmp<scalarField> thermalBaffle1DFvPatchScalarField<solidType>::Qs() const
|
tmp<scalarField> thermalBaffle1DFvPatchScalarField<solidType>::qs() const
|
||||||
{
|
{
|
||||||
if (this->owner())
|
if (this->owner())
|
||||||
{
|
{
|
||||||
return Qs_;
|
return qs_;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -283,10 +283,10 @@ tmp<scalarField> thermalBaffle1DFvPatchScalarField<solidType>::Qs() const
|
|||||||
nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
|
nbrPatch.template lookupPatchField<volScalarField, scalar>(TName_)
|
||||||
);
|
);
|
||||||
|
|
||||||
tmp<scalarField> tQs(new scalarField(nbrField.Qs()));
|
tmp<scalarField> tqs(new scalarField(nbrField.qs()));
|
||||||
scalarField& Qs = tQs.ref();
|
scalarField& qs = tqs.ref();
|
||||||
mapDist.distribute(Qs);
|
mapDist.distribute(qs);
|
||||||
return tQs;
|
return tqs;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -304,7 +304,7 @@ void thermalBaffle1DFvPatchScalarField<solidType>::autoMap
|
|||||||
if (this->owner())
|
if (this->owner())
|
||||||
{
|
{
|
||||||
thickness_.autoMap(m);
|
thickness_.autoMap(m);
|
||||||
Qs_.autoMap(m);
|
qs_.autoMap(m);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -324,7 +324,7 @@ void thermalBaffle1DFvPatchScalarField<solidType>::rmap
|
|||||||
if (this->owner())
|
if (this->owner())
|
||||||
{
|
{
|
||||||
thickness_.rmap(tiptf.thickness_, addr);
|
thickness_.rmap(tiptf.thickness_, addr);
|
||||||
Qs_.rmap(tiptf.Qs_, addr);
|
qs_.rmap(tiptf.qs_, addr);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -397,7 +397,7 @@ void thermalBaffle1DFvPatchScalarField<solidType>::updateCoeffs()
|
|||||||
|
|
||||||
valueFraction() = alpha/(alpha + myKDelta);
|
valueFraction() = alpha/(alpha + myKDelta);
|
||||||
|
|
||||||
refValue() = (KDeltaSolid*nbrTp + Qs()/2.0)/alpha;
|
refValue() = (KDeltaSolid*nbrTp + qs()/2.0)/alpha;
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
@ -431,7 +431,7 @@ void thermalBaffle1DFvPatchScalarField<solidType>::write(Ostream& os) const
|
|||||||
if (this->owner())
|
if (this->owner())
|
||||||
{
|
{
|
||||||
baffleThickness()().writeEntry("thickness", os);
|
baffleThickness()().writeEntry("thickness", os);
|
||||||
Qs()().writeEntry("Qs", os);
|
qs()().writeEntry("qs", os);
|
||||||
solid().write(os);
|
solid().write(os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -46,7 +46,7 @@ Usage
|
|||||||
samplePatch <slavePatchName>;
|
samplePatch <slavePatchName>;
|
||||||
|
|
||||||
thickness uniform 0.005; // thickness [m]
|
thickness uniform 0.005; // thickness [m]
|
||||||
Qs uniform 100; // heat flux [W/m2]
|
qs uniform 100; // heat flux [W/m2]
|
||||||
|
|
||||||
qr none;
|
qr none;
|
||||||
relaxation 1;
|
relaxation 1;
|
||||||
@ -124,7 +124,7 @@ class thermalBaffle1DFvPatchScalarField
|
|||||||
mutable scalarField thickness_;
|
mutable scalarField thickness_;
|
||||||
|
|
||||||
//- Superficial heat source [W/m2]
|
//- Superficial heat source [W/m2]
|
||||||
mutable scalarField Qs_;
|
mutable scalarField qs_;
|
||||||
|
|
||||||
//- Solid dictionary
|
//- Solid dictionary
|
||||||
dictionary solidDict_;
|
dictionary solidDict_;
|
||||||
@ -147,8 +147,8 @@ class thermalBaffle1DFvPatchScalarField
|
|||||||
//- Return const solid thermo
|
//- Return const solid thermo
|
||||||
const solidType& solid() const;
|
const solidType& solid() const;
|
||||||
|
|
||||||
//- Return Qs from master
|
//- Return qs from master
|
||||||
tmp<scalarField> Qs() const;
|
tmp<scalarField> qs() const;
|
||||||
|
|
||||||
//- Return thickness from master
|
//- Return thickness from master
|
||||||
tmp<scalarField> baffleThickness() const;
|
tmp<scalarField> baffleThickness() const;
|
||||||
|
|||||||
@ -219,7 +219,7 @@ bool Foam::slidingInterface::projectPoints() const
|
|||||||
projectionAlgo_
|
projectionAlgo_
|
||||||
);
|
);
|
||||||
|
|
||||||
// Pout<< "USING N-SQAURED!!!" << endl;
|
// Pout<< "USING N-SQUARED!!!" << endl;
|
||||||
// List<objectHit> slavePointFaceHits =
|
// List<objectHit> slavePointFaceHits =
|
||||||
// projectPointsNSquared<face, List, const pointField&>
|
// projectPointsNSquared<face, List, const pointField&>
|
||||||
// (
|
// (
|
||||||
|
|||||||
@ -38,24 +38,30 @@ Foam::pressureControl::pressureControl
|
|||||||
:
|
:
|
||||||
refCell_(-1),
|
refCell_(-1),
|
||||||
refValue_(0),
|
refValue_(0),
|
||||||
pMax_("pMax", dimPressure, 0),
|
pMax_("pMax", dimPressure, GREAT),
|
||||||
pMin_("pMin", dimPressure, GREAT)
|
pMin_("pMin", dimPressure, 0),
|
||||||
|
limitMaxP_(false),
|
||||||
|
limitMinP_(false)
|
||||||
{
|
{
|
||||||
bool pLimits = false;
|
bool pLimits = false;
|
||||||
|
scalar pMax = -GREAT;
|
||||||
|
scalar pMin = GREAT;
|
||||||
|
|
||||||
// Set the reference cell and value for closed domain simulations
|
// Set the reference cell and value for closed domain simulations
|
||||||
if (pRefRequired && setRefCell(p, dict, refCell_, refValue_))
|
if (pRefRequired && setRefCell(p, dict, refCell_, refValue_))
|
||||||
{
|
{
|
||||||
pLimits = true;
|
pLimits = true;
|
||||||
|
|
||||||
pMax_.value() = refValue_;
|
pMax = refValue_;
|
||||||
pMin_.value() = refValue_;
|
pMin = refValue_;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dict.found("pMax") && dict.found("pMin"))
|
if (dict.found("pMax") && dict.found("pMin"))
|
||||||
{
|
{
|
||||||
pMax_.value() = readScalar(dict.lookup("pMax"));
|
pMax_.value() = readScalar(dict.lookup("pMax"));
|
||||||
|
limitMaxP_ = true;
|
||||||
pMin_.value() = readScalar(dict.lookup("pMin"));
|
pMin_.value() = readScalar(dict.lookup("pMin"));
|
||||||
|
limitMinP_ = true;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -73,8 +79,8 @@ Foam::pressureControl::pressureControl
|
|||||||
pLimits = true;
|
pLimits = true;
|
||||||
rhoLimits = true;
|
rhoLimits = true;
|
||||||
|
|
||||||
pMax_.value() = max(pMax_.value(), max(pbf[patchi]));
|
pMax = max(pMax, max(pbf[patchi]));
|
||||||
pMin_.value() = min(pMin_.value(), min(pbf[patchi]));
|
pMin = min(pMin, min(pbf[patchi]));
|
||||||
|
|
||||||
rhoRefMax = max(rhoRefMax, max(rhobf[patchi]));
|
rhoRefMax = max(rhoRefMax, max(rhobf[patchi]));
|
||||||
rhoRefMin = min(rhoRefMin, min(rhobf[patchi]));
|
rhoRefMin = min(rhoRefMin, min(rhobf[patchi]));
|
||||||
@ -84,8 +90,8 @@ Foam::pressureControl::pressureControl
|
|||||||
reduce(rhoLimits, andOp<bool>());
|
reduce(rhoLimits, andOp<bool>());
|
||||||
if (rhoLimits)
|
if (rhoLimits)
|
||||||
{
|
{
|
||||||
reduce(pMax_.value(), maxOp<scalar>());
|
reduce(pMax, maxOp<scalar>());
|
||||||
reduce(pMin_.value(), minOp<scalar>());
|
reduce(pMin, minOp<scalar>());
|
||||||
|
|
||||||
reduce(rhoRefMax, maxOp<scalar>());
|
reduce(rhoRefMax, maxOp<scalar>());
|
||||||
reduce(rhoRefMin, minOp<scalar>());
|
reduce(rhoRefMin, minOp<scalar>());
|
||||||
@ -94,6 +100,7 @@ Foam::pressureControl::pressureControl
|
|||||||
if (dict.found("pMax"))
|
if (dict.found("pMax"))
|
||||||
{
|
{
|
||||||
pMax_.value() = readScalar(dict.lookup("pMax"));
|
pMax_.value() = readScalar(dict.lookup("pMax"));
|
||||||
|
limitMaxP_ = true;
|
||||||
}
|
}
|
||||||
else if (dict.found("pMaxFactor"))
|
else if (dict.found("pMaxFactor"))
|
||||||
{
|
{
|
||||||
@ -108,7 +115,8 @@ Foam::pressureControl::pressureControl
|
|||||||
}
|
}
|
||||||
|
|
||||||
const scalar pMaxFactor(readScalar(dict.lookup("pMaxFactor")));
|
const scalar pMaxFactor(readScalar(dict.lookup("pMaxFactor")));
|
||||||
pMax_ *= pMaxFactor;
|
pMax_.value() = pMaxFactor*pMax;
|
||||||
|
limitMaxP_ = true;
|
||||||
}
|
}
|
||||||
else if (dict.found("rhoMax"))
|
else if (dict.found("rhoMax"))
|
||||||
{
|
{
|
||||||
@ -142,12 +150,14 @@ Foam::pressureControl::pressureControl
|
|||||||
|
|
||||||
dimensionedScalar rhoMax("rhoMax", dimDensity, dict);
|
dimensionedScalar rhoMax("rhoMax", dimDensity, dict);
|
||||||
|
|
||||||
pMax_ *= max(rhoMax.value()/rhoRefMax, 1);
|
pMax_.value() = max(rhoMax.value()/rhoRefMax, 1)*pMax;
|
||||||
|
limitMaxP_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (dict.found("pMin"))
|
if (dict.found("pMin"))
|
||||||
{
|
{
|
||||||
pMin_.value() = readScalar(dict.lookup("pMin"));
|
pMin_.value() = readScalar(dict.lookup("pMin"));
|
||||||
|
limitMinP_ = true;
|
||||||
}
|
}
|
||||||
else if (dict.found("pMinFactor"))
|
else if (dict.found("pMinFactor"))
|
||||||
{
|
{
|
||||||
@ -162,7 +172,8 @@ Foam::pressureControl::pressureControl
|
|||||||
}
|
}
|
||||||
|
|
||||||
const scalar pMinFactor(readScalar(dict.lookup("pMinFactor")));
|
const scalar pMinFactor(readScalar(dict.lookup("pMinFactor")));
|
||||||
pMin_ *= pMinFactor;
|
pMin_.value() = pMinFactor*pMin;
|
||||||
|
limitMinP_ = true;
|
||||||
}
|
}
|
||||||
else if (dict.found("rhoMin"))
|
else if (dict.found("rhoMin"))
|
||||||
{
|
{
|
||||||
@ -195,27 +206,65 @@ Foam::pressureControl::pressureControl
|
|||||||
|
|
||||||
dimensionedScalar rhoMin("rhoMin", dimDensity, dict);
|
dimensionedScalar rhoMin("rhoMin", dimDensity, dict);
|
||||||
|
|
||||||
pMin_ *= min(rhoMin.value()/rhoRefMin, 1);
|
pMin_.value() = min(rhoMin.value()/rhoRefMin, 1)*pMin;
|
||||||
|
limitMinP_ = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "pressureControl" << nl
|
if (limitMaxP_ || limitMinP_)
|
||||||
<< " pMax/pMin " << pMax_.value() << " " << pMin_.value()
|
{
|
||||||
<< nl << endl;
|
Info<< "pressureControl" << nl;
|
||||||
|
|
||||||
|
if (limitMaxP_)
|
||||||
|
{
|
||||||
|
Info<< " pMax " << pMax_.value() << nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (limitMinP_)
|
||||||
|
{
|
||||||
|
Info<< " pMin " << pMin_.value() << nl;
|
||||||
|
}
|
||||||
|
|
||||||
|
Info << endl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
void Foam::pressureControl::limit(volScalarField& p) const
|
bool Foam::pressureControl::limit(volScalarField& p) const
|
||||||
{
|
{
|
||||||
Info<< "pressureControl: p max/min "
|
if (limitMaxP_ || limitMinP_)
|
||||||
<< max(p).value() << " "
|
{
|
||||||
<< min(p).value() << endl;
|
if (limitMaxP_)
|
||||||
|
{
|
||||||
|
const scalar pMax = max(p).value();
|
||||||
|
|
||||||
p = max(p, pMin_);
|
if (pMax > pMax_.value())
|
||||||
|
{
|
||||||
|
Info<< "pressureControl: p max " << pMax << endl;
|
||||||
p = min(p, pMax_);
|
p = min(p, pMax_);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (limitMinP_)
|
||||||
|
{
|
||||||
|
const scalar pMin = min(p).value();
|
||||||
|
|
||||||
|
if (pMin < pMin_.value())
|
||||||
|
{
|
||||||
|
Info<< "pressureControl: p min " << pMin << endl;
|
||||||
|
p = max(p, pMin_);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -66,6 +66,12 @@ class pressureControl
|
|||||||
//- Pressure upper-limit
|
//- Pressure upper-limit
|
||||||
dimensionedScalar pMin_;
|
dimensionedScalar pMin_;
|
||||||
|
|
||||||
|
//- Pressure lower-limit
|
||||||
|
bool limitMaxP_;
|
||||||
|
|
||||||
|
//- Pressure upper-limit
|
||||||
|
bool limitMinP_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
@ -89,8 +95,8 @@ public:
|
|||||||
//- Return the pressure reference level
|
//- Return the pressure reference level
|
||||||
inline scalar refValue() const;
|
inline scalar refValue() const;
|
||||||
|
|
||||||
//- Limit the pressure
|
//- Limit the pressure if necessary and return true if so
|
||||||
void limit(volScalarField& p) const;
|
bool limit(volScalarField& p) const;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -45,6 +45,7 @@ void Foam::pimpleControl::read()
|
|||||||
solveFlow_ = pimpleDict.lookupOrDefault<Switch>("solveFlow", true);
|
solveFlow_ = pimpleDict.lookupOrDefault<Switch>("solveFlow", true);
|
||||||
nCorrPIMPLE_ = pimpleDict.lookupOrDefault<label>("nOuterCorrectors", 1);
|
nCorrPIMPLE_ = pimpleDict.lookupOrDefault<label>("nOuterCorrectors", 1);
|
||||||
nCorrPISO_ = pimpleDict.lookupOrDefault<label>("nCorrectors", 1);
|
nCorrPISO_ = pimpleDict.lookupOrDefault<label>("nCorrectors", 1);
|
||||||
|
SIMPLErho_ = pimpleDict.lookupOrDefault<Switch>("SIMPLErho", false);
|
||||||
turbOnFinalIterOnly_ =
|
turbOnFinalIterOnly_ =
|
||||||
pimpleDict.lookupOrDefault<Switch>("turbOnFinalIterOnly", true);
|
pimpleDict.lookupOrDefault<Switch>("turbOnFinalIterOnly", true);
|
||||||
}
|
}
|
||||||
@ -128,6 +129,7 @@ Foam::pimpleControl::pimpleControl(fvMesh& mesh, const word& dictName)
|
|||||||
nCorrPIMPLE_(0),
|
nCorrPIMPLE_(0),
|
||||||
nCorrPISO_(0),
|
nCorrPISO_(0),
|
||||||
corrPISO_(0),
|
corrPISO_(0),
|
||||||
|
SIMPLErho_(false),
|
||||||
turbOnFinalIterOnly_(true),
|
turbOnFinalIterOnly_(true),
|
||||||
converged_(false)
|
converged_(false)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -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-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -81,6 +81,10 @@ protected:
|
|||||||
//- Current PISO corrector
|
//- Current PISO corrector
|
||||||
label corrPISO_;
|
label corrPISO_;
|
||||||
|
|
||||||
|
//- Flag to indicate whether to update density in SIMPLE
|
||||||
|
// rather than PISO mode
|
||||||
|
bool SIMPLErho_;
|
||||||
|
|
||||||
//- Flag to indicate whether to only solve turbulence on final iter
|
//- Flag to indicate whether to only solve turbulence on final iter
|
||||||
bool turbOnFinalIterOnly_;
|
bool turbOnFinalIterOnly_;
|
||||||
|
|
||||||
@ -128,6 +132,10 @@ public:
|
|||||||
//- Current PISO corrector index
|
//- Current PISO corrector index
|
||||||
inline label corrPISO() const;
|
inline label corrPISO() const;
|
||||||
|
|
||||||
|
//- Flag to indicate whether to update density in SIMPLE
|
||||||
|
// rather than PISO mode
|
||||||
|
inline bool SIMPLErho() const;
|
||||||
|
|
||||||
|
|
||||||
// Solution control
|
// Solution control
|
||||||
|
|
||||||
|
|||||||
@ -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-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -43,6 +43,12 @@ inline Foam::label Foam::pimpleControl::corrPISO() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline bool Foam::pimpleControl::SIMPLErho() const
|
||||||
|
{
|
||||||
|
return SIMPLErho_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline bool Foam::pimpleControl::correct()
|
inline bool Foam::pimpleControl::correct()
|
||||||
{
|
{
|
||||||
corrPISO_++;
|
corrPISO_++;
|
||||||
|
|||||||
@ -92,6 +92,7 @@ Foam::fv::correctedSnGrad<Type>::correction
|
|||||||
)
|
)
|
||||||
);
|
);
|
||||||
GeometricField<Type, fvsPatchField, surfaceMesh>& ssf = tssf.ref();
|
GeometricField<Type, fvsPatchField, surfaceMesh>& ssf = tssf.ref();
|
||||||
|
ssf.setOriented();
|
||||||
|
|
||||||
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
for (direction cmpt = 0; cmpt < pTraits<Type>::nComponents; cmpt++)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -48,7 +48,7 @@ Description
|
|||||||
\endvartable
|
\endvartable
|
||||||
|
|
||||||
|
|
||||||
The distribution inside the hear exchanger is given by:
|
The distribution inside the heat exchanger is given by:
|
||||||
\f[
|
\f[
|
||||||
Q_c = \frac{V_c |U_c| (T_c - T_{ref})}{\sum(V_c |U_c| (T_c - T_{ref}))}
|
Q_c = \frac{V_c |U_c| (T_c - T_{ref})}{\sum(V_c |U_c| (T_c - T_{ref}))}
|
||||||
\f]
|
\f]
|
||||||
|
|||||||
@ -56,11 +56,11 @@ primaryRadiation::primaryRadiation
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
filmRadiationModel(typeName, film, dict),
|
filmRadiationModel(typeName, film, dict),
|
||||||
QinPrimary_
|
qinPrimary_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"Qin", // same name as Qin on primary region to enable mapping
|
"qin", // same name as qin on primary region to enable mapping
|
||||||
film.time().timeName(),
|
film.time().timeName(),
|
||||||
film.regionMesh(),
|
film.regionMesh(),
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
@ -83,8 +83,8 @@ primaryRadiation::~primaryRadiation()
|
|||||||
|
|
||||||
void primaryRadiation::correct()
|
void primaryRadiation::correct()
|
||||||
{
|
{
|
||||||
// Transfer Qin from primary region
|
// Transfer qin from primary region
|
||||||
QinPrimary_.correctBoundaryConditions();
|
qinPrimary_.correctBoundaryConditions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -108,10 +108,10 @@ tmp<volScalarField> primaryRadiation::Shs()
|
|||||||
);
|
);
|
||||||
|
|
||||||
scalarField& Shs = tShs.ref();
|
scalarField& Shs = tShs.ref();
|
||||||
const scalarField& QinP = QinPrimary_;
|
const scalarField& qinP = qinPrimary_;
|
||||||
const scalarField& alpha = filmModel_.alpha();
|
const scalarField& alpha = filmModel_.alpha();
|
||||||
|
|
||||||
Shs = QinP*alpha;
|
Shs = qinP*alpha;
|
||||||
|
|
||||||
return tShs;
|
return tShs;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -61,7 +61,7 @@ private:
|
|||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Incident radiative flux mapped from the primary region / [kg/s3]
|
//- Incident radiative flux mapped from the primary region / [kg/s3]
|
||||||
volScalarField QinPrimary_;
|
volScalarField qinPrimary_;
|
||||||
|
|
||||||
|
|
||||||
// Private member functions
|
// Private member functions
|
||||||
|
|||||||
@ -57,11 +57,11 @@ standardRadiation::standardRadiation
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
filmRadiationModel(typeName, film, dict),
|
filmRadiationModel(typeName, film, dict),
|
||||||
QinPrimary_
|
qinPrimary_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"Qin", // same name as Qin on primary region to enable mapping
|
"qin", // same name as qin on primary region to enable mapping
|
||||||
film.time().timeName(),
|
film.time().timeName(),
|
||||||
film.regionMesh(),
|
film.regionMesh(),
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
@ -101,7 +101,7 @@ standardRadiation::~standardRadiation()
|
|||||||
void standardRadiation::correct()
|
void standardRadiation::correct()
|
||||||
{
|
{
|
||||||
// Transfer qr from primary region
|
// Transfer qr from primary region
|
||||||
QinPrimary_.correctBoundaryConditions();
|
qinPrimary_.correctBoundaryConditions();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -125,14 +125,14 @@ tmp<volScalarField> standardRadiation::Shs()
|
|||||||
);
|
);
|
||||||
|
|
||||||
scalarField& Shs = tShs.ref();
|
scalarField& Shs = tShs.ref();
|
||||||
const scalarField& QinP = QinPrimary_;
|
const scalarField& qinP = qinPrimary_;
|
||||||
const scalarField& delta = filmModel_.delta();
|
const scalarField& delta = filmModel_.delta();
|
||||||
const scalarField& alpha = filmModel_.alpha();
|
const scalarField& alpha = filmModel_.alpha();
|
||||||
|
|
||||||
Shs = beta_*QinP*alpha*(1.0 - exp(-kappaBar_*delta));
|
Shs = beta_*qinP*alpha*(1.0 - exp(-kappaBar_*delta));
|
||||||
|
|
||||||
// Update net qr on local region
|
// Update net qr on local region
|
||||||
qrNet_.primitiveFieldRef() = QinP - Shs;
|
qrNet_.primitiveFieldRef() = qinP - Shs;
|
||||||
qrNet_.correctBoundaryConditions();
|
qrNet_.correctBoundaryConditions();
|
||||||
|
|
||||||
return tShs;
|
return tShs;
|
||||||
|
|||||||
@ -60,7 +60,7 @@ private:
|
|||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Radiative incident flux mapped from the primary region / [kg/s3]
|
//- Radiative incident flux mapped from the primary region / [kg/s3]
|
||||||
volScalarField QinPrimary_;
|
volScalarField qinPrimary_;
|
||||||
|
|
||||||
//- Remaining radiative flux after removing local contribution
|
//- Remaining radiative flux after removing local contribution
|
||||||
volScalarField qrNet_;
|
volScalarField qrNet_;
|
||||||
|
|||||||
@ -367,10 +367,10 @@ public:
|
|||||||
// Derived fields (calculated on-the-fly)
|
// Derived fields (calculated on-the-fly)
|
||||||
|
|
||||||
//- Return the convective heat energy from film to wall
|
//- Return the convective heat energy from film to wall
|
||||||
inline tmp<scalarField> Qconvw(const label patchi) const;
|
inline tmp<scalarField> qconvw(const label patchi) const;
|
||||||
|
|
||||||
//- Return the convective heat energy from primary region to film
|
//- Return the convective heat energy from primary region to film
|
||||||
inline tmp<scalarField> Qconvp(const label patchi) const;
|
inline tmp<scalarField> qconvp(const label patchi) const;
|
||||||
|
|
||||||
|
|
||||||
// Evolution
|
// Evolution
|
||||||
|
|||||||
@ -155,7 +155,7 @@ inline const filmRadiationModel& thermoSingleLayer::radiation() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline tmp<scalarField> thermoSingleLayer::Qconvw(const label patchi) const
|
inline tmp<scalarField> thermoSingleLayer::qconvw(const label patchi) const
|
||||||
{
|
{
|
||||||
const scalarField htc(htcw_->h()().boundaryField()[patchi]);
|
const scalarField htc(htcw_->h()().boundaryField()[patchi]);
|
||||||
const scalarField& Tp = T_.boundaryField()[patchi];
|
const scalarField& Tp = T_.boundaryField()[patchi];
|
||||||
@ -165,7 +165,7 @@ inline tmp<scalarField> thermoSingleLayer::Qconvw(const label patchi) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline tmp<scalarField> thermoSingleLayer::Qconvp(const label patchi) const
|
inline tmp<scalarField> thermoSingleLayer::qconvp(const label patchi) const
|
||||||
{
|
{
|
||||||
const scalarField htc(htcs_->h()().boundaryField()[patchi]);
|
const scalarField htc(htcs_->h()().boundaryField()[patchi]);
|
||||||
const scalarField& Tp = T_.boundaryField()[patchi];
|
const scalarField& Tp = T_.boundaryField()[patchi];
|
||||||
|
|||||||
@ -112,7 +112,7 @@ void thermalBaffle::solveEnergy()
|
|||||||
const label cellId = cells[i];
|
const label cellId = cells[i];
|
||||||
|
|
||||||
Q[cellId] =
|
Q[cellId] =
|
||||||
Qs_.boundaryField()[patchi][localFacei]
|
qs_.boundaryField()[patchi][localFacei]
|
||||||
/thickness_[localFacei];
|
/thickness_[localFacei];
|
||||||
|
|
||||||
rho[cellId] *= delta_.value()/thickness_[localFacei];
|
rho[cellId] *= delta_.value()/thickness_[localFacei];
|
||||||
@ -167,11 +167,11 @@ thermalBaffle::thermalBaffle
|
|||||||
nNonOrthCorr_(readLabel(solution().lookup("nNonOrthCorr"))),
|
nNonOrthCorr_(readLabel(solution().lookup("nNonOrthCorr"))),
|
||||||
thermo_(solidThermo::New(regionMesh(), dict)),
|
thermo_(solidThermo::New(regionMesh(), dict)),
|
||||||
h_(thermo_->he()),
|
h_(thermo_->he()),
|
||||||
Qs_
|
qs_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"Qs",
|
"qs",
|
||||||
regionMesh().time().timeName(),
|
regionMesh().time().timeName(),
|
||||||
regionMesh(),
|
regionMesh(),
|
||||||
IOobject::READ_IF_PRESENT,
|
IOobject::READ_IF_PRESENT,
|
||||||
@ -227,11 +227,11 @@ thermalBaffle::thermalBaffle
|
|||||||
nNonOrthCorr_(readLabel(solution().lookup("nNonOrthCorr"))),
|
nNonOrthCorr_(readLabel(solution().lookup("nNonOrthCorr"))),
|
||||||
thermo_(solidThermo::New(regionMesh())),
|
thermo_(solidThermo::New(regionMesh())),
|
||||||
h_(thermo_->he()),
|
h_(thermo_->he()),
|
||||||
Qs_
|
qs_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"Qs",
|
"qs",
|
||||||
regionMesh().time().timeName(),
|
regionMesh().time().timeName(),
|
||||||
regionMesh(),
|
regionMesh(),
|
||||||
IOobject::READ_IF_PRESENT,
|
IOobject::READ_IF_PRESENT,
|
||||||
@ -289,13 +289,13 @@ void thermalBaffle::init()
|
|||||||
if (oneD_ && !constantThickness_)
|
if (oneD_ && !constantThickness_)
|
||||||
{
|
{
|
||||||
label patchi = intCoupledPatchIDs_[0];
|
label patchi = intCoupledPatchIDs_[0];
|
||||||
const label Qsb = Qs_.boundaryField()[patchi].size();
|
const label qsb = qs_.boundaryField()[patchi].size();
|
||||||
|
|
||||||
if (Qsb!= thickness_.size())
|
if (qsb!= thickness_.size())
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "the boundary field of Qs is "
|
<< "the boundary field of qs is "
|
||||||
<< Qsb << " and " << nl
|
<< qsb << " and " << nl
|
||||||
<< "the field 'thickness' is " << thickness_.size() << nl
|
<< "the field 'thickness' is " << thickness_.size() << nl
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -94,7 +94,7 @@ protected:
|
|||||||
// Source term fields
|
// Source term fields
|
||||||
|
|
||||||
//- Surface energy source / [J/m2/s]
|
//- Surface energy source / [J/m2/s]
|
||||||
volScalarField Qs_;
|
volScalarField qs_;
|
||||||
|
|
||||||
//- Volumetric energy source / [J/m3/s]
|
//- Volumetric energy source / [J/m3/s]
|
||||||
volScalarField Q_;
|
volScalarField Q_;
|
||||||
|
|||||||
@ -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) 2012-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2012-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -103,6 +103,24 @@ public:
|
|||||||
|
|
||||||
// Access to thermodynamic state variables
|
// Access to thermodynamic state variables
|
||||||
|
|
||||||
|
//- Add the given density correction to the density field.
|
||||||
|
// Used to update the density field following pressure solution
|
||||||
|
// Limit thermo rho between rhoMin and rhoMax
|
||||||
|
virtual void correctRho
|
||||||
|
(
|
||||||
|
const volScalarField& deltaRho,
|
||||||
|
const dimensionedScalar& rhoMin,
|
||||||
|
const dimensionedScalar& rhoMax
|
||||||
|
) = 0;
|
||||||
|
|
||||||
|
|
||||||
|
//- Add the given density correction to the density field.
|
||||||
|
// Used to update the density field following pressure solution
|
||||||
|
virtual void correctRho
|
||||||
|
(
|
||||||
|
const volScalarField& deltaRho
|
||||||
|
) = 0;
|
||||||
|
|
||||||
//- Compressibility [s^2/m^2]
|
//- Compressibility [s^2/m^2]
|
||||||
virtual const volScalarField& psi() const = 0;
|
virtual const volScalarField& psi() const = 0;
|
||||||
|
|
||||||
|
|||||||
@ -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-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -102,6 +102,20 @@ Foam::tmp<Foam::scalarField> Foam::psiThermo::rho(const label patchi) const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::psiThermo::correctRho
|
||||||
|
(
|
||||||
|
const Foam::volScalarField& deltaRho,
|
||||||
|
const dimensionedScalar& rhoMin,
|
||||||
|
const dimensionedScalar& rhoMax
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
|
void Foam::psiThermo::correctRho
|
||||||
|
(
|
||||||
|
const Foam::volScalarField& deltaRho
|
||||||
|
)
|
||||||
|
{}
|
||||||
|
|
||||||
const Foam::volScalarField& Foam::psiThermo::psi() const
|
const Foam::volScalarField& Foam::psiThermo::psi() const
|
||||||
{
|
{
|
||||||
return psi_;
|
return psi_;
|
||||||
|
|||||||
@ -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-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -115,6 +115,23 @@ public:
|
|||||||
|
|
||||||
// Fields derived from thermodynamic state variables
|
// Fields derived from thermodynamic state variables
|
||||||
|
|
||||||
|
//- Add the given density correction to the density field.
|
||||||
|
// Used to update the density field following pressure solution.
|
||||||
|
// For psiThermo does nothing.
|
||||||
|
virtual void correctRho
|
||||||
|
(
|
||||||
|
const volScalarField& deltaRho,
|
||||||
|
const dimensionedScalar& rhoMin,
|
||||||
|
const dimensionedScalar& rhoMax
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Add the given density correction to the density field.
|
||||||
|
// Used to update the density field following pressure solution
|
||||||
|
virtual void correctRho
|
||||||
|
(
|
||||||
|
const volScalarField& deltaRho
|
||||||
|
);
|
||||||
|
|
||||||
//- Density [kg/m^3] - uses current value of pressure
|
//- Density [kg/m^3] - uses current value of pressure
|
||||||
virtual tmp<volScalarField> rho() const;
|
virtual tmp<volScalarField> rho() const;
|
||||||
|
|
||||||
|
|||||||
@ -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-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -173,6 +173,24 @@ Foam::volScalarField& Foam::rhoThermo::rho()
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::rhoThermo::correctRho
|
||||||
|
(
|
||||||
|
const Foam::volScalarField& deltaRho,
|
||||||
|
const dimensionedScalar& rhoMin,
|
||||||
|
const dimensionedScalar& rhoMax
|
||||||
|
)
|
||||||
|
{
|
||||||
|
rho_ += deltaRho;
|
||||||
|
rho_ = max(rho_, rhoMin);
|
||||||
|
rho_ = min(rho_, rhoMax);
|
||||||
|
}
|
||||||
|
|
||||||
|
void Foam::rhoThermo::correctRho(const Foam::volScalarField& deltaRho)
|
||||||
|
{
|
||||||
|
rho_ += deltaRho;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const Foam::volScalarField& Foam::rhoThermo::psi() const
|
const Foam::volScalarField& Foam::rhoThermo::psi() const
|
||||||
{
|
{
|
||||||
return psi_;
|
return psi_;
|
||||||
|
|||||||
@ -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-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
@ -136,6 +136,20 @@ public:
|
|||||||
//- Return non-const access to the local density field [kg/m^3]
|
//- Return non-const access to the local density field [kg/m^3]
|
||||||
virtual volScalarField& rho();
|
virtual volScalarField& rho();
|
||||||
|
|
||||||
|
//- Add the given density correction to the density field.
|
||||||
|
// Used to update the density field following pressure solution
|
||||||
|
// Limit thermo rho between rhoMin and rhoMax
|
||||||
|
virtual void correctRho
|
||||||
|
(
|
||||||
|
const volScalarField& deltaRho,
|
||||||
|
const dimensionedScalar& rhoMin,
|
||||||
|
const dimensionedScalar& rhoMax
|
||||||
|
);
|
||||||
|
|
||||||
|
//- Add the given density correction to the density field.
|
||||||
|
// Used to update the density field following pressure solution
|
||||||
|
virtual void correctRho(const volScalarField& deltaRho);
|
||||||
|
|
||||||
//- Compressibility [s^2/m^2]
|
//- Compressibility [s^2/m^2]
|
||||||
virtual const volScalarField& psi() const;
|
virtual const volScalarField& psi() const;
|
||||||
|
|
||||||
|
|||||||
@ -184,18 +184,18 @@ updateCoeffs()
|
|||||||
|
|
||||||
const scalarField& emissivity = temissivity();
|
const scalarField& emissivity = temissivity();
|
||||||
|
|
||||||
scalarField& Qem = ray.Qem().boundaryFieldRef()[patchi];
|
scalarField& qem = ray.qem().boundaryFieldRef()[patchi];
|
||||||
scalarField& Qin = ray.Qin().boundaryFieldRef()[patchi];
|
scalarField& qin = ray.qin().boundaryFieldRef()[patchi];
|
||||||
|
|
||||||
const vector& myRayId = dom.IRay(rayId).d();
|
const vector& myRayId = dom.IRay(rayId).d();
|
||||||
|
|
||||||
// Use updated Ir while iterating over rays
|
// Use updated Ir while iterating over rays
|
||||||
// avoids to used lagged Qin
|
// avoids to used lagged qin
|
||||||
scalarField Ir = dom.IRay(0).Qin().boundaryField()[patchi];
|
scalarField Ir = dom.IRay(0).qin().boundaryField()[patchi];
|
||||||
|
|
||||||
for (label rayI=1; rayI < dom.nRay(); rayI++)
|
for (label rayI=1; rayI < dom.nRay(); rayI++)
|
||||||
{
|
{
|
||||||
Ir += dom.IRay(rayI).Qin().boundaryField()[patchi];
|
Ir += dom.IRay(rayI).qin().boundaryField()[patchi];
|
||||||
}
|
}
|
||||||
|
|
||||||
if (solarLoad_)
|
if (solarLoad_)
|
||||||
@ -221,7 +221,7 @@ updateCoeffs()
|
|||||||
)/pi;
|
)/pi;
|
||||||
|
|
||||||
// Emmited heat flux from this ray direction
|
// Emmited heat flux from this ray direction
|
||||||
Qem[faceI] = refValue()[faceI]*nAve[faceI];
|
qem[faceI] = refValue()[faceI]*nAve[faceI];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -231,7 +231,7 @@ updateCoeffs()
|
|||||||
refValue()[faceI] = 0.0; //not used
|
refValue()[faceI] = 0.0; //not used
|
||||||
|
|
||||||
// Incident heat flux on this ray direction
|
// Incident heat flux on this ray direction
|
||||||
Qin[faceI] = Iw[faceI]*nAve[faceI];
|
qin[faceI] = Iw[faceI]*nAve[faceI];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -177,17 +177,17 @@ updateCoeffs()
|
|||||||
|
|
||||||
const scalarField& emissivity = temissivity();
|
const scalarField& emissivity = temissivity();
|
||||||
|
|
||||||
scalarField& Qem = ray.Qem().boundaryFieldRef()[patchi];
|
scalarField& qem = ray.qem().boundaryFieldRef()[patchi];
|
||||||
scalarField& Qin = ray.Qin().boundaryFieldRef()[patchi];
|
scalarField& qin = ray.qin().boundaryFieldRef()[patchi];
|
||||||
|
|
||||||
// Use updated Ir while iterating over rays
|
// Use updated Ir while iterating over rays
|
||||||
// avoids to used lagged Qin
|
// avoids to used lagged qin
|
||||||
/*
|
/*
|
||||||
scalarField Ir = dom.IRay(0).Qin().boundaryField()[patchi];
|
scalarField Ir = dom.IRay(0).qin().boundaryField()[patchi];
|
||||||
|
|
||||||
for (label rayI=1; rayI < dom.nRay(); rayI++)
|
for (label rayI=1; rayI < dom.nRay(); rayI++)
|
||||||
{
|
{
|
||||||
Ir += dom.IRay(rayI).Qin().boundaryField()[patchi];
|
Ir += dom.IRay(rayI).qin().boundaryField()[patchi];
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
@ -227,7 +227,7 @@ updateCoeffs()
|
|||||||
)/pi;
|
)/pi;
|
||||||
|
|
||||||
// Emmited heat flux from this ray direction (sum over lambdaId)
|
// Emmited heat flux from this ray direction (sum over lambdaId)
|
||||||
Qem[facei] += refValue()[facei]*nAve[facei];
|
qem[facei] += refValue()[facei]*nAve[facei];
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -237,7 +237,7 @@ updateCoeffs()
|
|||||||
refValue()[facei] = 0.0; //not used
|
refValue()[facei] = 0.0; //not used
|
||||||
|
|
||||||
// Incident heat flux on this ray direction (sum over lambdaId)
|
// Incident heat flux on this ray direction (sum over lambdaId)
|
||||||
Qin[facei] += Iw[facei]*nAve[facei];
|
qin[facei] += Iw[facei]*nAve[facei];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -243,31 +243,31 @@ Foam::radiation::fvDOM::fvDOM(const volScalarField& T)
|
|||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar("qr", dimMass/pow3(dimTime), 0.0)
|
dimensionedScalar("qr", dimMass/pow3(dimTime), 0.0)
|
||||||
),
|
),
|
||||||
Qem_
|
qem_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"Qem",
|
"qem",
|
||||||
mesh_.time().timeName(),
|
mesh_.time().timeName(),
|
||||||
mesh_,
|
mesh_,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar("Qem", dimMass/pow3(dimTime), 0.0)
|
dimensionedScalar("qem", dimMass/pow3(dimTime), 0.0)
|
||||||
),
|
),
|
||||||
Qin_
|
qin_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"Qin",
|
"qin",
|
||||||
mesh_.time().timeName(),
|
mesh_.time().timeName(),
|
||||||
mesh_,
|
mesh_,
|
||||||
IOobject::READ_IF_PRESENT,
|
IOobject::READ_IF_PRESENT,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar("Qin", dimMass/pow3(dimTime), 0.0)
|
dimensionedScalar("qin", dimMass/pow3(dimTime), 0.0)
|
||||||
),
|
),
|
||||||
a_
|
a_
|
||||||
(
|
(
|
||||||
@ -336,31 +336,31 @@ Foam::radiation::fvDOM::fvDOM
|
|||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar("qr", dimMass/pow3(dimTime), 0.0)
|
dimensionedScalar("qr", dimMass/pow3(dimTime), 0.0)
|
||||||
),
|
),
|
||||||
Qem_
|
qem_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"Qem",
|
"qem",
|
||||||
mesh_.time().timeName(),
|
mesh_.time().timeName(),
|
||||||
mesh_,
|
mesh_,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar("Qem", dimMass/pow3(dimTime), 0.0)
|
dimensionedScalar("qem", dimMass/pow3(dimTime), 0.0)
|
||||||
),
|
),
|
||||||
Qin_
|
qin_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"Qin",
|
"qin",
|
||||||
mesh_.time().timeName(),
|
mesh_.time().timeName(),
|
||||||
mesh_,
|
mesh_,
|
||||||
IOobject::READ_IF_PRESENT,
|
IOobject::READ_IF_PRESENT,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar("Qin", dimMass/pow3(dimTime), 0.0)
|
dimensionedScalar("qin", dimMass/pow3(dimTime), 0.0)
|
||||||
),
|
),
|
||||||
a_
|
a_
|
||||||
(
|
(
|
||||||
@ -509,16 +509,16 @@ void Foam::radiation::fvDOM::updateG()
|
|||||||
{
|
{
|
||||||
G_ = dimensionedScalar("zero",dimMass/pow3(dimTime), 0.0);
|
G_ = dimensionedScalar("zero",dimMass/pow3(dimTime), 0.0);
|
||||||
qr_ = dimensionedScalar("zero",dimMass/pow3(dimTime), 0.0);
|
qr_ = dimensionedScalar("zero",dimMass/pow3(dimTime), 0.0);
|
||||||
Qem_ = dimensionedScalar("zero", dimMass/pow3(dimTime), 0.0);
|
qem_ = dimensionedScalar("zero", dimMass/pow3(dimTime), 0.0);
|
||||||
Qin_ = dimensionedScalar("zero", dimMass/pow3(dimTime), 0.0);
|
qin_ = dimensionedScalar("zero", dimMass/pow3(dimTime), 0.0);
|
||||||
|
|
||||||
forAll(IRay_, rayI)
|
forAll(IRay_, rayI)
|
||||||
{
|
{
|
||||||
IRay_[rayI].addIntensity();
|
IRay_[rayI].addIntensity();
|
||||||
G_ += IRay_[rayI].I()*IRay_[rayI].omega();
|
G_ += IRay_[rayI].I()*IRay_[rayI].omega();
|
||||||
qr_.boundaryFieldRef() += IRay_[rayI].qr().boundaryField();
|
qr_.boundaryFieldRef() += IRay_[rayI].qr().boundaryField();
|
||||||
Qem_.boundaryFieldRef() += IRay_[rayI].Qem().boundaryField();
|
qem_.boundaryFieldRef() += IRay_[rayI].qem().boundaryField();
|
||||||
Qin_.boundaryFieldRef() += IRay_[rayI].Qin().boundaryField();
|
qin_.boundaryFieldRef() += IRay_[rayI].qin().boundaryField();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -107,10 +107,10 @@ class fvDOM
|
|||||||
volScalarField qr_;
|
volScalarField qr_;
|
||||||
|
|
||||||
//- Emmited radiative heat flux [W/m2]
|
//- Emmited radiative heat flux [W/m2]
|
||||||
volScalarField Qem_;
|
volScalarField qem_;
|
||||||
|
|
||||||
//- Incidet radiative heat flux [W/m2]
|
//- Incidet radiative heat flux [W/m2]
|
||||||
volScalarField Qin_;
|
volScalarField qin_;
|
||||||
|
|
||||||
//- Total absorption coefficient [1/m]
|
//- Total absorption coefficient [1/m]
|
||||||
volScalarField a_;
|
volScalarField a_;
|
||||||
@ -255,10 +255,10 @@ public:
|
|||||||
inline const volScalarField& qr() const;
|
inline const volScalarField& qr() const;
|
||||||
|
|
||||||
//- Const access to incident radiative heat flux field
|
//- Const access to incident radiative heat flux field
|
||||||
inline const volScalarField& Qin() const;
|
inline const volScalarField& qin() const;
|
||||||
|
|
||||||
//- Const access to emitted radiative heat flux field
|
//- Const access to emitted radiative heat flux field
|
||||||
inline const volScalarField& Qem() const;
|
inline const volScalarField& qem() const;
|
||||||
|
|
||||||
//- Const access to black body
|
//- Const access to black body
|
||||||
inline const blackBodyEmission& blackBody() const;
|
inline const blackBodyEmission& blackBody() const;
|
||||||
|
|||||||
@ -91,15 +91,15 @@ inline const Foam::volScalarField& Foam::radiation::fvDOM::qr() const
|
|||||||
return qr_;
|
return qr_;
|
||||||
}
|
}
|
||||||
|
|
||||||
inline const Foam::volScalarField& Foam::radiation::fvDOM::Qin() const
|
inline const Foam::volScalarField& Foam::radiation::fvDOM::qin() const
|
||||||
{
|
{
|
||||||
return Qin_;
|
return qin_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::volScalarField& Foam::radiation::fvDOM::Qem() const
|
inline const Foam::volScalarField& Foam::radiation::fvDOM::qem() const
|
||||||
{
|
{
|
||||||
return Qem_;
|
return qem_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -80,31 +80,31 @@ Foam::radiation::radiativeIntensityRay::radiativeIntensityRay
|
|||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar("qr", dimMass/pow3(dimTime), 0.0)
|
dimensionedScalar("qr", dimMass/pow3(dimTime), 0.0)
|
||||||
),
|
),
|
||||||
Qin_
|
qin_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"Qin" + name(rayId),
|
"qin" + name(rayId),
|
||||||
mesh_.time().timeName(),
|
mesh_.time().timeName(),
|
||||||
mesh_,
|
mesh_,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar("Qin", dimMass/pow3(dimTime), 0.0)
|
dimensionedScalar("qin", dimMass/pow3(dimTime), 0.0)
|
||||||
),
|
),
|
||||||
Qem_
|
qem_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"Qem" + name(rayId),
|
"qem" + name(rayId),
|
||||||
mesh_.time().timeName(),
|
mesh_.time().timeName(),
|
||||||
mesh_,
|
mesh_,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar("Qem", dimMass/pow3(dimTime), 0.0)
|
dimensionedScalar("qem", dimMass/pow3(dimTime), 0.0)
|
||||||
),
|
),
|
||||||
d_(Zero),
|
d_(Zero),
|
||||||
dAve_(Zero),
|
dAve_(Zero),
|
||||||
|
|||||||
@ -83,10 +83,10 @@ private:
|
|||||||
volScalarField qr_;
|
volScalarField qr_;
|
||||||
|
|
||||||
//- Incident radiative heat flux on boundary
|
//- Incident radiative heat flux on boundary
|
||||||
volScalarField Qin_;
|
volScalarField qin_;
|
||||||
|
|
||||||
//- Emitted radiative heat flux on boundary
|
//- Emitted radiative heat flux on boundary
|
||||||
volScalarField Qem_;
|
volScalarField qem_;
|
||||||
|
|
||||||
//- Direction
|
//- Direction
|
||||||
vector d_;
|
vector d_;
|
||||||
@ -182,16 +182,16 @@ public:
|
|||||||
inline volScalarField& qr();
|
inline volScalarField& qr();
|
||||||
|
|
||||||
//- Return non-const access to the boundary incident heat flux
|
//- Return non-const access to the boundary incident heat flux
|
||||||
inline volScalarField& Qin();
|
inline volScalarField& qin();
|
||||||
|
|
||||||
//- Return non-const access to the boundary emmited heat flux
|
//- Return non-const access to the boundary emmited heat flux
|
||||||
inline volScalarField& Qem();
|
inline volScalarField& qem();
|
||||||
|
|
||||||
//- Return const access to the boundary incident heat flux
|
//- Return const access to the boundary incident heat flux
|
||||||
inline const volScalarField& Qin() const;
|
inline const volScalarField& qin() const;
|
||||||
|
|
||||||
//- Return const access to the boundary emmited heat flux
|
//- Return const access to the boundary emmited heat flux
|
||||||
inline const volScalarField& Qem() const;
|
inline const volScalarField& qem() const;
|
||||||
|
|
||||||
//- Return direction
|
//- Return direction
|
||||||
inline const vector& d() const;
|
inline const vector& d() const;
|
||||||
|
|||||||
@ -43,28 +43,28 @@ inline Foam::volScalarField& Foam::radiation::radiativeIntensityRay::qr()
|
|||||||
}
|
}
|
||||||
|
|
||||||
inline const Foam::volScalarField& Foam::radiation::
|
inline const Foam::volScalarField& Foam::radiation::
|
||||||
radiativeIntensityRay::Qin() const
|
radiativeIntensityRay::qin() const
|
||||||
{
|
{
|
||||||
return Qin_;
|
return qin_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::volScalarField& Foam::radiation::radiativeIntensityRay::Qin()
|
inline Foam::volScalarField& Foam::radiation::radiativeIntensityRay::qin()
|
||||||
{
|
{
|
||||||
return Qin_;
|
return qin_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::volScalarField& Foam::radiation::
|
inline const Foam::volScalarField& Foam::radiation::
|
||||||
radiativeIntensityRay::Qem() const
|
radiativeIntensityRay::qem() const
|
||||||
{
|
{
|
||||||
return Qem_;
|
return qem_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
inline Foam::volScalarField& Foam::radiation::radiativeIntensityRay::Qem()
|
inline Foam::volScalarField& Foam::radiation::radiativeIntensityRay::qem()
|
||||||
{
|
{
|
||||||
return Qem_;
|
return qem_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -43,7 +43,7 @@ namespace Foam
|
|||||||
}
|
}
|
||||||
|
|
||||||
const Foam::word Foam::radiation::radiationModel::externalRadHeatFieldName_ =
|
const Foam::word Foam::radiation::radiationModel::externalRadHeatFieldName_ =
|
||||||
"QrExt";
|
"qrExt";
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
|||||||
@ -119,7 +119,7 @@ void Foam::radiation::solarLoad::updateDirectHitRadiation
|
|||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||||
const scalarField& V = mesh_.V();
|
const scalarField& V = mesh_.V();
|
||||||
volScalarField::Boundary& QrBf = Qr_.boundaryFieldRef();
|
volScalarField::Boundary& qrBf = qr_.boundaryFieldRef();
|
||||||
|
|
||||||
forAll(hitFacesId, i)
|
forAll(hitFacesId, i)
|
||||||
{
|
{
|
||||||
@ -135,7 +135,7 @@ void Foam::radiation::solarLoad::updateDirectHitRadiation
|
|||||||
|
|
||||||
for (label bandI = 0; bandI < nBands_; bandI++)
|
for (label bandI = 0; bandI < nBands_; bandI++)
|
||||||
{
|
{
|
||||||
QrBf[patchID][localFaceI] +=
|
qrBf[patchID][localFaceI] +=
|
||||||
(qPrim & n[localFaceI])
|
(qPrim & n[localFaceI])
|
||||||
* spectralDistribution_[bandI]
|
* spectralDistribution_[bandI]
|
||||||
* absorptivity_[patchID][bandI]()[localFaceI];
|
* absorptivity_[patchID][bandI]()[localFaceI];
|
||||||
@ -167,7 +167,7 @@ void Foam::radiation::solarLoad::updateSkyDiffusiveRadiation
|
|||||||
{
|
{
|
||||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||||
const scalarField& V = mesh_.V();
|
const scalarField& V = mesh_.V();
|
||||||
volScalarField::Boundary& QrBf = Qr_.boundaryFieldRef();
|
volScalarField::Boundary& qrBf = qr_.boundaryFieldRef();
|
||||||
|
|
||||||
switch(solarCalc_.sunLoadModel())
|
switch(solarCalc_.sunLoadModel())
|
||||||
{
|
{
|
||||||
@ -231,7 +231,7 @@ void Foam::radiation::solarLoad::updateSkyDiffusiveRadiation
|
|||||||
{
|
{
|
||||||
for (label bandI = 0; bandI < nBands_; bandI++)
|
for (label bandI = 0; bandI < nBands_; bandI++)
|
||||||
{
|
{
|
||||||
QrBf[patchID][faceI] +=
|
qrBf[patchID][faceI] +=
|
||||||
(Ed + Er)
|
(Ed + Er)
|
||||||
* spectralDistribution_[bandI]
|
* spectralDistribution_[bandI]
|
||||||
* absorptivity_[patchID][bandI]()[faceI];
|
* absorptivity_[patchID][bandI]()[faceI];
|
||||||
@ -269,7 +269,7 @@ void Foam::radiation::solarLoad::updateSkyDiffusiveRadiation
|
|||||||
{
|
{
|
||||||
for (label bandI = 0; bandI < nBands_; bandI++)
|
for (label bandI = 0; bandI < nBands_; bandI++)
|
||||||
{
|
{
|
||||||
QrBf[patchID][faceI] +=
|
qrBf[patchID][faceI] +=
|
||||||
solarCalc_.diffuseSolarRad()
|
solarCalc_.diffuseSolarRad()
|
||||||
* spectralDistribution_[bandI]
|
* spectralDistribution_[bandI]
|
||||||
* absorptivity_[patchID][bandI]()[faceI];
|
* absorptivity_[patchID][bandI]()[faceI];
|
||||||
@ -555,9 +555,9 @@ void Foam::radiation::solarLoad::calculateQdiff
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
volScalarField::Boundary& QsBf = QsecondRad_.boundaryFieldRef();
|
volScalarField::Boundary& qsBf = qsecondRad_.boundaryFieldRef();
|
||||||
|
|
||||||
// Fill QsecondRad_
|
// Fill qsecondRad_
|
||||||
label compactId = 0;
|
label compactId = 0;
|
||||||
forAll(includePatches_, i)
|
forAll(includePatches_, i)
|
||||||
{
|
{
|
||||||
@ -566,7 +566,7 @@ void Foam::radiation::solarLoad::calculateQdiff
|
|||||||
|
|
||||||
if (pp.size() > 0)
|
if (pp.size() > 0)
|
||||||
{
|
{
|
||||||
scalarField& Qrp = QsBf[patchID];
|
scalarField& qrp = qsBf[patchID];
|
||||||
|
|
||||||
const labelList& coarsePatchFace =
|
const labelList& coarsePatchFace =
|
||||||
coarseMesh_->patchFaceMap()[patchID];
|
coarseMesh_->patchFaceMap()[patchID];
|
||||||
@ -578,7 +578,7 @@ void Foam::radiation::solarLoad::calculateQdiff
|
|||||||
forAll(fineFaces, k)
|
forAll(fineFaces, k)
|
||||||
{
|
{
|
||||||
label faceI = fineFaces[k];
|
label faceI = fineFaces[k];
|
||||||
Qrp[faceI] = localqDiffusive[compactId];
|
qrp[faceI] = localqDiffusive[compactId];
|
||||||
}
|
}
|
||||||
compactId ++;
|
compactId ++;
|
||||||
}
|
}
|
||||||
@ -587,15 +587,15 @@ void Foam::radiation::solarLoad::calculateQdiff
|
|||||||
|
|
||||||
const scalarField& V = mesh_.V();
|
const scalarField& V = mesh_.V();
|
||||||
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
const polyBoundaryMesh& patches = mesh_.boundaryMesh();
|
||||||
volScalarField::Boundary& QrBf = Qr_.boundaryFieldRef();
|
volScalarField::Boundary& qrBf = qr_.boundaryFieldRef();
|
||||||
|
|
||||||
forAllConstIter(labelHashSet, includePatches, iter)
|
forAllConstIter(labelHashSet, includePatches, iter)
|
||||||
{
|
{
|
||||||
const label patchID = iter.key();
|
const label patchID = iter.key();
|
||||||
const scalarField& qSecond = QsecondRad_.boundaryField()[patchID];
|
const scalarField& qSecond = qsecondRad_.boundaryField()[patchID];
|
||||||
if (includeMappedPatchBasePatches[patchID])
|
if (includeMappedPatchBasePatches[patchID])
|
||||||
{
|
{
|
||||||
QrBf[patchID] += qSecond;
|
qrBf[patchID] += qSecond;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -630,31 +630,31 @@ Foam::radiation::solarLoad::solarLoad(const volScalarField& T)
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
coarseMesh_(),
|
coarseMesh_(),
|
||||||
Qr_
|
qr_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"Qr",
|
"qr",
|
||||||
mesh_.time().timeName(),
|
mesh_.time().timeName(),
|
||||||
mesh_,
|
mesh_,
|
||||||
IOobject::READ_IF_PRESENT,
|
IOobject::READ_IF_PRESENT,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar("Qr", dimMass/pow3(dimTime), 0.0)
|
dimensionedScalar("qr", dimMass/pow3(dimTime), 0.0)
|
||||||
),
|
),
|
||||||
QsecondRad_
|
qsecondRad_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"QsecondRad",
|
"qsecondRad",
|
||||||
mesh_.time().timeName(),
|
mesh_.time().timeName(),
|
||||||
mesh_,
|
mesh_,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar("QsecondRad", dimMass/pow3(dimTime), 0.0)
|
dimensionedScalar("qsecondRad", dimMass/pow3(dimTime), 0.0)
|
||||||
),
|
),
|
||||||
hitFaces_(),
|
hitFaces_(),
|
||||||
Ru_
|
Ru_
|
||||||
@ -720,31 +720,31 @@ Foam::radiation::solarLoad::solarLoad
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
coarseMesh_(),
|
coarseMesh_(),
|
||||||
Qr_
|
qr_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"Qr",
|
"qr",
|
||||||
mesh_.time().timeName(),
|
mesh_.time().timeName(),
|
||||||
mesh_,
|
mesh_,
|
||||||
IOobject::READ_IF_PRESENT,
|
IOobject::READ_IF_PRESENT,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar("Qr", dimMass/pow3(dimTime), 0.0)
|
dimensionedScalar("qr", dimMass/pow3(dimTime), 0.0)
|
||||||
),
|
),
|
||||||
QsecondRad_
|
qsecondRad_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"QsecondRad",
|
"qsecondRad",
|
||||||
mesh_.time().timeName(),
|
mesh_.time().timeName(),
|
||||||
mesh_,
|
mesh_,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar("QsecondRad", dimMass/pow3(dimTime), 0.0)
|
dimensionedScalar("qsecondRad", dimMass/pow3(dimTime), 0.0)
|
||||||
),
|
),
|
||||||
hitFaces_(),
|
hitFaces_(),
|
||||||
Ru_
|
Ru_
|
||||||
@ -812,7 +812,7 @@ Foam::radiation::solarLoad::solarLoad
|
|||||||
)
|
)
|
||||||
),
|
),
|
||||||
coarseMesh_(),
|
coarseMesh_(),
|
||||||
Qr_
|
qr_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
@ -823,20 +823,20 @@ Foam::radiation::solarLoad::solarLoad
|
|||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar("Qr", dimMass/pow3(dimTime), 0.0)
|
dimensionedScalar("qr", dimMass/pow3(dimTime), 0.0)
|
||||||
),
|
),
|
||||||
QsecondRad_
|
qsecondRad_
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
(
|
(
|
||||||
"QsecondRad",
|
"qsecondRad",
|
||||||
mesh_.time().timeName(),
|
mesh_.time().timeName(),
|
||||||
mesh_,
|
mesh_,
|
||||||
IOobject::NO_READ,
|
IOobject::NO_READ,
|
||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh_,
|
mesh_,
|
||||||
dimensionedScalar("QsecondRad", dimMass/pow3(dimTime), 0.0)
|
dimensionedScalar("qsecondRad", dimMass/pow3(dimTime), 0.0)
|
||||||
),
|
),
|
||||||
hitFaces_(),
|
hitFaces_(),
|
||||||
Ru_
|
Ru_
|
||||||
@ -942,13 +942,13 @@ void Foam::radiation::solarLoad::calculate()
|
|||||||
}
|
}
|
||||||
|
|
||||||
bool facesChanged = updateHitFaces();
|
bool facesChanged = updateHitFaces();
|
||||||
volScalarField::Boundary& QrBf = Qr_.boundaryFieldRef();
|
volScalarField::Boundary& qrBf = qr_.boundaryFieldRef();
|
||||||
|
|
||||||
if (facesChanged)
|
if (facesChanged)
|
||||||
{
|
{
|
||||||
// Reset Ru and Qr
|
// Reset Ru and qr
|
||||||
Ru_ = dimensionedScalar("Ru", dimMass/dimLength/pow3(dimTime), 0.0);
|
Ru_ = dimensionedScalar("Ru", dimMass/dimLength/pow3(dimTime), 0.0);
|
||||||
QrBf = 0.0;
|
qrBf = 0.0;
|
||||||
|
|
||||||
// Add direct hit radation
|
// Add direct hit radation
|
||||||
const labelList& hitFacesId = hitFaces_->rayStartFaces();
|
const labelList& hitFacesId = hitFaces_->rayStartFaces();
|
||||||
|
|||||||
@ -105,10 +105,10 @@ private:
|
|||||||
autoPtr<singleCellFvMesh> coarseMesh_;
|
autoPtr<singleCellFvMesh> coarseMesh_;
|
||||||
|
|
||||||
//- Net radiative heat flux [W/m2]
|
//- Net radiative heat flux [W/m2]
|
||||||
volScalarField Qr_;
|
volScalarField qr_;
|
||||||
|
|
||||||
//- Secondary solar radiative heat flux [W/m2]
|
//- Secondary solar radiative heat flux [W/m2]
|
||||||
volScalarField QsecondRad_;
|
volScalarField qsecondRad_;
|
||||||
|
|
||||||
//- Direct hit faces Ids
|
//- Direct hit faces Ids
|
||||||
autoPtr<faceShading> hitFaces_;
|
autoPtr<faceShading> hitFaces_;
|
||||||
@ -143,10 +143,10 @@ private:
|
|||||||
//- Face-compact map
|
//- Face-compact map
|
||||||
labelListIOList visibleFaceFaces_;
|
labelListIOList visibleFaceFaces_;
|
||||||
|
|
||||||
//- Couple solids through mapped boundary patch using Qr (default:true)
|
//- Couple solids through mapped boundary patch using qr (default:true)
|
||||||
bool solidCoupled_;
|
bool solidCoupled_;
|
||||||
|
|
||||||
//- Couple wall patches using Qr (default:false)
|
//- Couple wall patches using qr (default:false)
|
||||||
bool wallCoupled_;
|
bool wallCoupled_;
|
||||||
|
|
||||||
//- Absorptivity list
|
//- Absorptivity list
|
||||||
|
|||||||
@ -149,8 +149,8 @@ humidityTemperatureCoupledMixedFvPatchScalarField
|
|||||||
rhoName_("rho"),
|
rhoName_("rho"),
|
||||||
muName_("thermo:mu"),
|
muName_("thermo:mu"),
|
||||||
TnbrName_("T"),
|
TnbrName_("T"),
|
||||||
QrNbrName_("none"),
|
qrNbrName_("none"),
|
||||||
QrName_("none"),
|
qrName_("none"),
|
||||||
specieName_("none"),
|
specieName_("none"),
|
||||||
liquid_(nullptr),
|
liquid_(nullptr),
|
||||||
liquidDict_(nullptr),
|
liquidDict_(nullptr),
|
||||||
@ -189,8 +189,8 @@ humidityTemperatureCoupledMixedFvPatchScalarField
|
|||||||
rhoName_(psf.rhoName_),
|
rhoName_(psf.rhoName_),
|
||||||
muName_(psf.muName_),
|
muName_(psf.muName_),
|
||||||
TnbrName_(psf.TnbrName_),
|
TnbrName_(psf.TnbrName_),
|
||||||
QrNbrName_(psf.QrNbrName_),
|
qrNbrName_(psf.qrNbrName_),
|
||||||
QrName_(psf.QrName_),
|
qrName_(psf.qrName_),
|
||||||
specieName_(psf.specieName_),
|
specieName_(psf.specieName_),
|
||||||
liquid_(psf.liquid_, false),
|
liquid_(psf.liquid_, false),
|
||||||
liquidDict_(psf.liquidDict_),
|
liquidDict_(psf.liquidDict_),
|
||||||
@ -224,8 +224,8 @@ humidityTemperatureCoupledMixedFvPatchScalarField
|
|||||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
||||||
muName_(dict.lookupOrDefault<word>("mu", "thermo:mu")),
|
muName_(dict.lookupOrDefault<word>("mu", "thermo:mu")),
|
||||||
TnbrName_(dict.lookupOrDefault<word>("Tnbr", "T")),
|
TnbrName_(dict.lookupOrDefault<word>("Tnbr", "T")),
|
||||||
QrNbrName_(dict.lookupOrDefault<word>("QrNbr", "none")),
|
qrNbrName_(dict.lookupOrDefault<word>("qrNbr", "none")),
|
||||||
QrName_(dict.lookupOrDefault<word>("Qr", "none")),
|
qrName_(dict.lookupOrDefault<word>("qr", "none")),
|
||||||
specieName_(dict.lookupOrDefault<word>("specie", "none")),
|
specieName_(dict.lookupOrDefault<word>("specie", "none")),
|
||||||
liquid_(nullptr),
|
liquid_(nullptr),
|
||||||
liquidDict_(),
|
liquidDict_(),
|
||||||
@ -348,8 +348,8 @@ humidityTemperatureCoupledMixedFvPatchScalarField
|
|||||||
rhoName_(psf.rhoName_),
|
rhoName_(psf.rhoName_),
|
||||||
muName_(psf.muName_),
|
muName_(psf.muName_),
|
||||||
TnbrName_(psf.TnbrName_),
|
TnbrName_(psf.TnbrName_),
|
||||||
QrNbrName_(psf.QrNbrName_),
|
qrNbrName_(psf.qrNbrName_),
|
||||||
QrName_(psf.QrName_),
|
qrName_(psf.qrName_),
|
||||||
specieName_(psf.specieName_),
|
specieName_(psf.specieName_),
|
||||||
liquid_(psf.liquid_, false),
|
liquid_(psf.liquid_, false),
|
||||||
liquidDict_(psf.liquidDict_),
|
liquidDict_(psf.liquidDict_),
|
||||||
@ -675,26 +675,26 @@ void Foam::humidityTemperatureCoupledMixedFvPatchScalarField::updateCoeffs()
|
|||||||
mpp.distribute(dmHfgNbr);
|
mpp.distribute(dmHfgNbr);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Obtain Rad heat (Qr)
|
// Obtain Rad heat (qr)
|
||||||
scalarField Qr(Tp.size(), 0.0);
|
scalarField qr(Tp.size(), 0.0);
|
||||||
if (QrName_ != "none")
|
if (qrName_ != "none")
|
||||||
{
|
{
|
||||||
Qr = patch().lookupPatchField<volScalarField, scalar>(QrName_);
|
qr = patch().lookupPatchField<volScalarField, scalar>(qrName_);
|
||||||
}
|
}
|
||||||
|
|
||||||
scalarField QrNbr(Tp.size(), 0.0);
|
scalarField qrNbr(Tp.size(), 0.0);
|
||||||
if (QrNbrName_ != "none")
|
if (qrNbrName_ != "none")
|
||||||
{
|
{
|
||||||
QrNbr = nbrPatch.lookupPatchField<volScalarField, scalar>(QrNbrName_);
|
qrNbr = nbrPatch.lookupPatchField<volScalarField, scalar>(qrNbrName_);
|
||||||
mpp.distribute(QrNbr);
|
mpp.distribute(qrNbr);
|
||||||
}
|
}
|
||||||
|
|
||||||
const scalarField dmHfg(dmHfgNbr + dmHfg_);
|
const scalarField dmHfg(dmHfgNbr + dmHfg_);
|
||||||
|
|
||||||
const scalarField mpCpdt(mpCpTpNbr + mpCpTp_);
|
const scalarField mpCpdt(mpCpTpNbr + mpCpTp_);
|
||||||
|
|
||||||
// Qr > 0 (heat up the wall)
|
// qr > 0 (heat up the wall)
|
||||||
scalarField alpha(KDeltaNbr + mpCpdt - (Qr + QrNbr)/Tp);
|
scalarField alpha(KDeltaNbr + mpCpdt - (qr + qrNbr)/Tp);
|
||||||
|
|
||||||
valueFraction() = alpha/(alpha + myKDelta_);
|
valueFraction() = alpha/(alpha + myKDelta_);
|
||||||
|
|
||||||
@ -742,8 +742,8 @@ void Foam::humidityTemperatureCoupledMixedFvPatchScalarField::write
|
|||||||
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
writeEntryIfDifferent<word>(os, "rho", "rho", rhoName_);
|
||||||
writeEntryIfDifferent<word>(os, "mu", "thermo:mu", muName_);
|
writeEntryIfDifferent<word>(os, "mu", "thermo:mu", muName_);
|
||||||
writeEntryIfDifferent<word>(os, "Tnbr", "T", TnbrName_);
|
writeEntryIfDifferent<word>(os, "Tnbr", "T", TnbrName_);
|
||||||
writeEntryIfDifferent<word>(os, "QrNbr", "none", QrNbrName_);
|
writeEntryIfDifferent<word>(os, "qrNbr", "none", qrNbrName_);
|
||||||
writeEntryIfDifferent<word>(os, "Qr", "none", QrName_);
|
writeEntryIfDifferent<word>(os, "qr", "none", qrName_);
|
||||||
|
|
||||||
if (fluid_)
|
if (fluid_)
|
||||||
{
|
{
|
||||||
|
|||||||
@ -212,10 +212,10 @@ private:
|
|||||||
const word TnbrName_;
|
const word TnbrName_;
|
||||||
|
|
||||||
//- Name of the radiative heat flux in the neighbout region
|
//- Name of the radiative heat flux in the neighbout region
|
||||||
const word QrNbrName_;
|
const word qrNbrName_;
|
||||||
|
|
||||||
//- Name of the radiative heat flux field
|
//- Name of the radiative heat flux field
|
||||||
const word QrName_;
|
const word qrName_;
|
||||||
|
|
||||||
//- Name of the species on which the mass transfered (default H2O)
|
//- Name of the species on which the mass transfered (default H2O)
|
||||||
const word specieName_;
|
const word specieName_;
|
||||||
|
|||||||
@ -43,8 +43,8 @@ boundaryField
|
|||||||
type compressible::turbulentTemperatureRadCoupledMixed;
|
type compressible::turbulentTemperatureRadCoupledMixed;
|
||||||
value uniform 294.75;
|
value uniform 294.75;
|
||||||
Tnbr T;
|
Tnbr T;
|
||||||
QrNbr none;
|
qrNbr none;
|
||||||
Qr Qr;
|
qr qr;
|
||||||
kappaMethod fluidThermo;
|
kappaMethod fluidThermo;
|
||||||
}
|
}
|
||||||
region0_to_panelRegion_internalWallPanel_top
|
region0_to_panelRegion_internalWallPanel_top
|
||||||
@ -52,8 +52,8 @@ boundaryField
|
|||||||
type compressible::turbulentTemperatureRadCoupledMixed;
|
type compressible::turbulentTemperatureRadCoupledMixed;
|
||||||
value uniform 294.75;
|
value uniform 294.75;
|
||||||
Tnbr T;
|
Tnbr T;
|
||||||
QrNbr none;
|
qrNbr none;
|
||||||
Qr Qr;
|
qr qr;
|
||||||
kappaMethod fluidThermo;
|
kappaMethod fluidThermo;
|
||||||
}
|
}
|
||||||
region0_to_panelRegion_internalWallPanel_bottom
|
region0_to_panelRegion_internalWallPanel_bottom
|
||||||
@ -61,8 +61,8 @@ boundaryField
|
|||||||
type compressible::turbulentTemperatureRadCoupledMixed;
|
type compressible::turbulentTemperatureRadCoupledMixed;
|
||||||
value uniform 294.75;
|
value uniform 294.75;
|
||||||
Tnbr T;
|
Tnbr T;
|
||||||
QrNbr none;
|
qrNbr none;
|
||||||
Qr Qr;
|
qr qr;
|
||||||
kappaMethod fluidThermo;
|
kappaMethod fluidThermo;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -47,8 +47,8 @@ boundaryField
|
|||||||
type compressible::turbulentTemperatureRadCoupledMixed;
|
type compressible::turbulentTemperatureRadCoupledMixed;
|
||||||
neighbourField T;
|
neighbourField T;
|
||||||
kappaMethod solidThermo;
|
kappaMethod solidThermo;
|
||||||
QrNbr Qr;
|
qrNbr qr;
|
||||||
Qr none;
|
qr none;
|
||||||
value $internalField;
|
value $internalField;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -70,7 +70,7 @@ functions
|
|||||||
fields (phi);
|
fields (phi);
|
||||||
}
|
}
|
||||||
|
|
||||||
wallPanel_Qin
|
wallPanel_qin
|
||||||
{
|
{
|
||||||
type patchProbes;
|
type patchProbes;
|
||||||
libs ("libsampling.so");
|
libs ("libsampling.so");
|
||||||
@ -84,10 +84,10 @@ functions
|
|||||||
(0.2 0.2 0.01) // HF3
|
(0.2 0.2 0.01) // HF3
|
||||||
(0.0 0.4 0.01) // HF4
|
(0.0 0.4 0.01) // HF4
|
||||||
);
|
);
|
||||||
fields (Qin);
|
fields (qin);
|
||||||
}
|
}
|
||||||
|
|
||||||
inletQr_Qin
|
inletqr_qin
|
||||||
{
|
{
|
||||||
type patchProbes;
|
type patchProbes;
|
||||||
libs ("libsampling.so");
|
libs ("libsampling.so");
|
||||||
@ -103,7 +103,7 @@ functions
|
|||||||
(-0.02 0.0 0.02) // HF4
|
(-0.02 0.0 0.02) // HF4
|
||||||
(-0.02 0.0 -0.02) // HF5
|
(-0.02 0.0 -0.02) // HF5
|
||||||
);
|
);
|
||||||
fields (Qr Qin);
|
fields (qr qin);
|
||||||
}
|
}
|
||||||
|
|
||||||
thermoCouple
|
thermoCouple
|
||||||
|
|||||||
@ -38,7 +38,7 @@ boundaryField
|
|||||||
type fixedIncidentRadiation;
|
type fixedIncidentRadiation;
|
||||||
kappaMethod solidThermo;
|
kappaMethod solidThermo;
|
||||||
kappa none;
|
kappa none;
|
||||||
QrIncident uniform 60000.0; //W
|
qrIncident uniform 60000.0; //W
|
||||||
value uniform 298.15;
|
value uniform 298.15;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -25,7 +25,7 @@ FoamFile
|
|||||||
|
|
||||||
reactingOneDimCoeffs
|
reactingOneDimCoeffs
|
||||||
{
|
{
|
||||||
QrHSource no; //Energy source term due in depht radiation
|
qrHSource no; //Energy source term due in depht radiation
|
||||||
|
|
||||||
filmCoupled false;
|
filmCoupled false;
|
||||||
|
|
||||||
|
|||||||
@ -7,7 +7,7 @@
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
{
|
{
|
||||||
version 2;
|
version 2.0;
|
||||||
format ascii;
|
format ascii;
|
||||||
class dictionary;
|
class dictionary;
|
||||||
location "system";
|
location "system";
|
||||||
@ -23,7 +23,7 @@ startTime 0;
|
|||||||
|
|
||||||
stopAt endTime;
|
stopAt endTime;
|
||||||
|
|
||||||
endTime 7000;
|
endTime 6000;
|
||||||
|
|
||||||
deltaT 1;
|
deltaT 1;
|
||||||
|
|
||||||
|
|||||||
@ -54,6 +54,7 @@ PIMPLE
|
|||||||
nCorrectors 1;
|
nCorrectors 1;
|
||||||
nNonOrthogonalCorrectors 0;
|
nNonOrthogonalCorrectors 0;
|
||||||
consistent yes;
|
consistent yes;
|
||||||
|
SIMPLErho yes;
|
||||||
|
|
||||||
pMaxFactor 1.5;
|
pMaxFactor 1.5;
|
||||||
pMinFactor 0.9;
|
pMinFactor 0.9;
|
||||||
|
|||||||
42
tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/0/T
Normal file
42
tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/0/T
Normal file
@ -0,0 +1,42 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
object T;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 0 0 1 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 300;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
Default_Boundary_Region
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value uniform 350;
|
||||||
|
}
|
||||||
|
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue $internalField;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
43
tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/0/U
Normal file
43
tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/0/U
Normal file
@ -0,0 +1,43 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volVectorField;
|
||||||
|
object U;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 1 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform (0 0 0);
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
Default_Boundary_Region
|
||||||
|
{
|
||||||
|
type noSlip;
|
||||||
|
}
|
||||||
|
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type flowRateInletVelocity;
|
||||||
|
massFlowRate constant 5;
|
||||||
|
rhoInlet 1000; // Guess for rho
|
||||||
|
}
|
||||||
|
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type pressureInletOutletVelocity;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object alphat;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [1 -1 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
Default_Boundary_Region
|
||||||
|
{
|
||||||
|
type compressible::alphatWallFunction;
|
||||||
|
Prt 0.85;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,49 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object epsilon;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 2 -3 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 200;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
Default_Boundary_Region
|
||||||
|
{
|
||||||
|
type epsilonWallFunction;
|
||||||
|
Cmu 0.09;
|
||||||
|
kappa 0.41;
|
||||||
|
E 9.8;
|
||||||
|
value uniform 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type turbulentMixingLengthDissipationRateInlet;
|
||||||
|
mixingLength 0.005;
|
||||||
|
value uniform 200;
|
||||||
|
}
|
||||||
|
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform 200;
|
||||||
|
value uniform 200;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
46
tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/0/k
Normal file
46
tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/0/k
Normal file
@ -0,0 +1,46 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object k;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 2 -2 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 1;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
Default_Boundary_Region
|
||||||
|
{
|
||||||
|
type kqRWallFunction;
|
||||||
|
value uniform 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type turbulentIntensityKineticEnergyInlet;
|
||||||
|
intensity 0.05;
|
||||||
|
value uniform 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type inletOutlet;
|
||||||
|
inletValue uniform 1;
|
||||||
|
value uniform 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
47
tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/0/nut
Normal file
47
tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/0/nut
Normal file
@ -0,0 +1,47 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
location "0";
|
||||||
|
object nut;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [0 2 -1 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 0;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
Default_Boundary_Region
|
||||||
|
{
|
||||||
|
type nutkWallFunction;
|
||||||
|
Cmu 0.09;
|
||||||
|
kappa 0.41;
|
||||||
|
E 9.8;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type calculated;
|
||||||
|
value uniform 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
41
tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/0/p
Normal file
41
tutorials/compressible/rhoPimpleFoam/RAS/squareBendLiq/0/p
Normal file
@ -0,0 +1,41 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class volScalarField;
|
||||||
|
object p;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
dimensions [1 -1 -2 0 0 0 0];
|
||||||
|
|
||||||
|
internalField uniform 1e5;
|
||||||
|
|
||||||
|
boundaryField
|
||||||
|
{
|
||||||
|
Default_Boundary_Region
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type zeroGradient;
|
||||||
|
}
|
||||||
|
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type fixedValue;
|
||||||
|
value $internalField;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,31 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object thermophysicalProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
thermoType
|
||||||
|
{
|
||||||
|
type heRhoThermo;
|
||||||
|
mixture pureMixture;
|
||||||
|
properties liquid;
|
||||||
|
energy sensibleInternalEnergy;
|
||||||
|
}
|
||||||
|
|
||||||
|
mixture
|
||||||
|
{
|
||||||
|
H2O;
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,30 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "constant";
|
||||||
|
object turbulenceProperties;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
simulationType RAS;
|
||||||
|
|
||||||
|
RAS
|
||||||
|
{
|
||||||
|
RASModel kEpsilon;
|
||||||
|
|
||||||
|
turbulence on;
|
||||||
|
|
||||||
|
printCoeffs on;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,127 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
object blockMeshDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
convertToMeters 0.001;
|
||||||
|
|
||||||
|
vertices
|
||||||
|
(
|
||||||
|
// front-plane: z = +25mm
|
||||||
|
// inlet region
|
||||||
|
( -50 25 25) // pt 0
|
||||||
|
( 0 25 25) // pt 1
|
||||||
|
( -50 75 25) // pt 2
|
||||||
|
( 0 75 25) // pt 3
|
||||||
|
// outlet region
|
||||||
|
( -500 -75 25) // pt 4
|
||||||
|
( 0 -75 25) // pt 5
|
||||||
|
( -500 -25 25) // pt 6
|
||||||
|
( 0 -25 25) // pt 7
|
||||||
|
// bend mid-points
|
||||||
|
( 25 0 25) // pt 8
|
||||||
|
( 75 0 25) // pt 9
|
||||||
|
// back-plane: z = -25mm
|
||||||
|
// inlet region
|
||||||
|
( -50 25 -25) // pt 0 + 10
|
||||||
|
( 0 25 -25) // pt 1 + 10
|
||||||
|
( -50 75 -25) // pt 2 + 10
|
||||||
|
( 0 75 -25) // pt 3 + 10
|
||||||
|
// outlet region
|
||||||
|
( -500 -75 -25) // pt 4 + 10
|
||||||
|
( 0 -75 -25) // pt 5 + 10
|
||||||
|
( -500 -25 -25) // pt 7 + 10
|
||||||
|
( 0 -25 -25) // pt 8 + 10
|
||||||
|
// bend mid-points
|
||||||
|
( 25 0 -25) // pt 8 + 10
|
||||||
|
( 75 0 -25) // pt 9 + 10
|
||||||
|
);
|
||||||
|
|
||||||
|
blocks
|
||||||
|
(
|
||||||
|
hex (0 1 11 10 2 3 13 12) inlet ( 20 20 20) simpleGrading (1 1 1)
|
||||||
|
hex (4 5 15 14 6 7 17 16) outlet (200 20 20) simpleGrading (1 1 1)
|
||||||
|
|
||||||
|
hex (1 8 18 11 3 9 19 13) bend1 ( 30 20 20) simpleGrading (1 1 1)
|
||||||
|
hex (5 9 19 15 7 8 18 17) bend2 ( 30 20 20) simpleGrading (1 1 1)
|
||||||
|
);
|
||||||
|
|
||||||
|
edges
|
||||||
|
(
|
||||||
|
// block 2
|
||||||
|
arc 1 8 ( 17.678 17.678 25)
|
||||||
|
arc 11 18 ( 17.678 17.678 -25)
|
||||||
|
arc 3 9 ( 53.033 53.033 25)
|
||||||
|
arc 13 19 ( 53.033 53.033 -25)
|
||||||
|
// block 3
|
||||||
|
arc 7 8 ( 17.678 -17.678 25)
|
||||||
|
arc 17 18 ( 17.678 -17.678 -25)
|
||||||
|
arc 5 9 ( 53.033 -53.033 25)
|
||||||
|
arc 15 19 ( 53.033 -53.033 -25)
|
||||||
|
);
|
||||||
|
|
||||||
|
boundary
|
||||||
|
(
|
||||||
|
// is there no way of defining all my 'defaultFaces' to be 'wall'?
|
||||||
|
Default_Boundary_Region
|
||||||
|
{
|
||||||
|
type wall;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
// block0
|
||||||
|
( 0 1 3 2 )
|
||||||
|
( 11 10 12 13 )
|
||||||
|
( 0 10 11 1 )
|
||||||
|
( 2 3 13 12 )
|
||||||
|
// block1
|
||||||
|
( 4 5 7 6 )
|
||||||
|
( 15 14 16 17 )
|
||||||
|
( 4 14 15 5 )
|
||||||
|
( 6 7 17 16 )
|
||||||
|
// block2
|
||||||
|
( 1 8 9 3 )
|
||||||
|
( 18 11 13 19 )
|
||||||
|
( 3 9 19 13 )
|
||||||
|
( 1 11 18 8 )
|
||||||
|
// block3
|
||||||
|
( 5 9 8 7 )
|
||||||
|
( 19 15 17 18 )
|
||||||
|
( 5 15 19 9 )
|
||||||
|
( 7 8 18 17 )
|
||||||
|
);
|
||||||
|
}
|
||||||
|
inlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(0 2 12 10)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
outlet
|
||||||
|
{
|
||||||
|
type patch;
|
||||||
|
faces
|
||||||
|
(
|
||||||
|
(4 6 16 14)
|
||||||
|
);
|
||||||
|
}
|
||||||
|
);
|
||||||
|
|
||||||
|
mergePatchPairs
|
||||||
|
(
|
||||||
|
);
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,51 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object controlDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
application rhoPimpleFoam;
|
||||||
|
|
||||||
|
startFrom startTime;
|
||||||
|
|
||||||
|
startTime 0;
|
||||||
|
|
||||||
|
stopAt endTime;
|
||||||
|
|
||||||
|
endTime 0.5;
|
||||||
|
|
||||||
|
deltaT 2e-3;
|
||||||
|
|
||||||
|
writeControl timeStep;
|
||||||
|
|
||||||
|
writeInterval 10;
|
||||||
|
|
||||||
|
purgeWrite 0;
|
||||||
|
|
||||||
|
writeFormat ascii;
|
||||||
|
|
||||||
|
writePrecision 6;
|
||||||
|
|
||||||
|
writeCompression off;
|
||||||
|
|
||||||
|
timeFormat general;
|
||||||
|
|
||||||
|
timePrecision 6;
|
||||||
|
|
||||||
|
graphFormat raw;
|
||||||
|
|
||||||
|
runTimeModifiable true;
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,45 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object decomposeParDict;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
numberOfSubdomains 8;
|
||||||
|
|
||||||
|
method hierarchical;
|
||||||
|
|
||||||
|
simpleCoeffs
|
||||||
|
{
|
||||||
|
n (8 1 1);
|
||||||
|
delta 0.001;
|
||||||
|
}
|
||||||
|
|
||||||
|
hierarchicalCoeffs
|
||||||
|
{
|
||||||
|
n (4 2 1);
|
||||||
|
delta 0.001;
|
||||||
|
order xyz;
|
||||||
|
}
|
||||||
|
|
||||||
|
manualCoeffs
|
||||||
|
{
|
||||||
|
dataFile "";
|
||||||
|
}
|
||||||
|
|
||||||
|
distributed no;
|
||||||
|
|
||||||
|
roots ( );
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,60 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object fvSchemes;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
ddtSchemes
|
||||||
|
{
|
||||||
|
default Euler;
|
||||||
|
}
|
||||||
|
|
||||||
|
gradSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear;
|
||||||
|
|
||||||
|
limited cellLimited Gauss linear 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
divSchemes
|
||||||
|
{
|
||||||
|
default none;
|
||||||
|
|
||||||
|
div(phi,U) Gauss linearUpwind limited;
|
||||||
|
div(phi,e) Gauss linearUpwind limited;
|
||||||
|
div(phi,epsilon) Gauss linearUpwind limited;
|
||||||
|
div(phi,k) Gauss linearUpwind limited;
|
||||||
|
div(phi,K) Gauss linearUpwind limited;
|
||||||
|
div(phiv,p) Gauss linearUpwind limited;
|
||||||
|
|
||||||
|
div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
laplacianSchemes
|
||||||
|
{
|
||||||
|
default Gauss linear corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
interpolationSchemes
|
||||||
|
{
|
||||||
|
default linear;
|
||||||
|
}
|
||||||
|
|
||||||
|
snGradSchemes
|
||||||
|
{
|
||||||
|
default corrected;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -0,0 +1,63 @@
|
|||||||
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
|
| ========= | |
|
||||||
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
|
| \\ / O peration | Version: dev |
|
||||||
|
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||||
|
| \\/ M anipulation | |
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
FoamFile
|
||||||
|
{
|
||||||
|
version 2.0;
|
||||||
|
format ascii;
|
||||||
|
class dictionary;
|
||||||
|
location "system";
|
||||||
|
object fvSolution;
|
||||||
|
}
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
solvers
|
||||||
|
{
|
||||||
|
"rho.*"
|
||||||
|
{
|
||||||
|
solver nthn;
|
||||||
|
}
|
||||||
|
|
||||||
|
"p.*"
|
||||||
|
{
|
||||||
|
solver GAMG;
|
||||||
|
smoother GaussSeidel;
|
||||||
|
|
||||||
|
tolerance 1e-7;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
"(U|e|k|epsilon).*"
|
||||||
|
{
|
||||||
|
solver PBiCGStab;
|
||||||
|
preconditioner DILU;
|
||||||
|
|
||||||
|
tolerance 1e-7;
|
||||||
|
relTol 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
PIMPLE
|
||||||
|
{
|
||||||
|
nCorrectors 3;
|
||||||
|
nNonOrthogonalCorrectors 0;
|
||||||
|
pMinFactor 0.1;
|
||||||
|
pMaxFactor 1.5;
|
||||||
|
|
||||||
|
transonic no;
|
||||||
|
consistent no;
|
||||||
|
}
|
||||||
|
|
||||||
|
relaxationFactors
|
||||||
|
{
|
||||||
|
equations
|
||||||
|
{
|
||||||
|
".*" 1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -11,7 +11,7 @@ T
|
|||||||
type compressible::thermalBaffle1D<hConstSolidThermoPhysics>;
|
type compressible::thermalBaffle1D<hConstSolidThermoPhysics>;
|
||||||
|
|
||||||
thickness uniform 0.005; // thickness [m]
|
thickness uniform 0.005; // thickness [m]
|
||||||
Qs uniform 100; // heat flux [W/m2]
|
qs uniform 100; // heat flux [W/m2]
|
||||||
|
|
||||||
# include "1DbaffleSolidThermo"
|
# include "1DbaffleSolidThermo"
|
||||||
|
|
||||||
|
|||||||
@ -58,8 +58,8 @@ boundaryField
|
|||||||
inletValue uniform 300;
|
inletValue uniform 300;
|
||||||
Tnbr T;
|
Tnbr T;
|
||||||
kappaMethod fluidThermo;
|
kappaMethod fluidThermo;
|
||||||
QrNbr none;
|
qrNbr none;
|
||||||
Qr Qr;
|
qr qr;
|
||||||
kappa none;
|
kappa none;
|
||||||
}
|
}
|
||||||
air_to_solid
|
air_to_solid
|
||||||
@ -69,8 +69,8 @@ boundaryField
|
|||||||
inletValue uniform 300;
|
inletValue uniform 300;
|
||||||
Tnbr T;
|
Tnbr T;
|
||||||
kappaMethod fluidThermo;
|
kappaMethod fluidThermo;
|
||||||
QrNbr none;
|
qrNbr none;
|
||||||
Qr Qr;
|
qr qr;
|
||||||
kappa none;
|
kappa none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -11,7 +11,7 @@ FoamFile
|
|||||||
format ascii;
|
format ascii;
|
||||||
class volScalarField;
|
class volScalarField;
|
||||||
location "0/air";
|
location "0/air";
|
||||||
object Qr;
|
object qr;
|
||||||
}
|
}
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -64,8 +64,8 @@ boundaryField
|
|||||||
value uniform 300;
|
value uniform 300;
|
||||||
Tnbr T;
|
Tnbr T;
|
||||||
kappaMethod solidThermo;
|
kappaMethod solidThermo;
|
||||||
QrNbr Qr;
|
qrNbr qr;
|
||||||
Qr none;
|
qr none;
|
||||||
kappa none;
|
kappa none;
|
||||||
}
|
}
|
||||||
floor_to_solid
|
floor_to_solid
|
||||||
@ -74,8 +74,8 @@ boundaryField
|
|||||||
value uniform 300;
|
value uniform 300;
|
||||||
Tnbr T;
|
Tnbr T;
|
||||||
kappaMethod solidThermo;
|
kappaMethod solidThermo;
|
||||||
QrNbr none;
|
qrNbr none;
|
||||||
Qr none;
|
qr none;
|
||||||
kappa none;
|
kappa none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,8 +32,8 @@ boundaryField
|
|||||||
value uniform 300;
|
value uniform 300;
|
||||||
Tnbr T;
|
Tnbr T;
|
||||||
kappaMethod solidThermo;
|
kappaMethod solidThermo;
|
||||||
QrNbr Qr;
|
qrNbr qr;
|
||||||
Qr none;
|
qr none;
|
||||||
kappa none;
|
kappa none;
|
||||||
}
|
}
|
||||||
solid_to_floor
|
solid_to_floor
|
||||||
@ -42,8 +42,8 @@ boundaryField
|
|||||||
value uniform 300;
|
value uniform 300;
|
||||||
Tnbr T;
|
Tnbr T;
|
||||||
kappaMethod solidThermo;
|
kappaMethod solidThermo;
|
||||||
QrNbr none;
|
qrNbr none;
|
||||||
Qr none;
|
qr none;
|
||||||
kappa none;
|
kappa none;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -16,7 +16,7 @@ rm -r system/domain3
|
|||||||
# remove fluid fields from solid regions (important for post-processing)
|
# remove fluid fields from solid regions (important for post-processing)
|
||||||
for i in solid floor
|
for i in solid floor
|
||||||
do
|
do
|
||||||
rm -f 0*/$i/{rho,mut,alphat,epsilon,k,U,p_rgh,Qr,G,IDefault}
|
rm -f 0*/$i/{rho,mut,alphat,epsilon,k,U,p_rgh,qr,G,IDefault}
|
||||||
done
|
done
|
||||||
|
|
||||||
for i in air solid floor
|
for i in air solid floor
|
||||||
|
|||||||
@ -72,8 +72,8 @@ solarLoadCoeffs
|
|||||||
C 0.058; // Model constant
|
C 0.058; // Model constant
|
||||||
|
|
||||||
// Radiative flux coupling flags
|
// Radiative flux coupling flags
|
||||||
solidCoupled true; //Couple through Qr the solid regions (default true)
|
solidCoupled true; //Couple through qr the solid regions (default true)
|
||||||
wallCoupled false; //Couple through Qr wall patches (default false)
|
wallCoupled false; //Couple through qr wall patches (default false)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -69,8 +69,8 @@ dictionaryReplacement
|
|||||||
type compressible::turbulentTemperatureRadCoupledMixed;
|
type compressible::turbulentTemperatureRadCoupledMixed;
|
||||||
Tnbr T;
|
Tnbr T;
|
||||||
kappaMethod fluidThermo;
|
kappaMethod fluidThermo;
|
||||||
QrNbr none;
|
qrNbr none;
|
||||||
Qr Qr;
|
qr qr;
|
||||||
kappa none;
|
kappa none;
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -40,8 +40,8 @@ dictionaryReplacement
|
|||||||
type compressible::turbulentTemperatureRadCoupledMixed;
|
type compressible::turbulentTemperatureRadCoupledMixed;
|
||||||
Tnbr T;
|
Tnbr T;
|
||||||
kappaMethod solidThermo;
|
kappaMethod solidThermo;
|
||||||
QrNbr none;
|
qrNbr none;
|
||||||
Qr none;
|
qr none;
|
||||||
kappa none;
|
kappa none;
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
}
|
}
|
||||||
@ -51,8 +51,8 @@ dictionaryReplacement
|
|||||||
type compressible::turbulentTemperatureRadCoupledMixed;
|
type compressible::turbulentTemperatureRadCoupledMixed;
|
||||||
Tnbr T;
|
Tnbr T;
|
||||||
kappaMethod solidThermo;
|
kappaMethod solidThermo;
|
||||||
QrNbr Qr;
|
qrNbr qr;
|
||||||
Qr none;
|
qr none;
|
||||||
kappa none;
|
kappa none;
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,8 +34,8 @@ dictionaryReplacement
|
|||||||
type compressible::turbulentTemperatureRadCoupledMixed;
|
type compressible::turbulentTemperatureRadCoupledMixed;
|
||||||
Tnbr T;
|
Tnbr T;
|
||||||
kappaMethod solidThermo;
|
kappaMethod solidThermo;
|
||||||
QrNbr Qr;
|
qrNbr qr;
|
||||||
Qr none;
|
qr none;
|
||||||
kappa none;
|
kappa none;
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
}
|
}
|
||||||
@ -45,8 +45,8 @@ dictionaryReplacement
|
|||||||
type compressible::turbulentTemperatureRadCoupledMixed;
|
type compressible::turbulentTemperatureRadCoupledMixed;
|
||||||
Tnbr T;
|
Tnbr T;
|
||||||
kappaMethod solidThermo;
|
kappaMethod solidThermo;
|
||||||
QrNbr none;
|
qrNbr none;
|
||||||
Qr none;
|
qr none;
|
||||||
kappa none;
|
kappa none;
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user