From 8a7f373751f7d7ff7d363f115eecd16388c9bfbe Mon Sep 17 00:00:00 2001 From: Henry <Henry> Date: Wed, 30 May 2012 15:52:41 +0100 Subject: [PATCH] thermodynamics: Updated enthalpyJump to a generic energyJump BC --- src/thermophysicalModels/basic/Make/files | 1 + .../basic/basicThermo/basicThermo.C | 4 +- .../energyJumpFvPatchScalarField.C} | 39 +++++++------------ .../energyJumpFvPatchScalarField.H} | 36 ++++++++--------- 4 files changed, 35 insertions(+), 45 deletions(-) rename src/thermophysicalModels/basic/derivedFvPatchFields/{enthalpyJump/enthalpyJumpFvPatchScalarField.C => energyJump/energyJumpFvPatchScalarField.C} (74%) rename src/thermophysicalModels/basic/derivedFvPatchFields/{enthalpyJump/enthalpyJumpFvPatchScalarField.H => energyJump/energyJumpFvPatchScalarField.H} (79%) diff --git a/src/thermophysicalModels/basic/Make/files b/src/thermophysicalModels/basic/Make/files index 882fa2e54c9..edeb0bf66c8 100644 --- a/src/thermophysicalModels/basic/Make/files +++ b/src/thermophysicalModels/basic/Make/files @@ -15,6 +15,7 @@ rhoThermo/heRhoThermo/heRhoThermos.C derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.C derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C +derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.C b/src/thermophysicalModels/basic/basicThermo/basicThermo.C index 7dc33f47c9b..cb465edbf7b 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.C @@ -30,6 +30,8 @@ License #include "fixedEnergyFvPatchScalarField.H" #include "gradientEnergyFvPatchScalarField.H" #include "mixedEnergyFvPatchScalarField.H" +#include "temperatureJumpFvPatchScalarField.H" +#include "energyJumpFvPatchScalarField.H" /* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ @@ -67,7 +69,7 @@ Foam::wordList Foam::basicThermo::heBoundaryTypes() } else if (isA<temperatureJumpFvPatchScalarField>(tbf[patchi])) { - hbt[patchi] = enthalpyJumpFvPatchScalarField::typeName; + hbt[patchi] = energyJumpFvPatchScalarField::typeName; } } diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/enthalpyJump/enthalpyJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C similarity index 74% rename from src/thermophysicalModels/basic/derivedFvPatchFields/enthalpyJump/enthalpyJumpFvPatchScalarField.C rename to src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C index 4337dd2ffb9..b86ac9ad038 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/enthalpyJump/enthalpyJumpFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.C @@ -24,13 +24,13 @@ License \*---------------------------------------------------------------------------*/ #include "addToRunTimeSelectionTable.H" -#include "enthalpyJumpFvPatchScalarField.H" +#include "energyJumpFvPatchScalarField.H" #include "temperatureJumpFvPatchScalarField.H" #include "basicThermo.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::enthalpyJumpFvPatchScalarField::enthalpyJumpFvPatchScalarField +Foam::energyJumpFvPatchScalarField::energyJumpFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF @@ -40,9 +40,9 @@ Foam::enthalpyJumpFvPatchScalarField::enthalpyJumpFvPatchScalarField {} -Foam::enthalpyJumpFvPatchScalarField::enthalpyJumpFvPatchScalarField +Foam::energyJumpFvPatchScalarField::energyJumpFvPatchScalarField ( - const enthalpyJumpFvPatchScalarField& ptf, + const energyJumpFvPatchScalarField& ptf, const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, const fvPatchFieldMapper& mapper @@ -52,7 +52,7 @@ Foam::enthalpyJumpFvPatchScalarField::enthalpyJumpFvPatchScalarField {} -Foam::enthalpyJumpFvPatchScalarField::enthalpyJumpFvPatchScalarField +Foam::energyJumpFvPatchScalarField::energyJumpFvPatchScalarField ( const fvPatch& p, const DimensionedField<scalar, volMesh>& iF, @@ -72,9 +72,9 @@ Foam::enthalpyJumpFvPatchScalarField::enthalpyJumpFvPatchScalarField } -Foam::enthalpyJumpFvPatchScalarField::enthalpyJumpFvPatchScalarField +Foam::energyJumpFvPatchScalarField::energyJumpFvPatchScalarField ( - const enthalpyJumpFvPatchScalarField& ptf + const energyJumpFvPatchScalarField& ptf ) : cyclicLduInterfaceField(), @@ -82,9 +82,9 @@ Foam::enthalpyJumpFvPatchScalarField::enthalpyJumpFvPatchScalarField {} -Foam::enthalpyJumpFvPatchScalarField::enthalpyJumpFvPatchScalarField +Foam::energyJumpFvPatchScalarField::energyJumpFvPatchScalarField ( - const enthalpyJumpFvPatchScalarField& ptf, + const energyJumpFvPatchScalarField& ptf, const DimensionedField<scalar, volMesh>& iF ) : @@ -94,7 +94,7 @@ Foam::enthalpyJumpFvPatchScalarField::enthalpyJumpFvPatchScalarField // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -void Foam::enthalpyJumpFvPatchScalarField::updateCoeffs() +void Foam::energyJumpFvPatchScalarField::updateCoeffs() { if (this->updated()) { @@ -124,27 +124,14 @@ void Foam::enthalpyJumpFvPatchScalarField::updateCoeffs() const labelUList& faceCells = this->patch().faceCells(); - if (db().foundObject<volScalarField>("h")) - { - jump_ = thermo.h(jumpTb, faceCells); - } - else if (db().foundObject<volScalarField>("hs")) - { - jump_ = thermo.hs(jumpTb, faceCells); - } - else - { - FatalErrorIn("enthalpyJumpFvPatchScalarField::updateCoeffs()") - << " hs or h are not found in db()" - << exit(FatalError); - } + jump_ = thermo.he(jumpTb, faceCells); } fixedJumpFvPatchField<scalar>::updateCoeffs(); } -void Foam::enthalpyJumpFvPatchScalarField::write(Ostream& os) const +void Foam::energyJumpFvPatchScalarField::write(Ostream& os) const { fixedJumpFvPatchField<scalar>::write(os); this->writeEntry("value", os); @@ -158,7 +145,7 @@ namespace Foam makePatchTypeField ( fvPatchScalarField, - enthalpyJumpFvPatchScalarField + energyJumpFvPatchScalarField ); } diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/enthalpyJump/enthalpyJumpFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.H similarity index 79% rename from src/thermophysicalModels/basic/derivedFvPatchFields/enthalpyJump/enthalpyJumpFvPatchScalarField.H rename to src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.H index 770e2a47394..6fb7820ee3c 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/enthalpyJump/enthalpyJumpFvPatchScalarField.H +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpFvPatchScalarField.H @@ -22,17 +22,17 @@ License along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. Class - Foam::enthalpyJumpFvPatchScalarField + Foam::energyJumpFvPatchScalarField Description SourceFiles - enthalpyJumpFvPatchScalarField.C + energyJumpFvPatchScalarField.C \*---------------------------------------------------------------------------*/ -#ifndef enthalpyJumpFvPatchScalarField_H -#define enthalpyJumpFvPatchScalarField_H +#ifndef energyJumpFvPatchScalarField_H +#define energyJumpFvPatchScalarField_H #include "fixedJumpFvPatchField.H" #include "DataEntry.H" @@ -43,10 +43,10 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class enthalpyJumpFvPatchScalarField Declaration + Class energyJumpFvPatchScalarField Declaration \*---------------------------------------------------------------------------*/ -class enthalpyJumpFvPatchScalarField +class energyJumpFvPatchScalarField : public fixedJumpFvPatchField<scalar> { @@ -54,39 +54,39 @@ class enthalpyJumpFvPatchScalarField public: //- Runtime type information - TypeName("enthalpyJump"); + TypeName("energyJump"); // Constructors //- Construct from patch and internal field - enthalpyJumpFvPatchScalarField + energyJumpFvPatchScalarField ( const fvPatch&, const DimensionedField<scalar, volMesh>& ); //- Construct from patch, internal field and dictionary - enthalpyJumpFvPatchScalarField + energyJumpFvPatchScalarField ( const fvPatch&, const DimensionedField<scalar, volMesh>&, const dictionary& ); - //- Construct by mapping given enthalpyJumpFvPatchScalarField onto a + //- Construct by mapping given energyJumpFvPatchScalarField onto a // new patch - enthalpyJumpFvPatchScalarField + energyJumpFvPatchScalarField ( - const enthalpyJumpFvPatchScalarField&, + const energyJumpFvPatchScalarField&, const fvPatch&, const DimensionedField<scalar, volMesh>&, const fvPatchFieldMapper& ); //- Construct as copy - enthalpyJumpFvPatchScalarField + energyJumpFvPatchScalarField ( - const enthalpyJumpFvPatchScalarField& + const energyJumpFvPatchScalarField& ); //- Construct and return a clone @@ -94,14 +94,14 @@ public: { return tmp<fvPatchField<scalar> > ( - new enthalpyJumpFvPatchScalarField(*this) + new energyJumpFvPatchScalarField(*this) ); } //- Construct as copy setting internal field reference - enthalpyJumpFvPatchScalarField + energyJumpFvPatchScalarField ( - const enthalpyJumpFvPatchScalarField&, + const energyJumpFvPatchScalarField&, const DimensionedField<scalar, volMesh>& ); @@ -113,7 +113,7 @@ public: { return tmp<fvPatchField<scalar> > ( - new enthalpyJumpFvPatchScalarField(*this, iF) + new energyJumpFvPatchScalarField(*this, iF) ); } -- GitLab