mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: wallHeatFlux: generalise for solids
This commit is contained in:
@ -1,15 +1,18 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/turbulenceModels \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
|
||||
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lcompressibleRASModels \
|
||||
-lcompressibleTurbulenceModel \
|
||||
-lreactionThermophysicalModels \
|
||||
-lfiniteVolume \
|
||||
-lgenericPatchFields \
|
||||
-lspecie \
|
||||
-lbasicThermophysicalModels
|
||||
-lsolid \
|
||||
-lbasicThermophysicalModels \
|
||||
-lbasicSolidThermo
|
||||
|
||||
@ -5,6 +5,7 @@ autoPtr<basicThermo> thermo
|
||||
|
||||
const volScalarField& h = thermo->he();
|
||||
|
||||
// Register copy of thermo density
|
||||
volScalarField rho
|
||||
(
|
||||
IOobject
|
||||
@ -16,8 +17,17 @@ volScalarField rho
|
||||
thermo->rho()
|
||||
);
|
||||
|
||||
volVectorField U
|
||||
(
|
||||
// Construct turbulence model (if fluid)
|
||||
autoPtr<volVectorField> UPtr;
|
||||
autoPtr<surfaceScalarField> phiPtr;
|
||||
autoPtr<compressible::turbulenceModel> turbulence;
|
||||
|
||||
if (!isA<solidThermo>(thermo()))
|
||||
{
|
||||
UPtr.reset
|
||||
(
|
||||
new volVectorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"U",
|
||||
@ -27,17 +37,20 @@ volVectorField U
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
mesh
|
||||
);
|
||||
)
|
||||
);
|
||||
const volVectorField& U = UPtr();
|
||||
|
||||
#include "compressibleCreatePhi.H"
|
||||
#include "compressibleCreatePhi.H"
|
||||
// Copy phi to autoPtr. Rename to make sure copy is now registered as 'phi'.
|
||||
phi.rename("phiFluid");
|
||||
phiPtr.reset(new surfaceScalarField("phi", phi));
|
||||
|
||||
autoPtr<compressible::RASModel> RASModel
|
||||
(
|
||||
compressible::RASModel::New
|
||||
turbulence = compressible::turbulenceModel::New
|
||||
(
|
||||
rho,
|
||||
U,
|
||||
phi,
|
||||
phiPtr(),
|
||||
thermo()
|
||||
)
|
||||
);
|
||||
);
|
||||
}
|
||||
|
||||
@ -32,7 +32,8 @@ Description
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "RASModel.H"
|
||||
#include "turbulenceModel.H"
|
||||
#include "solidThermo.H"
|
||||
#include "wallFvPatch.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
@ -56,7 +57,14 @@ int main(int argc, char *argv[])
|
||||
|
||||
surfaceScalarField heatFlux
|
||||
(
|
||||
fvc::interpolate(RASModel->alphaEff())*fvc::snGrad(h)
|
||||
fvc::interpolate
|
||||
(
|
||||
(
|
||||
turbulence.valid()
|
||||
? turbulence->alphaEff()()
|
||||
: thermo->alpha()
|
||||
)
|
||||
)*fvc::snGrad(h)
|
||||
);
|
||||
|
||||
const surfaceScalarField::GeometricBoundaryField& patchHeatFlux =
|
||||
|
||||
@ -33,6 +33,7 @@ Description
|
||||
#define makesolidThermo_H
|
||||
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "basicThermo.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
namespace Foam
|
||||
@ -127,6 +128,12 @@ addToRunTimeSelectionTable \
|
||||
BaseThermo, \
|
||||
Cthermo##Mixture##Transport##Radiation##Type##Thermo##Rho##BaseThermo, \
|
||||
mesh \
|
||||
); \
|
||||
addToRunTimeSelectionTable \
|
||||
( \
|
||||
basicThermo, \
|
||||
Cthermo##Mixture##Transport##Radiation##Type##Thermo##Rho##BaseThermo, \
|
||||
fvMesh \
|
||||
); \
|
||||
\
|
||||
addToRunTimeSelectionTable \
|
||||
|
||||
Reference in New Issue
Block a user