From 1397b59dc26788cf9f341a4acb4f65619b0df0af Mon Sep 17 00:00:00 2001 From: sergio <s.ferraris@opencfd.co.uk> Date: Mon, 8 Jun 2020 12:17:56 -0700 Subject: [PATCH] TUT: Adding CodeField example in tutorial --- .../poolEvaporation/0.orig/T | 40 ++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/tutorials/multiphase/icoReactingMultiPhaseInterFoam/poolEvaporation/0.orig/T b/tutorials/multiphase/icoReactingMultiPhaseInterFoam/poolEvaporation/0.orig/T index 6f96fca3087..ff88c273285 100644 --- a/tutorials/multiphase/icoReactingMultiPhaseInterFoam/poolEvaporation/0.orig/T +++ b/tutorials/multiphase/icoReactingMultiPhaseInterFoam/poolEvaporation/0.orig/T @@ -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 -- GitLab