diff --git a/src/fieldSources/Make/options b/src/fieldSources/Make/options index 5927956469..a98e673d25 100644 --- a/src/fieldSources/Make/options +++ b/src/fieldSources/Make/options @@ -13,5 +13,5 @@ LIB_LIBS = \ -lfiniteVolume \ -lsampling \ -lmeshTools \ - -lsolidThermo \ + /*-lsolidThermo*/ \ -lcompressibleTurbulenceModel diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.C b/src/thermophysicalModels/basic/basicThermo/basicThermo.C index f1ac31e459..84e30e31a4 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.C @@ -34,16 +34,56 @@ namespace Foam defineRunTimeSelectionTable(basicThermo, fvMesh); } +const Foam::word Foam::basicThermo::dictName("thermophysicalProperties"); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::basicThermo::basicThermo(const fvMesh& mesh) +Foam::volScalarField& Foam::basicThermo::lookupOrConstruct +( + const fvMesh& mesh, + const char* name +) const +{ + if (!mesh.objectRegistry::foundObject(name)) + { + volScalarField* fPtr + ( + new volScalarField + ( + IOobject + ( + name, + mesh.time().timeName(), + mesh, + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + mesh + ) + ); + + // Transfer ownership of this object to the objectRegistry + fPtr->store(fPtr); + } + + return const_cast + ( + mesh.objectRegistry::lookupObject(name) + ); +} + + +Foam::basicThermo::basicThermo +( + const fvMesh& mesh, + const word& phaseName +) : IOdictionary ( IOobject ( - "thermophysicalProperties", + phasePropertyName(dictName, phaseName), mesh.time().constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, @@ -51,24 +91,15 @@ Foam::basicThermo::basicThermo(const fvMesh& mesh) ) ), - p_ - ( - IOobject - ( - "p", - mesh.time().timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ), + phaseName_(phaseName), + + p_(lookupOrConstruct(mesh, "p")), T_ ( IOobject ( - "T", + phasePropertyName("T"), mesh.time().timeName(), mesh, IOobject::MUST_READ, @@ -81,7 +112,7 @@ Foam::basicThermo::basicThermo(const fvMesh& mesh) ( IOobject ( - "alpha", + phasePropertyName("alpha"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -98,14 +129,15 @@ Foam::basicThermo::basicThermo(const fvMesh& mesh) Foam::basicThermo::basicThermo ( const fvMesh& mesh, - const dictionary& dict + const dictionary& dict, + const word& phaseName ) : IOdictionary ( IOobject ( - "thermophysicalProperties", + phasePropertyName(dictName, phaseName), mesh.time().constant(), mesh, IOobject::NO_READ, @@ -114,24 +146,15 @@ Foam::basicThermo::basicThermo dict ), - p_ - ( - IOobject - ( - "p", - mesh.time().timeName(), - mesh, - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - mesh - ), + phaseName_(phaseName), + + p_(lookupOrConstruct(mesh, "p")), T_ ( IOobject ( - "T", + phasePropertyName("T"), mesh.time().timeName(), mesh, IOobject::MUST_READ, @@ -144,7 +167,7 @@ Foam::basicThermo::basicThermo ( IOobject ( - "alpha", + phasePropertyName("alpha"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -160,10 +183,11 @@ Foam::basicThermo::basicThermo Foam::autoPtr Foam::basicThermo::New ( - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) { - return New(mesh); + return New(mesh, phaseName); } @@ -175,16 +199,52 @@ Foam::basicThermo::~basicThermo() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // +const Foam::basicThermo& Foam::basicThermo::lookupThermo +( + const fvPatchScalarField& pf +) +{ + if (pf.db().foundObject(dictName)) + { + return pf.db().lookupObject(dictName); + } + else + { + HashTable thermos = + pf.db().lookupClass(); + + for + ( + HashTable::iterator iter = thermos.begin(); + iter != thermos.end(); + ++iter + ) + { + if + ( + &(iter()->he().dimensionedInternalField()) + == &(pf.dimensionedInternalField()) + ) + { + return *iter(); + } + } + } + + return pf.db().lookupObject(dictName); +} + + void Foam::basicThermo::validate ( const word& app, const word& a ) const { - if (!(he().name() == a)) + if (!(he().name() == phasePropertyName(a))) { FatalErrorIn(app) - << "Supported energy type is " << a + << "Supported energy type is " << phasePropertyName(a) << ", thermodynamics package provides " << he().name() << exit(FatalError); } @@ -197,10 +257,17 @@ void Foam::basicThermo::validate const word& b ) const { - if (!(he().name() == a || he().name() == b)) + if + ( + !( + he().name() == phasePropertyName(a) + || he().name() == phasePropertyName(b) + ) + ) { FatalErrorIn(app) - << "Supported energy types are " << a << " and " << b + << "Supported energy types are " << phasePropertyName(a) + << " and " << phasePropertyName(b) << ", thermodynamics package provides " << he().name() << exit(FatalError); } @@ -217,14 +284,16 @@ void Foam::basicThermo::validate if ( !( - he().name() == a - || he().name() == b - || he().name() == c + he().name() == phasePropertyName(a) + || he().name() == phasePropertyName(b) + || he().name() == phasePropertyName(c) ) ) { FatalErrorIn(app) - << "Supported energy types are " << a << ", " << b << " and " << c + << "Supported energy types are " << phasePropertyName(a) + << ", " << phasePropertyName(b) + << " and " << phasePropertyName(c) << ", thermodynamics package provides " << he().name() << exit(FatalError); } @@ -242,16 +311,18 @@ void Foam::basicThermo::validate if ( !( - he().name() == a - || he().name() == b - || he().name() == c - || he().name() == d + he().name() == phasePropertyName(a) + || he().name() == phasePropertyName(b) + || he().name() == phasePropertyName(c) + || he().name() == phasePropertyName(d) ) ) { FatalErrorIn(app) - << "Supported energy types are " << a << ", " << b - << ", " << c << " and " << d + << "Supported energy types are " << phasePropertyName(a) + << ", " << phasePropertyName(b) + << ", " << phasePropertyName(c) + << " and " << phasePropertyName(d) << ", thermodynamics package provides " << he().name() << exit(FatalError); } diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.H b/src/thermophysicalModels/basic/basicThermo/basicThermo.H index 2064444ff2..659b6f35ca 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.H +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.H @@ -59,10 +59,14 @@ protected: // Protected data + //- Phase-name + const word& phaseName_; + + // Fields //- Pressure [Pa] - volScalarField p_; + volScalarField& p_; //- Temperature [K] volScalarField T_; @@ -76,6 +80,12 @@ protected: //- Construct as copy (not implemented) basicThermo(const basicThermo&); + volScalarField& lookupOrConstruct + ( + const fvMesh& mesh, + const char* name + ) const; + public: @@ -89,18 +99,27 @@ public: autoPtr, basicThermo, fvMesh, - (const fvMesh& mesh), - (mesh) + (const fvMesh& mesh, const word& phaseName), + (mesh, phaseName) ); // Constructors - //- Construct from mesh - basicThermo(const fvMesh&); + //- Construct from mesh and phase name + basicThermo + ( + const fvMesh&, + const word& phaseName + ); - //- Construct from mesh - basicThermo(const fvMesh&, const dictionary&); + //- Construct from mesh, dictionary and phase name + basicThermo + ( + const fvMesh&, + const dictionary&, + const word& phaseName + ); // Selectors @@ -115,14 +134,27 @@ public: //- Generic New for each of the related thermodynamics packages template - static autoPtr New(const fvMesh&); + static autoPtr New + ( + const fvMesh&, + const word& phaseName=word::null + ); //- Generic New for each of the related thermodynamics packages template - static autoPtr New(const fvMesh&, const dictionary&); + static autoPtr New + ( + const fvMesh&, + const dictionary&, + const word& phaseName=word::null + ); //- Specialisation of the Generic New for basicThermo - static autoPtr New(const fvMesh&); + static autoPtr New + ( + const fvMesh&, + const word& phaseName=word::null + ); //- Destructor @@ -131,6 +163,24 @@ public: // Member functions + static const word dictName; + + static word phasePropertyName + ( + const word& name, + const word& phaseName + ) + { + return name + phaseName; + } + + word phasePropertyName(const word& name) const + { + return basicThermo::phasePropertyName(name, phaseName_); + } + + static const basicThermo& lookupThermo(const fvPatchScalarField& pf); + //- Check that the thermodynamics package is consistent // with energy forms supported by the application void validate @@ -356,7 +406,7 @@ public: ) const = 0; - //- Read thermophysicalProperties dictionary + //- Read thermophysical properties dictionary virtual bool read(); }; diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermoTemplates.C b/src/thermophysicalModels/basic/basicThermo/basicThermoTemplates.C index e22b4f33c7..4521750996 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermoTemplates.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermoTemplates.C @@ -136,14 +136,15 @@ typename Table::iterator Foam::basicThermo::lookupThermo template Foam::autoPtr Foam::basicThermo::New ( - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) { IOdictionary thermoDict ( IOobject ( - "thermophysicalProperties", + phasePropertyName(dictName, phaseName), mesh.time().constant(), mesh, IOobject::MUST_READ_IF_MODIFIED, @@ -159,7 +160,7 @@ Foam::autoPtr Foam::basicThermo::New Thermo::fvMeshConstructorTablePtr_ ); - return autoPtr(cstrIter()(mesh)); + return autoPtr(cstrIter()(mesh, phaseName)); } @@ -167,7 +168,8 @@ template Foam::autoPtr Foam::basicThermo::New ( const fvMesh& mesh, - const dictionary& dict + const dictionary& dict, + const word& phaseName ) { typename Thermo::dictionaryConstructorTable::iterator cstrIter = @@ -177,7 +179,7 @@ Foam::autoPtr Foam::basicThermo::New Thermo::dictionaryConstructorTablePtr_ ); - return autoPtr(cstrIter()(mesh, dict)); + return autoPtr(cstrIter()(mesh, dict, phaseName)); } diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C index 71a097f55f..9e5578b886 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJump/energyJumpFvPatchScalarField.C @@ -101,9 +101,7 @@ void Foam::energyJumpFvPatchScalarField::updateCoeffs() if (this->cyclicPatch().owner()) { - const basicThermo& thermo = - db().lookupObject("thermophysicalProperties"); - + const basicThermo& thermo = basicThermo::lookupThermo(*this); label patchID = patch().index(); const scalarField& pp = thermo.p().boundaryField()[patchID]; diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C index 81a992b9ab..7f6a09c181 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/energyJump/energyJumpAMI/energyJumpAMIFvPatchScalarField.C @@ -101,9 +101,7 @@ void Foam::energyJumpAMIFvPatchScalarField::updateCoeffs() if (this->cyclicAMIPatch().owner()) { - const basicThermo& thermo = - db().lookupObject("thermophysicalProperties"); - + const basicThermo& thermo = basicThermo::lookupThermo(*this); label patchID = patch().index(); const scalarField& pp = thermo.p().boundaryField()[patchID]; diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C index 3dd72e1e68..0be59a2285 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C @@ -97,12 +97,7 @@ void Foam::fixedEnergyFvPatchScalarField::updateCoeffs() return; } - const basicThermo& thermo = db().lookupObject - ( - "thermophysicalProperties" - ); - - + const basicThermo& thermo = basicThermo::lookupThermo(*this); const label patchi = patch().index(); const scalarField& pw = thermo.p().boundaryField()[patchi]; diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.C index 5f0e009d13..5a173ec12d 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/gradientEnergy/gradientEnergyFvPatchScalarField.C @@ -97,9 +97,7 @@ void Foam::gradientEnergyFvPatchScalarField::updateCoeffs() return; } - const basicThermo& thermo = - db().lookupObject("thermophysicalProperties"); - + const basicThermo& thermo = basicThermo::lookupThermo(*this); const label patchi = patch().index(); const scalarField& pw = thermo.p().boundaryField()[patchi]; diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C index af83cfd20e..4d8d66874f 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/mixedEnergy/mixedEnergyFvPatchScalarField.C @@ -102,11 +102,7 @@ void Foam::mixedEnergyFvPatchScalarField::updateCoeffs() return; } - const basicThermo& thermo = db().lookupObject - ( - "thermophysicalProperties" - ); - + const basicThermo& thermo = basicThermo::lookupThermo(*this); const label patchi = patch().index(); const scalarField& pw = thermo.p().boundaryField()[patchi]; diff --git a/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C b/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C index 681f1c36a1..da9ff9b2bb 100644 --- a/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C +++ b/src/thermophysicalModels/basic/derivedFvPatchFields/wallHeatTransfer/wallHeatTransferFvPatchScalarField.C @@ -149,11 +149,7 @@ void Foam::wallHeatTransferFvPatchScalarField::updateCoeffs() return; } - const basicThermo& thermo = db().lookupObject - ( - "thermophysicalProperties" - ); - + const basicThermo& thermo = basicThermo::lookupThermo(*this); const label patchi = patch().index(); const scalarField& pw = thermo.p().boundaryField()[patchi]; diff --git a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C index 4aef741b50..f330c6ae81 100644 --- a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C +++ b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C @@ -36,16 +36,21 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::fluidThermo::fluidThermo(const fvMesh& mesh) +Foam::fluidThermo::fluidThermo(const fvMesh& mesh, const word& phaseName) : - basicThermo(mesh) + basicThermo(mesh, phaseName) {} -Foam::fluidThermo::fluidThermo(const fvMesh& mesh, const dictionary& dict) +Foam::fluidThermo::fluidThermo +( + const fvMesh& mesh, + const dictionary& dict, + const word& phaseName +) : - basicThermo(mesh, dict) + basicThermo(mesh, dict, phaseName) {} @@ -53,10 +58,11 @@ Foam::fluidThermo::fluidThermo(const fvMesh& mesh, const dictionary& dict) Foam::autoPtr Foam::fluidThermo::New ( - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) { - return basicThermo::New(mesh); + return basicThermo::New(mesh, phaseName); } diff --git a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H index 21de4808ff..d8612d7db5 100644 --- a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H +++ b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.H @@ -63,21 +63,34 @@ public: autoPtr, fluidThermo, fvMesh, - (const fvMesh& mesh), - (mesh) + (const fvMesh& mesh, const word& phaseName), + (mesh, phaseName) ); // Constructors - //- Construct from mesh - fluidThermo(const fvMesh&); + //- Construct from mesh and phase name + fluidThermo + ( + const fvMesh&, + const word& phaseName + ); - //- Construct from mesh - fluidThermo(const fvMesh&, const dictionary&); + //- Construct from mesh and phase name + fluidThermo + ( + const fvMesh&, + const dictionary&, + const word& phaseName + ); //- Selector - static autoPtr New(const fvMesh&); + static autoPtr New + ( + const fvMesh&, + const word& phaseName=word::null + ); //- Destructor diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.C b/src/thermophysicalModels/basic/heThermo/heThermo.C index f3902a033d..bba8da1514 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.C +++ b/src/thermophysicalModels/basic/heThermo/heThermo.C @@ -128,16 +128,20 @@ void Foam::heThermo::init() template -Foam::heThermo::heThermo(const fvMesh& mesh) +Foam::heThermo::heThermo +( + const fvMesh& mesh, + const word& phaseName +) : - BasicThermo(mesh), + BasicThermo(mesh, phaseName), MixtureType(*this, mesh), he_ ( IOobject ( - MixtureType::thermoType::heName(), + BasicThermo::phasePropertyName(MixtureType::thermoType::heName()), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -156,17 +160,18 @@ template Foam::heThermo::heThermo ( const fvMesh& mesh, - const dictionary& dict + const dictionary& dict, + const word& phaseName ) : - BasicThermo(mesh, dict), + BasicThermo(mesh, dict, phaseName), MixtureType(*this, mesh), he_ ( IOobject ( - MixtureType::thermoType::heName(), + BasicThermo::phasePropertyName(MixtureType::thermoType::heName()), mesh.time().timeName(), mesh, IOobject::NO_READ, diff --git a/src/thermophysicalModels/basic/heThermo/heThermo.H b/src/thermophysicalModels/basic/heThermo/heThermo.H index c6416878e1..2c894eee43 100644 --- a/src/thermophysicalModels/basic/heThermo/heThermo.H +++ b/src/thermophysicalModels/basic/heThermo/heThermo.H @@ -89,10 +89,19 @@ public: // Constructors //- Construct from mesh - heThermo(const fvMesh&); + heThermo + ( + const fvMesh&, + const word& phaseName + ); //- Construct from mesh and dictionary - heThermo(const fvMesh&, const dictionary&); + heThermo + ( + const fvMesh&, + const dictionary&, + const word& phaseName + ); //- Destructor @@ -284,7 +293,7 @@ public: ) const; - //- Read thermophysicalProperties dictionary + //- Read thermophysical properties dictionary virtual bool read(); }; diff --git a/src/thermophysicalModels/basic/psiThermo/hePsiThermo.C b/src/thermophysicalModels/basic/psiThermo/hePsiThermo.C index 06c9b47697..970fc82fe3 100644 --- a/src/thermophysicalModels/basic/psiThermo/hePsiThermo.C +++ b/src/thermophysicalModels/basic/psiThermo/hePsiThermo.C @@ -102,9 +102,13 @@ void Foam::hePsiThermo::calculate() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -Foam::hePsiThermo::hePsiThermo(const fvMesh& mesh) +Foam::hePsiThermo::hePsiThermo +( + const fvMesh& mesh, + const word& phaseName +) : - heThermo(mesh) + heThermo(mesh, phaseName) { calculate(); diff --git a/src/thermophysicalModels/basic/psiThermo/hePsiThermo.H b/src/thermophysicalModels/basic/psiThermo/hePsiThermo.H index a701a854c2..41aa6da1c8 100644 --- a/src/thermophysicalModels/basic/psiThermo/hePsiThermo.H +++ b/src/thermophysicalModels/basic/psiThermo/hePsiThermo.H @@ -68,8 +68,12 @@ public: // Constructors - //- Construct from mesh - hePsiThermo(const fvMesh&); + //- Construct from mesh and phase name + hePsiThermo + ( + const fvMesh&, + const word& phaseName + ); //- Destructor diff --git a/src/thermophysicalModels/basic/psiThermo/psiThermo.C b/src/thermophysicalModels/basic/psiThermo/psiThermo.C index 30949d16d7..fd4bc962c9 100644 --- a/src/thermophysicalModels/basic/psiThermo/psiThermo.C +++ b/src/thermophysicalModels/basic/psiThermo/psiThermo.C @@ -36,15 +36,15 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::psiThermo::psiThermo(const fvMesh& mesh) +Foam::psiThermo::psiThermo(const fvMesh& mesh, const word& phaseName) : - fluidThermo(mesh), + fluidThermo(mesh, phaseName), psi_ ( IOobject ( - "psi", + phasePropertyName("psi"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -58,7 +58,7 @@ Foam::psiThermo::psiThermo(const fvMesh& mesh) ( IOobject ( - "mu", + phasePropertyName("mu"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -74,10 +74,11 @@ Foam::psiThermo::psiThermo(const fvMesh& mesh) Foam::autoPtr Foam::psiThermo::New ( - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) { - return basicThermo::New(mesh); + return basicThermo::New(mesh, phaseName); } diff --git a/src/thermophysicalModels/basic/psiThermo/psiThermo.H b/src/thermophysicalModels/basic/psiThermo/psiThermo.H index 84a9dff0b4..7ac2973a5b 100644 --- a/src/thermophysicalModels/basic/psiThermo/psiThermo.H +++ b/src/thermophysicalModels/basic/psiThermo/psiThermo.H @@ -81,19 +81,27 @@ public: autoPtr, psiThermo, fvMesh, - (const fvMesh& mesh), - (mesh) + (const fvMesh& mesh, const word& phaseName), + (mesh, phaseName) ); // Constructors - //- Construct from mesh - psiThermo(const fvMesh&); + //- Construct from mesh and phase name + psiThermo + ( + const fvMesh&, + const word& phaseName + ); //- Selector - static autoPtr New(const fvMesh&); + static autoPtr New + ( + const fvMesh& mesh, + const word& phaseName=word::null + ); //- Destructor diff --git a/src/thermophysicalModels/basic/rhoThermo/heRhoThermo.C b/src/thermophysicalModels/basic/rhoThermo/heRhoThermo.C index 0284f76454..ec7aad7e72 100644 --- a/src/thermophysicalModels/basic/rhoThermo/heRhoThermo.C +++ b/src/thermophysicalModels/basic/rhoThermo/heRhoThermo.C @@ -107,9 +107,13 @@ void Foam::heRhoThermo::calculate() // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // template -Foam::heRhoThermo::heRhoThermo(const fvMesh& mesh) +Foam::heRhoThermo::heRhoThermo +( + const fvMesh& mesh, + const word& phaseName +) : - heThermo(mesh) + heThermo(mesh, phaseName) { calculate(); } diff --git a/src/thermophysicalModels/basic/rhoThermo/heRhoThermo.H b/src/thermophysicalModels/basic/rhoThermo/heRhoThermo.H index 9722526fc6..287041dbf8 100644 --- a/src/thermophysicalModels/basic/rhoThermo/heRhoThermo.H +++ b/src/thermophysicalModels/basic/rhoThermo/heRhoThermo.H @@ -69,8 +69,12 @@ public: // Constructors - //- Construct from mesh - heRhoThermo(const fvMesh&); + //- Construct from mesh and phase name + heRhoThermo + ( + const fvMesh&, + const word& phaseName + ); //- Destructor diff --git a/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C b/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C index d5e572f615..4aa7835cac 100644 --- a/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C +++ b/src/thermophysicalModels/basic/rhoThermo/rhoThermo.C @@ -36,14 +36,14 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::rhoThermo::rhoThermo(const fvMesh& mesh) +Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const word& phaseName) : - fluidThermo(mesh), + fluidThermo(mesh, phaseName), rho_ ( IOobject ( - "rhoThermo", + phasePropertyName("rhoThermo"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -57,7 +57,7 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh) ( IOobject ( - "psi", + phasePropertyName("psi"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -71,7 +71,7 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh) ( IOobject ( - "mu", + phasePropertyName("mu"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -83,14 +83,19 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh) {} -Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const dictionary& dict) +Foam::rhoThermo::rhoThermo +( + const fvMesh& mesh, + const dictionary& dict, + const word& phaseName +) : - fluidThermo(mesh, dict), + fluidThermo(mesh, dict, phaseName), rho_ ( IOobject ( - "rhoThermo", + phasePropertyName("rhoThermo"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -104,7 +109,7 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const dictionary& dict) ( IOobject ( - "psi", + phasePropertyName("psi"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -118,7 +123,7 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const dictionary& dict) ( IOobject ( - "mu", + phasePropertyName("mu"), mesh.time().timeName(), mesh, IOobject::NO_READ, @@ -134,10 +139,11 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const dictionary& dict) Foam::autoPtr Foam::rhoThermo::New ( - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) { - return basicThermo::New(mesh); + return basicThermo::New(mesh, phaseName); } diff --git a/src/thermophysicalModels/basic/rhoThermo/rhoThermo.H b/src/thermophysicalModels/basic/rhoThermo/rhoThermo.H index cc477d35eb..4202267e2b 100644 --- a/src/thermophysicalModels/basic/rhoThermo/rhoThermo.H +++ b/src/thermophysicalModels/basic/rhoThermo/rhoThermo.H @@ -85,22 +85,35 @@ public: autoPtr, rhoThermo, fvMesh, - (const fvMesh& mesh), - (mesh) + (const fvMesh& mesh, const word& phaseName), + (mesh, phaseName) ); // Constructors - //- Construct from mesh - rhoThermo(const fvMesh&); + //- Construct from mesh and phase name + rhoThermo + ( + const fvMesh&, + const word& phaseName + ); - //- Construct from mesh - rhoThermo(const fvMesh&, const dictionary&); + //- Construct from mesh, dictionary and phase name + rhoThermo + ( + const fvMesh&, + const dictionary&, + const word& phaseName + ); //- Selector - static autoPtr New(const fvMesh&); + static autoPtr New + ( + const fvMesh&, + const word& phaseName=word::null + ); //- Destructor diff --git a/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermo.C b/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermo.C index c0afb6a513..afacba2ebf 100644 --- a/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermo.C +++ b/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermo.C @@ -36,9 +36,13 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::psiReactionThermo::psiReactionThermo(const fvMesh& mesh) +Foam::psiReactionThermo::psiReactionThermo +( + const fvMesh& mesh, + const word& phaseName +) : - psiThermo(mesh) + psiThermo(mesh, phaseName) {} @@ -46,10 +50,11 @@ Foam::psiReactionThermo::psiReactionThermo(const fvMesh& mesh) Foam::autoPtr Foam::psiReactionThermo::New ( - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) { - return basicThermo::New(mesh); + return basicThermo::New(mesh, phaseName); } diff --git a/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermo.H b/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermo.H index 8add518a8b..79af428518 100644 --- a/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermo.H +++ b/src/thermophysicalModels/reactionThermo/psiReactionThermo/psiReactionThermo.H @@ -66,21 +66,29 @@ public: autoPtr, psiReactionThermo, fvMesh, - (const fvMesh& mesh), - (mesh) + (const fvMesh& mesh, const word& phaseName), + (mesh, phaseName) ); // Constructors - //- Construct from dictionary and mesh - psiReactionThermo(const fvMesh&); + //- Construct from mesh and phase name + psiReactionThermo + ( + const fvMesh&, + const word& phaseName + ); // Selectors //- Standard selection based on fvMesh - static autoPtr New(const fvMesh&); + static autoPtr New + ( + const fvMesh&, + const word& phaseName=word::null + ); //- Destructor diff --git a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.C b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.C index 8a2daccfe6..cc6950b80a 100644 --- a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.C +++ b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.C @@ -121,10 +121,11 @@ void Foam::heheuPsiThermo::calculate() template Foam::heheuPsiThermo::heheuPsiThermo ( - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) : - heThermo(mesh), + heThermo(mesh, phaseName), Tu_ ( IOobject diff --git a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.H b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.H index 2a9645df0e..4c52e775ed 100644 --- a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.H +++ b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/heheuPsiThermo.H @@ -76,8 +76,12 @@ public: // Constructors - //- Construct from mesh - heheuPsiThermo(const fvMesh&); + //- Construct from mesh and phase name + heheuPsiThermo + ( + const fvMesh&, + const word& phaseName + ); //- Destructor diff --git a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermo.C b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermo.C index b5f824c376..45e6b01bac 100644 --- a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermo.C +++ b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermo.C @@ -100,9 +100,13 @@ void psiuReactionThermo::heuBoundaryCorrection(volScalarField& heu) // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -psiuReactionThermo::psiuReactionThermo(const fvMesh& mesh) +psiuReactionThermo::psiuReactionThermo +( + const fvMesh& mesh, + const word& phaseName +) : - psiReactionThermo(mesh) + psiReactionThermo(mesh, phaseName) {} @@ -110,10 +114,11 @@ psiuReactionThermo::psiuReactionThermo(const fvMesh& mesh) Foam::autoPtr Foam::psiuReactionThermo::New ( - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) { - return basicThermo::New(mesh); + return basicThermo::New(mesh, phaseName); } diff --git a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermo.H b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermo.H index f27e3662c0..0a0b3bcfa4 100644 --- a/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermo.H +++ b/src/thermophysicalModels/reactionThermo/psiuReactionThermo/psiuReactionThermo.H @@ -73,20 +73,28 @@ public: autoPtr, psiuReactionThermo, fvMesh, - (const fvMesh& mesh), - (mesh) + (const fvMesh& mesh, const word& phaseName), + (mesh, phaseName) ); // Constructors - //- Construct from dictionary and mesh - psiuReactionThermo(const fvMesh&); + //- Construct from mesh and phase name + psiuReactionThermo + ( + const fvMesh&, + const word& phaseName + ); // Selectors - static autoPtr New(const fvMesh&); + static autoPtr New + ( + const fvMesh&, + const word& phaseName=word::null + ); //- Destructor diff --git a/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermo.C b/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermo.C index ef056e4267..12e34e90b7 100644 --- a/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermo.C +++ b/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermo.C @@ -36,9 +36,13 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::rhoReactionThermo::rhoReactionThermo(const fvMesh& mesh) +Foam::rhoReactionThermo::rhoReactionThermo +( + const fvMesh& mesh, + const word& phaseName +) : - rhoThermo(mesh) + rhoThermo(mesh, phaseName) {} @@ -46,10 +50,11 @@ Foam::rhoReactionThermo::rhoReactionThermo(const fvMesh& mesh) Foam::autoPtr Foam::rhoReactionThermo::New ( - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) { - return basicThermo::New(mesh); + return basicThermo::New(mesh, phaseName); } diff --git a/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermo.H b/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermo.H index 227d6382da..346b0d8580 100644 --- a/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermo.H +++ b/src/thermophysicalModels/reactionThermo/rhoReactionThermo/rhoReactionThermo.H @@ -66,21 +66,29 @@ public: autoPtr, rhoReactionThermo, fvMesh, - (const fvMesh& mesh), - (mesh) + (const fvMesh& mesh, const word& phaseName), + (mesh, phaseName) ); // Constructors - //- Construct from dictionary and mesh - rhoReactionThermo(const fvMesh&); + //- Construct from mesh and phase name + rhoReactionThermo + ( + const fvMesh&, + const word& phaseName + ); // Selectors //- Standard selection based on fvMesh - static autoPtr New(const fvMesh&); + static autoPtr New + ( + const fvMesh&, + const word& phaseName=word::null + ); //- Destructor diff --git a/src/thermophysicalModels/solidThermo/solidReactionThermo/solidReactionThermo.C b/src/thermophysicalModels/solidThermo/solidReactionThermo/solidReactionThermo.C index 77184b166b..5bf7cd7786 100644 --- a/src/thermophysicalModels/solidThermo/solidReactionThermo/solidReactionThermo.C +++ b/src/thermophysicalModels/solidThermo/solidReactionThermo/solidReactionThermo.C @@ -38,19 +38,24 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::solidReactionThermo::solidReactionThermo(const fvMesh& mesh) +Foam::solidReactionThermo::solidReactionThermo +( + const fvMesh& mesh, + const word& phaseName +) : - solidThermo(mesh) + solidThermo(mesh, phaseName) {} Foam::solidReactionThermo::solidReactionThermo ( const fvMesh& mesh, - const dictionary& dict + const dictionary& dict, + const word& phaseName ) : - solidThermo(mesh, dict) + solidThermo(mesh, dict, phaseName) {} @@ -58,20 +63,22 @@ Foam::solidReactionThermo::solidReactionThermo Foam::autoPtr Foam::solidReactionThermo::New ( - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) { - return basicThermo::New(mesh); + return basicThermo::New(mesh, phaseName); } Foam::autoPtr Foam::solidReactionThermo::New ( const fvMesh& mesh, - const dictionary& dict + const dictionary& dict, + const word& phaseName ) { - return basicThermo::New(mesh, dict); + return basicThermo::New(mesh, dict, phaseName); } diff --git a/src/thermophysicalModels/solidThermo/solidReactionThermo/solidReactionThermo.H b/src/thermophysicalModels/solidThermo/solidReactionThermo/solidReactionThermo.H index e9112602e1..1a3c041dff 100644 --- a/src/thermophysicalModels/solidThermo/solidReactionThermo/solidReactionThermo.H +++ b/src/thermophysicalModels/solidThermo/solidReactionThermo/solidReactionThermo.H @@ -67,8 +67,8 @@ public: autoPtr, solidReactionThermo, fvMesh, - (const fvMesh& mesh), - (mesh) + (const fvMesh& mesh, const word& phaseName), + (mesh, phaseName) ); // Declare run-time constructor selection tables @@ -77,31 +77,46 @@ public: autoPtr, solidReactionThermo, dictionary, - (const fvMesh& mesh, const dictionary& dict), - (mesh, dict) + (const fvMesh& mesh, const dictionary& dict, const word& phaseName), + (mesh, dict, phaseName) ); // Constructors - //- Construct from mesh - solidReactionThermo(const fvMesh&); + //- Construct from mesh and phase name + solidReactionThermo + ( + const fvMesh&, + const word& phaseName + ); - //- Construct from dictionary and mesh - solidReactionThermo(const fvMesh&, const dictionary&); + //- Construct from mesh, dictionary and phase name + solidReactionThermo + ( + const fvMesh&, + const dictionary&, + const word& phaseName + ); // Selectors //- Standard selection based on fvMesh - static autoPtr New(const fvMesh&); + static autoPtr New + ( + const fvMesh&, + const word& phaseName=word::null + ); //- Standard selection based on fvMesh amd dictionary static autoPtr New ( const fvMesh&, - const dictionary& + const dictionary&, + const word& phaseName=word::null ); + //- Destructor virtual ~solidReactionThermo(); diff --git a/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.C b/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.C index 55f9bc1999..65f07073f6 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.C +++ b/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.C @@ -124,9 +124,13 @@ void Foam::heSolidThermo::calculate() template Foam::heSolidThermo:: -heSolidThermo(const fvMesh& mesh) +heSolidThermo +( + const fvMesh& mesh, + const word& phaseName +) : - heThermo(mesh) + heThermo(mesh, phaseName) { calculate(); } @@ -134,9 +138,14 @@ heSolidThermo(const fvMesh& mesh) template Foam::heSolidThermo:: -heSolidThermo(const fvMesh& mesh, const dictionary& dict) +heSolidThermo +( + const fvMesh& mesh, + const dictionary& dict, + const word& phaseName +) : - heThermo(mesh, dict) + heThermo(mesh, dict, phaseName) { calculate(); } diff --git a/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.H b/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.H index ee1f9aa010..8d13ea6e28 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.H +++ b/src/thermophysicalModels/solidThermo/solidThermo/heSolidThermo.H @@ -68,11 +68,20 @@ public: // Constructors - //- Construct from mesh - heSolidThermo(const fvMesh&); + //- Construct from mesh and phase name + heSolidThermo + ( + const fvMesh&, + const word& phaseName + ); - //- Construct from mesh and dictionary - heSolidThermo(const fvMesh&, const dictionary&); + //- Construct from mesh, dictionary and phase name + heSolidThermo + ( + const fvMesh&, + const dictionary&, + const word& phaseName + ); //- Destructor diff --git a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.C b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.C index faf4ea6155..102414e3fb 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.C +++ b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.C @@ -39,9 +39,13 @@ namespace Foam // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::solidThermo::solidThermo(const fvMesh& mesh) +Foam::solidThermo::solidThermo +( + const fvMesh& mesh, + const word& phaseName +) : - basicThermo(mesh), + basicThermo(mesh, phaseName), rho_ ( IOobject @@ -61,10 +65,11 @@ Foam::solidThermo::solidThermo(const fvMesh& mesh) Foam::solidThermo::solidThermo ( const fvMesh& mesh, - const dictionary& dict + const dictionary& dict, + const word& phaseName ) : - basicThermo(mesh, dict), + basicThermo(mesh, dict, phaseName), rho_ ( IOobject @@ -85,20 +90,22 @@ Foam::solidThermo::solidThermo Foam::autoPtr Foam::solidThermo::New ( - const fvMesh& mesh + const fvMesh& mesh, + const word& phaseName ) { - return basicThermo::New(mesh); + return basicThermo::New(mesh, phaseName); } Foam::autoPtr Foam::solidThermo::New ( const fvMesh& mesh, - const dictionary& dict + const dictionary& dict, + const word& phaseName ) { - return basicThermo::New(mesh, dict); + return basicThermo::New(mesh, dict, phaseName); } diff --git a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H index a7fbf5c067..893a9673ea 100644 --- a/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H +++ b/src/thermophysicalModels/solidThermo/solidThermo/solidThermo.H @@ -78,8 +78,8 @@ public: autoPtr, solidThermo, fvMesh, - (const fvMesh& mesh), - (mesh) + (const fvMesh& mesh, const word& phaseName), + (mesh, phaseName) ); // Declare run-time constructor selection tables @@ -88,26 +88,44 @@ public: autoPtr, solidThermo, dictionary, - (const fvMesh& mesh, const dictionary& dict), - (mesh, dict) + (const fvMesh& mesh, const dictionary& dict, const word& phaseName), + (mesh, dict, phaseName) ); // Constructors - //- Construct from mesh - solidThermo(const fvMesh&); + //- Construct from mesh and phase name + solidThermo + ( + const fvMesh&, + const word& phaseName + ); - //- Construct from mesh and dict - solidThermo(const fvMesh&, const dictionary& dict); + //- Construct from mesh, dictionary and phase name + solidThermo + ( + const fvMesh&, + const dictionary& dict, + const word& phaseName + ); //- Return a pointer to a new solidThermo created from // the solidThermophysicalProperties dictionary - static autoPtr New(const fvMesh&); + static autoPtr New + ( + const fvMesh&, + const word& phaseName=word::null + ); //- Return a pointer to a new solidThermo created from // local dictionary - static autoPtr New(const fvMesh&, const dictionary&); + static autoPtr New + ( + const fvMesh&, + const dictionary&, + const word& phaseName=word::null + ); //- Destructor diff --git a/src/turbulenceModels/compressible/turbulenceModel/Make/options b/src/turbulenceModels/compressible/turbulenceModel/Make/options index a3d25da57a..9b024f163d 100644 --- a/src/turbulenceModels/compressible/turbulenceModel/Make/options +++ b/src/turbulenceModels/compressible/turbulenceModel/Make/options @@ -15,4 +15,3 @@ LIB_LIBS = \ -lmeshTools \ -lsolidSpecie \ -lradiationModels - diff --git a/tutorials/compressible/rhoSimplecFoam/squareBend/system/fvSchemes b/tutorials/compressible/rhoSimplecFoam/squareBend/system/fvSchemes index 0cab2f77d3..5a12a4e1da 100644 --- a/tutorials/compressible/rhoSimplecFoam/squareBend/system/fvSchemes +++ b/tutorials/compressible/rhoSimplecFoam/squareBend/system/fvSchemes @@ -48,7 +48,6 @@ laplacianSchemes interpolationSchemes { default linear; - UD upwind phid; } snGradSchemes