diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.C index 3e095272db4f010dd1bb1b235c9e6bebb2e5e2d5..2167d15b6defd06cdbb936c7cefe3b8630b47fe5 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UIPstream.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -165,8 +165,14 @@ Foam::Istream& Foam::UIPstream::read(token& t) } // String - case token::STRING : case token::VERBATIMSTRING : + { + // Recurse to read actual string + read(t); + t.type() = token::VERBATIMSTRING; + return *this; + } + case token::STRING : { string* pval = new string; if (read(*pval)) diff --git a/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.C b/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.C index c257826c0473d286c03b3a253a19ba2702570a2b..e01e8de01bdbb307cb560570e8a64062c10f32d8 100644 --- a/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.C +++ b/src/OpenFOAM/db/IOstreams/Pstreams/UOPstream.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -151,10 +151,19 @@ Foam::UOPstream::~UOPstream() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -Foam::Ostream& Foam::UOPstream::write(const token&) +Foam::Ostream& Foam::UOPstream::write(const token& t) { - notImplemented("Ostream& UOPstream::write(const token&)"); - setBad(); + // Raw token output only supported for verbatim strings for now + if (t.type() == token::VERBATIMSTRING) + { + write(char(token::VERBATIMSTRING)); + write(t.stringToken()); + } + else + { + notImplemented("Ostream& UOPstream::write(const token&)"); + setBad(); + } return *this; } diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C b/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C index 2dbf0c1150573e2053dab29ee0a73f83cc64c3a3..4cbf8bf1fa98563fbae17ff2b72f75add6564237 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C +++ b/src/OpenFOAM/db/IOstreams/Sstreams/OSstream.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,8 +29,16 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -Foam::Ostream& Foam::OSstream::write(const token&) +Foam::Ostream& Foam::OSstream::write(const token& t) { + if (t.type() == token::VERBATIMSTRING) + { + write(char(token::HASH)); + write(char(token::BEGIN_BLOCK)); + writeQuoted(t.stringToken(), false); + write(char(token::HASH)); + write(char(token::END_BLOCK)); + } return *this; } diff --git a/src/OpenFOAM/db/IOstreams/Sstreams/prefixOSstream.C b/src/OpenFOAM/db/IOstreams/Sstreams/prefixOSstream.C index b46a9b81092be7aacd2070e1d2dec61fb42deb97..7ca977bf978562fe0cf2c843cac473149be199ac 100644 --- a/src/OpenFOAM/db/IOstreams/Sstreams/prefixOSstream.C +++ b/src/OpenFOAM/db/IOstreams/Sstreams/prefixOSstream.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -65,8 +65,16 @@ void Foam::prefixOSstream::print(Ostream& os) const } -Foam::Ostream& Foam::prefixOSstream::write(const token&) +Foam::Ostream& Foam::prefixOSstream::write(const token& t) { + if (t.type() == token::VERBATIMSTRING) + { + write(char(token::HASH)); + write(char(token::BEGIN_BLOCK)); + writeQuoted(t.stringToken(), false); + write(char(token::HASH)); + write(char(token::END_BLOCK)); + } return *this; } diff --git a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C index 021f146536f2afa3e3ef73068c30a73d38bfb9fd..fd442af47ae05dff20276f68e2a4bd02addf3ce4 100644 --- a/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C +++ b/src/OpenFOAM/db/dictionary/primitiveEntry/primitiveEntryIO.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -225,9 +225,9 @@ void Foam::primitiveEntry::write(Ostream& os, const bool contentsOnly) const const token& t = operator[](i); if (t.type() == token::VERBATIMSTRING) { - os << token::HASH << token::BEGIN_BLOCK; - os.writeQuoted(t.stringToken(), false); - os << token::HASH << token::END_BLOCK; + // Bypass token output operator to avoid losing verbatimness. + // Handle in Ostreams themselves + os.write(t); } else { diff --git a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C index bf103c225420e5a45add6e802caf3c347d7dda0f..b180a5965b6174f2c11ec0efd85893c3a62d9b56 100644 --- a/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C +++ b/src/OpenFOAM/meshes/primitiveMesh/primitiveMeshCheck/primitiveMeshCheck.C @@ -25,7 +25,6 @@ License #include "primitiveMesh.H" #include "pyramidPointFaceRef.H" -#include "tetrahedron.H" #include "ListOps.H" #include "unitConversion.H" #include "SortableList.H" diff --git a/src/dynamicMesh/createShellMesh/Make/files b/src/dynamicMesh/createShellMesh/Make/files deleted file mode 100644 index 4aa716f0220d590095857d4d07940c486a3b4ea3..0000000000000000000000000000000000000000 --- a/src/dynamicMesh/createShellMesh/Make/files +++ /dev/null @@ -1,3 +0,0 @@ -createShellMesh.C - -LIB = $(FOAM_LIBBIN)/libcreateShellMesh diff --git a/src/dynamicMesh/createShellMesh/Make/options b/src/dynamicMesh/createShellMesh/Make/options deleted file mode 100644 index 295f0b0bc956185f982b81ddf6eaa4e2869850e1..0000000000000000000000000000000000000000 --- a/src/dynamicMesh/createShellMesh/Make/options +++ /dev/null @@ -1,9 +0,0 @@ -EXE_INC = \ - -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude \ - -I$(LIB_SRC)/dynamicMesh/lnInclude -DFULLDEBUG -g -O0 - -LIB_LIBS = \ - -lfiniteVolume \ - -lmeshTools \ - -ldynamicMesh diff --git a/src/finiteVolume/Make/files b/src/finiteVolume/Make/files index 3691354d0bce17a25fe23fc7d03206b80910225a..22988f32169a94d03186bcb7328e24f85c13294e 100644 --- a/src/finiteVolume/Make/files +++ b/src/finiteVolume/Make/files @@ -174,6 +174,7 @@ $(derivedFvPatchFields)/waveSurfacePressure/waveSurfacePressureFvPatchScalarFiel $(derivedFvPatchFields)/phaseHydrostaticPressure/phaseHydrostaticPressureFvPatchScalarField.C $(derivedFvPatchFields)/variableHeightFlowRate/variableHeightFlowRateFvPatchField.C $(derivedFvPatchFields)/variableHeightFlowRateInletVelocity/variableHeightFlowRateInletVelocityFvPatchVectorField.C +$(derivedFvPatchFields)/temperatureJump/temperatureJumpFvPatchScalarField.C fvsPatchFields = fields/fvsPatchFields $(fvsPatchFields)/fvsPatchField/fvsPatchFields.C diff --git a/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchScalarField.C index e3ca2d79e966fdca502f89c1dd669fa00b091cb0..c82ed7f7a6706ed7c6bf4d27c7ce8a7893781c66 100644 --- a/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchScalarField.C +++ b/src/finiteVolume/fields/fvPatchFields/constraint/wedge/wedgeFvPatchScalarField.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,7 +48,7 @@ void wedgeFvPatchField<scalar>::evaluate(const Pstream::commsTypes) updateCoeffs(); } - operator==(patchInternalField()); + this->operator==(patchInternalField()); } diff --git a/src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.C b/src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..99be42e3d6fc610f434fb8db65acb9889266dfbf --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.C @@ -0,0 +1,129 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "addToRunTimeSelectionTable.H" +#include "temperatureJumpFvPatchScalarField.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedJumpFvPatchField<scalar>(p, iF), + jumpTable_(0) +{} + + +Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField +( + const temperatureJumpFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedJumpFvPatchField<scalar>(ptf, p, iF, mapper), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedJumpFvPatchField<scalar>(p, iF), + jumpTable_(new DataEntry<scalar>("jumpTable")) +{ + + if (this->cyclicPatch().owner()) + { + jumpTable_ = DataEntry<scalar>::New("jumpTable", dict); + } + + if (dict.found("value")) + { + fvPatchScalarField::operator= + ( + scalarField("value", dict, p.size()) + ); + } +} + + +Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField +( + const temperatureJumpFvPatchScalarField& ptf +) +: + cyclicLduInterfaceField(), + fixedJumpFvPatchField<scalar>(ptf), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +Foam::temperatureJumpFvPatchScalarField::temperatureJumpFvPatchScalarField +( + const temperatureJumpFvPatchScalarField& ptf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedJumpFvPatchField<scalar>(ptf, iF), + jumpTable_(ptf.jumpTable_().clone().ptr()) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + + +void Foam::temperatureJumpFvPatchScalarField::write(Ostream& os) const +{ + fixedJumpFvPatchField<scalar>::write(os); + if (this->cyclicPatch().owner()) + { + jumpTable_->writeData(os); + } + this->writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchScalarField, + temperatureJumpFvPatchScalarField + ); +} + +// ************************************************************************* // diff --git a/src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.H b/src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..55364eac5d23dd54cdd62af3c6b8494fda4a5635 --- /dev/null +++ b/src/finiteVolume/fields/fvPatchFields/derived/temperatureJump/temperatureJumpFvPatchScalarField.H @@ -0,0 +1,159 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Class + Foam::temperatureJumpFvPatchScalarField + +Description + Introduce a jump in temperature on a cycle patch + front + { + type temperatureJump; + patchType cyclic; + jumpTable constant 100; + value uniform 300; + } + +SourceFiles + temperatureJumpFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef temperatureJumpFvPatchScalarField_H +#define temperatureJumpFvPatchScalarField_H + +#include "fixedJumpFvPatchField.H" +#include "DataEntry.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class temperatureJumpFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class temperatureJumpFvPatchScalarField +: + public fixedJumpFvPatchField<scalar> +{ + + // Private data + + //- Interpolation table + autoPtr<DataEntry<scalar> > jumpTable_; + + +public: + + //- Runtime type information + TypeName("temperatureJump"); + + // Constructors + + //- Construct from patch and internal field + temperatureJumpFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + temperatureJumpFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given temperatureJumpFvPatchScalarField onto a + // new patch + temperatureJumpFvPatchScalarField + ( + const temperatureJumpFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + temperatureJumpFvPatchScalarField + ( + const temperatureJumpFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchField<scalar> > clone() const + { + return tmp<fvPatchField<scalar> > + ( + new temperatureJumpFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + temperatureJumpFvPatchScalarField + ( + const temperatureJumpFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchField<scalar> > clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchField<scalar> > + ( + new temperatureJumpFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + + // Access functions + + //- Return jumpTable + const DataEntry<scalar>& jumpTable() const + { + return jumpTable_(); + } + + + //- Write + virtual void write(Ostream&) const; +}; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/meshTools/sets/topoSets/topoSet.C b/src/meshTools/sets/topoSets/topoSet.C index 75d674e306cbb34ac466d100c82ba12d4b97149e..561d9fbe46c3958de7ef911258ce58f0fd7b30bf 100644 --- a/src/meshTools/sets/topoSets/topoSet.C +++ b/src/meshTools/sets/topoSets/topoSet.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2011 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -135,7 +135,7 @@ Foam::fileName Foam::topoSet::topoSet::localPath const word& name ) { - return mesh.facesInstance()/polyMesh::meshSubDir/"sets"/name; + return mesh.facesInstance()/mesh.dbDir()/polyMesh::meshSubDir/"sets"/name; } diff --git a/src/thermophysicalModels/basic/Make/files b/src/thermophysicalModels/basic/Make/files index 1c08f455dfd1f1231e23ddf8d4b1835b2cec8fb9..ba53ed77405176ae3cfacce07456807bcf6dfbb3 100644 --- a/src/thermophysicalModels/basic/Make/files +++ b/src/thermophysicalModels/basic/Make/files @@ -22,6 +22,7 @@ derivedFvPatchFields/mixedEnthalpy/mixedEnthalpyFvPatchScalarField.C derivedFvPatchFields/fixedInternalEnergy/fixedInternalEnergyFvPatchScalarField.C derivedFvPatchFields/gradientInternalEnergy/gradientInternalEnergyFvPatchScalarField.C derivedFvPatchFields/mixedInternalEnergy/mixedInternalEnergyFvPatchScalarField.C +derivedFvPatchFields/enthalpyJump/enthalpyJumpFvPatchScalarField.C derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C diff --git a/src/thermophysicalModels/basic/Make/options b/src/thermophysicalModels/basic/Make/options index 8b8c0733d056383ffe992b66fee93fc3ba6a028b..4eba2f1e115c0d5d02742c6473cf95391bf8410c 100644 --- a/src/thermophysicalModels/basic/Make/options +++ b/src/thermophysicalModels/basic/Make/options @@ -1,6 +1,8 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I/home/tom3/sergio/development/chtMultiRegionCoupledFoam/lnInclude LIB_LIBS = \ - -lfiniteVolume + -lfiniteVolume \ + -L$(FOAM_USER_LIBBIN)/FvPatchScalarFieldEnthalpyJump diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.C b/src/thermophysicalModels/basic/basicThermo/basicThermo.C index 59c00560407c1f35fba58930b69ded28f8261ad6..bb6acc01ed2ab34b02d30be378a273e114be5b00 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.C @@ -33,6 +33,8 @@ License #include "fixedInternalEnergyFvPatchScalarField.H" #include "gradientInternalEnergyFvPatchScalarField.H" #include "mixedInternalEnergyFvPatchScalarField.H" +#include "temperatureJumpFvPatchScalarField.H" +#include "enthalpyJumpFvPatchScalarField.H" /* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ @@ -64,10 +66,14 @@ Foam::wordList Foam::basicThermo::hBoundaryTypes() { hbt[patchi] = gradientEnthalpyFvPatchScalarField::typeName; } - else if (isA<mixedFvPatchScalarField>(tbf[patchi])) + else if(isA<mixedFvPatchScalarField>(tbf[patchi])) { hbt[patchi] = mixedEnthalpyFvPatchScalarField::typeName; } + else if (isA<temperatureJumpFvPatchScalarField>(tbf[patchi])) + { + hbt[patchi] = enthalpyJumpFvPatchScalarField::typeName; + } } return hbt; @@ -85,7 +91,7 @@ void Foam::basicThermo::hBoundaryCorrection(volScalarField& h) refCast<gradientEnthalpyFvPatchScalarField>(hbf[patchi]).gradient() = hbf[patchi].fvPatchField::snGrad(); } - else if (isA<mixedEnthalpyFvPatchScalarField>(hbf[patchi])) + else if(isA<mixedEnthalpyFvPatchScalarField>(hbf[patchi])) { refCast<mixedEnthalpyFvPatchScalarField>(hbf[patchi]).refGrad() = hbf[patchi].fvPatchField::snGrad(); diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/enthalpyJump/enthalpyJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/enthalpyJump/enthalpyJumpFvPatchScalarField.C new file mode 100644 index 0000000000000000000000000000000000000000..4337dd2ffb9c8e1f20b4fef88bfdc6d594634f2d --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/enthalpyJump/enthalpyJumpFvPatchScalarField.C @@ -0,0 +1,165 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +\*---------------------------------------------------------------------------*/ + +#include "addToRunTimeSelectionTable.H" +#include "enthalpyJumpFvPatchScalarField.H" +#include "temperatureJumpFvPatchScalarField.H" +#include "basicThermo.H" + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::enthalpyJumpFvPatchScalarField::enthalpyJumpFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedJumpFvPatchField<scalar>(p, iF) +{} + + +Foam::enthalpyJumpFvPatchScalarField::enthalpyJumpFvPatchScalarField +( + const enthalpyJumpFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const fvPatchFieldMapper& mapper +) +: + fixedJumpFvPatchField<scalar>(ptf, p, iF, mapper) +{} + + +Foam::enthalpyJumpFvPatchScalarField::enthalpyJumpFvPatchScalarField +( + const fvPatch& p, + const DimensionedField<scalar, volMesh>& iF, + const dictionary& dict +) +: + fixedJumpFvPatchField<scalar>(p, iF) +{ + + if (dict.found("value")) + { + fvPatchScalarField::operator= + ( + scalarField("value", dict, p.size()) + ); + } +} + + +Foam::enthalpyJumpFvPatchScalarField::enthalpyJumpFvPatchScalarField +( + const enthalpyJumpFvPatchScalarField& ptf +) +: + cyclicLduInterfaceField(), + fixedJumpFvPatchField<scalar>(ptf) +{} + + +Foam::enthalpyJumpFvPatchScalarField::enthalpyJumpFvPatchScalarField +( + const enthalpyJumpFvPatchScalarField& ptf, + const DimensionedField<scalar, volMesh>& iF +) +: + fixedJumpFvPatchField<scalar>(ptf, iF) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void Foam::enthalpyJumpFvPatchScalarField::updateCoeffs() +{ + if (this->updated()) + { + return; + } + + if (this->cyclicPatch().owner()) + { + const basicThermo& thermo = db().lookupObject<basicThermo> + ( + "thermophysicalProperties" + ); + + label patchID = patch().index(); + + const temperatureJumpFvPatchScalarField& TbPatch = + refCast<const temperatureJumpFvPatchScalarField> + ( + thermo.T().boundaryField()[patchID] + ); + + const scalar time = this->db().time().value(); + const scalarField jumpTb + ( + patch().size(), TbPatch.jumpTable().value(time) + ); + + 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); + } + } + + fixedJumpFvPatchField<scalar>::updateCoeffs(); +} + + +void Foam::enthalpyJumpFvPatchScalarField::write(Ostream& os) const +{ + fixedJumpFvPatchField<scalar>::write(os); + this->writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + makePatchTypeField + ( + fvPatchScalarField, + enthalpyJumpFvPatchScalarField + ); +} + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/enthalpyJump/enthalpyJumpFvPatchScalarField.H b/src/thermophysicalModels/basic/derivedFvPatchFields/enthalpyJump/enthalpyJumpFvPatchScalarField.H new file mode 100644 index 0000000000000000000000000000000000000000..770e2a473949d86e5391c4c7c832389d5182be0d --- /dev/null +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/enthalpyJump/enthalpyJumpFvPatchScalarField.H @@ -0,0 +1,142 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2012 OpenFOAM Foundation + \\/ M anipulation | +------------------------------------------------------------------------------- +License + This file is part of OpenFOAM. + + OpenFOAM is free software: you can redistribute it and/or modify it + under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + OpenFOAM is distributed in the hope that it will be useful, but WITHOUT + ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License + for more details. + + You should have received a copy of the GNU General Public License + along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>. + +Class + Foam::enthalpyJumpFvPatchScalarField + +Description + +SourceFiles + enthalpyJumpFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef enthalpyJumpFvPatchScalarField_H +#define enthalpyJumpFvPatchScalarField_H + +#include "fixedJumpFvPatchField.H" +#include "DataEntry.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class enthalpyJumpFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class enthalpyJumpFvPatchScalarField +: + public fixedJumpFvPatchField<scalar> +{ + +public: + + //- Runtime type information + TypeName("enthalpyJump"); + + // Constructors + + //- Construct from patch and internal field + enthalpyJumpFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct from patch, internal field and dictionary + enthalpyJumpFvPatchScalarField + ( + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const dictionary& + ); + + //- Construct by mapping given enthalpyJumpFvPatchScalarField onto a + // new patch + enthalpyJumpFvPatchScalarField + ( + const enthalpyJumpFvPatchScalarField&, + const fvPatch&, + const DimensionedField<scalar, volMesh>&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + enthalpyJumpFvPatchScalarField + ( + const enthalpyJumpFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp<fvPatchField<scalar> > clone() const + { + return tmp<fvPatchField<scalar> > + ( + new enthalpyJumpFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + enthalpyJumpFvPatchScalarField + ( + const enthalpyJumpFvPatchScalarField&, + const DimensionedField<scalar, volMesh>& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp<fvPatchField<scalar> > clone + ( + const DimensionedField<scalar, volMesh>& iF + ) const + { + return tmp<fvPatchField<scalar> > + ( + new enthalpyJumpFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + + // Evaluation functions + + //- Update the coefficients + virtual void updateCoeffs(); + + + //- Write + virtual void write(Ostream&) const; +}; + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermo.C b/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermo.C index 7f4d0fe1887fd55d1da3c260c10346443f93b8e8..92604068408029540f631cc1216f6fc8bd0d6f68 100644 --- a/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermo.C +++ b/src/thermophysicalModels/basic/psiThermo/hPsiThermo/hPsiThermo.C @@ -113,7 +113,8 @@ Foam::hPsiThermo<MixtureType>::hPsiThermo(const fvMesh& mesh) ), mesh, dimEnergy/dimMass, - this->hBoundaryTypes() + this->hBoundaryTypes(), + mesh.boundaryMesh().types() ) { scalarField& hCells = h_.internalField(); diff --git a/src/thermophysicalModels/basic/psiThermo/hsPsiThermo/hsPsiThermo.C b/src/thermophysicalModels/basic/psiThermo/hsPsiThermo/hsPsiThermo.C index a8010f8700f2721bd80c86a9843db5ed7c8ee429..7d1cae28f9715b44e38904cb421e051ad1d00ea0 100644 --- a/src/thermophysicalModels/basic/psiThermo/hsPsiThermo/hsPsiThermo.C +++ b/src/thermophysicalModels/basic/psiThermo/hsPsiThermo/hsPsiThermo.C @@ -113,7 +113,8 @@ Foam::hsPsiThermo<MixtureType>::hsPsiThermo(const fvMesh& mesh) ), mesh, dimEnergy/dimMass, - this->hBoundaryTypes() + this->hBoundaryTypes(), + mesh.boundaryMesh().types() ) { scalarField& hsCells = hs_.internalField(); diff --git a/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.C b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.C index e2e7503cfc938a1681a55fdf12940d02ad7f3044..d27b7b31cd9b4c1c81bfb01f2832f3db6692358c 100644 --- a/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.C +++ b/src/thermophysicalModels/basic/rhoThermo/hRhoThermo/hRhoThermo.C @@ -118,9 +118,11 @@ Foam::hRhoThermo<MixtureType>::hRhoThermo(const fvMesh& mesh) ), mesh, dimEnergy/dimMass, - this->hBoundaryTypes() + this->hBoundaryTypes(), + mesh.boundaryMesh().types() ) { + scalarField& hCells = h_.internalField(); const scalarField& TCells = this->T_.internalField(); @@ -138,6 +140,7 @@ Foam::hRhoThermo<MixtureType>::hRhoThermo(const fvMesh& mesh) hBoundaryCorrection(h_); calculate(); + } diff --git a/src/thermophysicalModels/basic/rhoThermo/hsRhoThermo/hsRhoThermo.C b/src/thermophysicalModels/basic/rhoThermo/hsRhoThermo/hsRhoThermo.C index f8697bf675beabbcb7d650d392dd17a33bbac7f4..8d55e26d93d05a476305d5e1481381b01287bb64 100644 --- a/src/thermophysicalModels/basic/rhoThermo/hsRhoThermo/hsRhoThermo.C +++ b/src/thermophysicalModels/basic/rhoThermo/hsRhoThermo/hsRhoThermo.C @@ -118,7 +118,8 @@ Foam::hsRhoThermo<MixtureType>::hsRhoThermo(const fvMesh& mesh) ), mesh, dimEnergy/dimMass, - this->hBoundaryTypes() + this->hBoundaryTypes(), + mesh.boundaryMesh().types() ) { scalarField& hsCells = hs_.internalField();