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 = \ EXE_INC = \
-I$(LIB_SRC)/turbulenceModels \ -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/specie/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basicSolidThermo/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude -I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \ EXE_LIBS = \
-lcompressibleRASModels \ -lcompressibleTurbulenceModel \
-lreactionThermophysicalModels \ -lreactionThermophysicalModels \
-lfiniteVolume \ -lfiniteVolume \
-lgenericPatchFields \ -lgenericPatchFields \
-lspecie \ -lspecie \
-lbasicThermophysicalModels -lsolid \
-lbasicThermophysicalModels \
-lbasicSolidThermo

View File

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

View File

@ -32,7 +32,8 @@ Description
\*---------------------------------------------------------------------------*/ \*---------------------------------------------------------------------------*/
#include "fvCFD.H" #include "fvCFD.H"
#include "RASModel.H" #include "turbulenceModel.H"
#include "solidThermo.H"
#include "wallFvPatch.H" #include "wallFvPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -56,7 +57,14 @@ int main(int argc, char *argv[])
surfaceScalarField heatFlux surfaceScalarField heatFlux
( (
fvc::interpolate(RASModel->alphaEff())*fvc::snGrad(h) fvc::interpolate
(
(
turbulence.valid()
? turbulence->alphaEff()()
: thermo->alpha()
)
)*fvc::snGrad(h)
); );
const surfaceScalarField::GeometricBoundaryField& patchHeatFlux = const surfaceScalarField::GeometricBoundaryField& patchHeatFlux =

View File

@ -33,6 +33,7 @@ Description
#define makesolidThermo_H #define makesolidThermo_H
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
#include "basicThermo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam namespace Foam
@ -127,6 +128,12 @@ addToRunTimeSelectionTable \
BaseThermo, \ BaseThermo, \
Cthermo##Mixture##Transport##Radiation##Type##Thermo##Rho##BaseThermo, \ Cthermo##Mixture##Transport##Radiation##Type##Thermo##Rho##BaseThermo, \
mesh \ mesh \
); \
addToRunTimeSelectionTable \
( \
basicThermo, \
Cthermo##Mixture##Transport##Radiation##Type##Thermo##Rho##BaseThermo, \
fvMesh \
); \ ); \
\ \
addToRunTimeSelectionTable \ addToRunTimeSelectionTable \