Commit 1397b59d authored by sergio's avatar sergio
Browse files

TUT: Adding CodeField example in tutorial

parent 9d1f3916
......@@ -22,7 +22,45 @@ boundaryField
{
left
{
type zeroGradient;
type externalWallHeatFluxTemperature;
mode coefficient;
Ta constant 300.0;
h
{
type coded;
codeInclude
#{
#include "volFields.H"
#};
code
#{
const objectRegistry& Db =
patch_.boundaryMesh().mesh().thisDb();
const volScalarField& T =
Db.lookupObject<volScalarField>("T");
tmp<scalarField> thtc(new scalarField(patch_.size(), 300.0));
scalarField& htc = thtc.ref();
const scalarField Tp(T.boundaryField()[patch_.index()]);
forAll (htc, faceI)
{
if (Tp[faceI] >= 1000.0)
{
htc[faceI] = 800;
}
else if (1000.0 >= Tp[faceI] >= 600.0)
{
htc[faceI] = 0.2*Tp[faceI]+200;
}
}
return thtc;
#};
}
kappaMethod fluidThermo;
value $internalField;
}
right
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment