From 215a32679de590653503b32526cf9cf600f46449 Mon Sep 17 00:00:00 2001 From: andy <andy> Date: Thu, 15 Nov 2012 16:57:22 +0000 Subject: [PATCH] ENH: Updated construction of he thermo boundary conditions from T field --- .../basic/heThermo/heThermo.C | 39 ++++++++++++++++++- .../basic/heThermo/heThermo.H | 4 ++ 2 files changed, 41 insertions(+), 2 deletions(-) diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.C b/src/thermophysicalModels/basic/heThermo/heThermo.C index bba8da15144..8efaf0f5d50 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.C +++ b/src/thermophysicalModels/basic/heThermo/heThermo.C @@ -35,6 +35,39 @@ License // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // +template<class BasicThermo, class MixtureType> +Foam::wordList Foam::heThermo<BasicThermo, MixtureType>::heBoundaryBaseTypes() +{ + const volScalarField::GeometricBoundaryField& tbf = + this->T_.boundaryField(); + + wordList hbt(tbf.size(), word::null); + + forAll(tbf, patchi) + { + if (isA<fixedJumpFvPatchScalarField>(tbf[patchi])) + { + const fixedJumpFvPatchScalarField& pf = + dynamic_cast<const fixedJumpFvPatchScalarField&>(tbf[patchi]); + + hbt[patchi] = pf.interfaceFieldType(); + } + else if (isA<fixedJumpAMIFvPatchScalarField>(tbf[patchi])) + { + const fixedJumpAMIFvPatchScalarField& pf = + dynamic_cast<const fixedJumpAMIFvPatchScalarField&> + ( + tbf[patchi] + ); + + hbt[patchi] = pf.interfaceFieldType(); + } + } + + return hbt; +} + + template<class BasicThermo, class MixtureType> Foam::wordList Foam::heThermo<BasicThermo, MixtureType>::heBoundaryTypes() { @@ -149,7 +182,8 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo ), mesh, dimEnergy/dimMass, - this->heBoundaryTypes() + this->heBoundaryTypes(), + this->heBoundaryBaseTypes() ) { init(); @@ -179,7 +213,8 @@ Foam::heThermo<BasicThermo, MixtureType>::heThermo ), mesh, dimEnergy/dimMass, - this->heBoundaryTypes() + this->heBoundaryTypes(), + this->heBoundaryBaseTypes() ) { init(); diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.H b/src/thermophysicalModels/basic/heThermo/heThermo.H index 2c894eee437..ef9919a99cd 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.H +++ b/src/thermophysicalModels/basic/heThermo/heThermo.H @@ -68,6 +68,10 @@ protected: // by interrogating the temperature field boundary types wordList heBoundaryTypes(); + //- Return the enthalpy/internal energy field boundary base types + // by interrogating the temperature field boundary types + wordList heBoundaryBaseTypes(); + //- Correct the enthalpy/internal energy field boundaries void heBoundaryCorrection(volScalarField& he); -- GitLab