ENH: wallHeatFlux: generalise for solids

This commit is contained in:
mattijs
2012-08-20 10:19:14 +01:00
parent b0835d2195
commit 97d133bcf4
4 changed files with 54 additions and 23 deletions

View File

@ -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

View File

@ -5,6 +5,7 @@ autoPtr<basicThermo> thermo
const volScalarField& h = thermo->he();
// Register copy of thermo density
volScalarField rho
(
IOobject
@ -16,28 +17,40 @@ volScalarField rho
thermo->rho()
);
volVectorField U
(
IOobject
// Construct turbulence model (if fluid)
autoPtr<volVectorField> UPtr;
autoPtr<surfaceScalarField> phiPtr;
autoPtr<compressible::turbulenceModel> turbulence;
if (!isA<solidThermo>(thermo()))
{
UPtr.reset
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
new volVectorField
(
IOobject
(
"U",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
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()
)
);
);
}

View File

@ -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 =

View File

@ -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 \