diff --git a/src/thermophysicalModels/basic/Make/files b/src/thermophysicalModels/basic/Make/files index f49b474762..ca80ac7279 100644 --- a/src/thermophysicalModels/basic/Make/files +++ b/src/thermophysicalModels/basic/Make/files @@ -1,18 +1,10 @@ -mixtures/basicMixture/basicMixture.C -mixtures/basicMixture/basicMixtures.C - basicThermo/basicThermo.C -basicThermo/basicThermoNew.C - fluidThermo/fluidThermo.C -fluidThermo/fluidThermoNew.C psiThermo/psiThermo/psiThermo.C -psiThermo/psiThermo/psiThermoNew.C psiThermo/hePsiThermo/hePsiThermos.C rhoThermo/rhoThermo/rhoThermo.C -rhoThermo/rhoThermo/rhoThermoNew.C rhoThermo/heRhoThermo/heRhoThermos.C derivedFvPatchFields/fixedEnergy/fixedEnergyFvPatchScalarField.C diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.C b/src/thermophysicalModels/basic/basicThermo/basicThermo.C index 13d6f0462c..d20f1cbe4d 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.C @@ -156,6 +156,15 @@ Foam::basicThermo::basicThermo {} +Foam::autoPtr Foam::basicThermo::New +( + const fvMesh& mesh +) +{ + return NewThermo(mesh); +} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::basicThermo::~basicThermo() @@ -247,6 +256,41 @@ void Foam::basicThermo::validate } +Foam::wordList Foam::basicThermo::splitThermoName +( + const word& thermoName, + const int nCmpt +) +{ + wordList cmpts(nCmpt); + + string::size_type beg=0, end=0; + int i = 0; + + while + ( + (end = thermoName.find('<', beg)) != string::npos + || (end = thermoName.find(',', beg)) != string::npos + ) + { + if (beg < end) + { + cmpts[i] = thermoName.substr(beg, end-beg); + cmpts[i++].replaceAll(">",""); + } + beg = end + 1; + } + + if (beg < thermoName.size()) + { + cmpts[i] = thermoName.substr(beg, string::npos); + cmpts[i++].replaceAll(">",""); + } + + return cmpts; +} + + Foam::volScalarField& Foam::basicThermo::p() { return p_; diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.H b/src/thermophysicalModels/basic/basicThermo/basicThermo.H index 079ffd7d34..85ffe04467 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.H +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.H @@ -40,6 +40,7 @@ SourceFiles #include "typeInfo.H" #include "IOdictionary.H" #include "autoPtr.H" +#include "wordIOList.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -93,6 +94,7 @@ public: (mesh) ); + // Constructors //- Construct from mesh @@ -150,6 +152,12 @@ public: const word& ) const; + //- Split name of thermo package into a list of the components names + static wordList splitThermoName + ( + const word& thermoName, + const int nCmpt + ); //- Update properties virtual void correct() = 0; @@ -336,6 +344,126 @@ public: }; +template +autoPtr NewThermo +( + const fvMesh& mesh +) +{ + IOdictionary thermoDict + ( + IOobject + ( + "thermophysicalProperties", + mesh.time().constant(), + mesh, + IOobject::MUST_READ_IF_MODIFIED, + IOobject::NO_WRITE, + false + ) + ); + + word thermoTypeName; + + if (thermoDict.isDict("thermoType")) + { + const dictionary& thermoTypeDict(thermoDict.subDict("thermoType")); + + Info<< "Selecting thermodynamics package " << thermoTypeDict << endl; + + const int nCmpt = 7; + const char* cmptNames[nCmpt] = + { + "type", + "mixture", + "transport", + "thermo", + "equationOfState", + "specie", + "energy" + }; + + // Construct the name of the thermo package from the components + thermoTypeName = + word(thermoTypeDict.lookup("type")) + '<' + + word(thermoTypeDict.lookup("mixture")) + '<' + + word(thermoTypeDict.lookup("transport")) + '<' + + word(thermoTypeDict.lookup("thermo")) + '<' + + word(thermoTypeDict.lookup("equationOfState")) + '<' + + word(thermoTypeDict.lookup("specie")) + ">>," + + word(thermoTypeDict.lookup("energy")) + ">>>"; + + // Lookup the thermo package + typename Thermo::fvMeshConstructorTable::iterator cstrIter = + Thermo::fvMeshConstructorTablePtr_->find(thermoTypeName); + + // Print error message if package not found in the table + if (cstrIter == Thermo::fvMeshConstructorTablePtr_->end()) + { + FatalErrorIn(Thermo::typeName + "::New(const fvMesh&)") + << "Unknown " << Thermo::typeName << " type " << nl + << "thermoType" << thermoTypeDict << nl << nl + << "Valid " << Thermo::typeName << " types are:" << nl << nl; + + // Get the list of all the suitable thermo packages available + wordList validThermoTypeNames + ( + Thermo::fvMeshConstructorTablePtr_->sortedToc() + ); + + // Build a table of the thermo packages constituent parts + // Note: row-0 contains the names of constituent parts + List validThermoTypeNameCmpts + ( + validThermoTypeNames.size() + 1 + ); + + validThermoTypeNameCmpts[0].setSize(nCmpt); + forAll(validThermoTypeNameCmpts[0], j) + { + validThermoTypeNameCmpts[0][j] = cmptNames[j]; + } + + // Split the thermo package names into their constituent parts + forAll(validThermoTypeNames, i) + { + validThermoTypeNameCmpts[i+1] = + Thermo::splitThermoName(validThermoTypeNames[i], nCmpt); + } + + // Print the table of available packages + // in terms of their constituent parts + printTable(validThermoTypeNameCmpts, FatalError); + + FatalError<< exit(FatalError); + } + + return autoPtr(cstrIter()(mesh)); + } + else + { + thermoTypeName = word(thermoDict.lookup("thermoType")); + + Info<< "Selecting thermodynamics package " << thermoTypeName << endl; + + typename Thermo::fvMeshConstructorTable::iterator cstrIter = + Thermo::fvMeshConstructorTablePtr_->find(thermoTypeName); + + if (cstrIter == Thermo::fvMeshConstructorTablePtr_->end()) + { + FatalErrorIn(Thermo::typeName + "::New(const fvMesh&)") + << "Unknown " << Thermo::typeName << " type " + << thermoTypeName << nl << nl + << "Valid " << Thermo::typeName << " types are:" << nl + << Thermo::fvMeshConstructorTablePtr_->sortedToc() << nl + << exit(FatalError); + } + + return autoPtr(cstrIter()(mesh)); + } +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermoNew.C b/src/thermophysicalModels/basic/basicThermo/basicThermoNew.C deleted file mode 100644 index e7dda0d9d5..0000000000 --- a/src/thermophysicalModels/basic/basicThermo/basicThermoNew.C +++ /dev/null @@ -1,71 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / 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 . - -\*---------------------------------------------------------------------------*/ - -#include "basicThermo.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -Foam::autoPtr Foam::basicThermo::New -( - const fvMesh& mesh -) -{ - // get model name, but do not register the dictionary - // otherwise it is registered in the database twice - const word modelType - ( - IOdictionary - ( - IOobject - ( - "thermophysicalProperties", - mesh.time().constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false - ) - ).lookup("thermoType") - ); - - Info<< "Selecting thermodynamics package " << modelType << endl; - - fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(modelType); - - if (cstrIter == fvMeshConstructorTablePtr_->end()) - { - FatalErrorIn("basicThermo::New(const fvMesh&)") - << "Unknown basicThermo type " << modelType << nl << nl - << "Valid basicThermo types are:" << nl - << fvMeshConstructorTablePtr_->sortedToc() << nl - << exit(FatalError); - } - - return autoPtr(cstrIter()(mesh)); -} - - -// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C index e62ae73c65..b0438e6431 100644 --- a/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C +++ b/src/thermophysicalModels/basic/fluidThermo/fluidThermo.C @@ -49,6 +49,15 @@ Foam::fluidThermo::fluidThermo(const fvMesh& mesh, const dictionary& dict) {} +Foam::autoPtr Foam::fluidThermo::New +( + const fvMesh& mesh +) +{ + return NewThermo(mesh); +} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::fluidThermo::~fluidThermo() diff --git a/src/thermophysicalModels/basic/fluidThermo/fluidThermoNew.C b/src/thermophysicalModels/basic/fluidThermo/fluidThermoNew.C deleted file mode 100644 index d6977a542a..0000000000 --- a/src/thermophysicalModels/basic/fluidThermo/fluidThermoNew.C +++ /dev/null @@ -1,71 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / 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 . - -\*---------------------------------------------------------------------------*/ - -#include "fluidThermo.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -Foam::autoPtr Foam::fluidThermo::New -( - const fvMesh& mesh -) -{ - // get model name, but do not register the dictionary - // otherwise it is registered in the database twice - const word modelType - ( - IOdictionary - ( - IOobject - ( - "thermophysicalProperties", - mesh.time().constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false - ) - ).lookup("thermoType") - ); - - Info<< "Selecting thermodynamics package " << modelType << endl; - - fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(modelType); - - if (cstrIter == fvMeshConstructorTablePtr_->end()) - { - FatalErrorIn("fluidThermo::New(const fvMesh&)") - << "Unknown fluidThermo type " << modelType << nl << nl - << "Valid fluidThermo types are:" << nl - << fvMeshConstructorTablePtr_->sortedToc() << nl - << exit(FatalError); - } - - return autoPtr(cstrIter()(mesh)); -} - - -// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.C b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.C index 8fa95c5bbf..02d65d7a27 100644 --- a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.C +++ b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.C @@ -24,29 +24,12 @@ License \*---------------------------------------------------------------------------*/ #include "basicMixture.H" -#include "fvMesh.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(basicMixture, 0); - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -basicMixture::basicMixture(const dictionary&, const fvMesh&) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -basicMixture::~basicMixture() -{} - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam diff --git a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.H b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.H index f918d99d7b..8d8ed84cb0 100644 --- a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.H +++ b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixture.H @@ -35,8 +35,6 @@ SourceFiles #ifndef basicMixture_H #define basicMixture_H -#include "typeInfo.H" - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam @@ -58,18 +56,11 @@ public: typedef basicMixture basicMixtureType; - // Runtime type information - TypeName("basicMixture"); - - // Constructors //- Construct from dictionary and mesh - basicMixture(const dictionary&, const fvMesh&); - - - //- Destructor - virtual ~basicMixture(); + basicMixture(const dictionary&, const fvMesh&) + {} }; diff --git a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C b/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C deleted file mode 100644 index ac7d3c65bd..0000000000 --- a/src/thermophysicalModels/basic/mixtures/basicMixture/basicMixtures.C +++ /dev/null @@ -1,253 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-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 . - -Description - Mixture instantiation - -\*---------------------------------------------------------------------------*/ - -#include "error.H" - -#include "basicMixture.H" -#include "makeBasicMixture.H" - -#include "specie.H" -#include "perfectGas.H" -#include "rhoConst.H" -#include "incompressiblePerfectGas.H" - -#include "eConstThermo.H" - -#include "hConstThermo.H" -#include "janafThermo.H" -#include "sensibleInternalEnergy.H" -#include "sensibleEnthalpy.H" -#include "thermo.H" - -#include "constTransport.H" -#include "sutherlandTransport.H" - -#include "icoPolynomial.H" -#include "hPolynomialThermo.H" -#include "polynomialTransport.H" - -#include "pureMixture.H" - -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ - -/* * * * * * * * * * * * * * * private static data * * * * * * * * * * * * * */ - -makeBasicMixture -( - pureMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - perfectGas, - specie -); - -makeBasicMixture -( - pureMixture, - sutherlandTransport, - sensibleEnthalpy, - hConstThermo, - perfectGas, - specie -); - -makeBasicMixture -( - pureMixture, - sutherlandTransport, - sensibleEnthalpy, - janafThermo, - perfectGas, - specie -); - -makeBasicMixture -( - pureMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - rhoConst, - specie -); - -makeBasicMixture -( - pureMixture, - polynomialTransport, - sensibleEnthalpy, - hPolynomialThermo, - icoPolynomial, - specie -); - -makeBasicMixture -( - pureMixture, - constTransport, - sensibleEnthalpy, - hConstThermo, - incompressiblePerfectGas, - specie -); - -makeBasicMixture -( - pureMixture, - sutherlandTransport, - sensibleEnthalpy, - hConstThermo, - incompressiblePerfectGas, - specie -); - -makeBasicMixture -( - pureMixture, - sutherlandTransport, - sensibleEnthalpy, - janafThermo, - incompressiblePerfectGas, - specie -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -makeBasicMixture -( - pureMixture, - constTransport, - sensibleInternalEnergy, - eConstThermo, - perfectGas, - specie -); - -makeBasicMixture -( - pureMixture, - sutherlandTransport, - sensibleInternalEnergy, - eConstThermo, - perfectGas, - specie -); - -makeBasicMixture -( - pureMixture, - constTransport, - sensibleInternalEnergy, - hConstThermo, - perfectGas, - specie -); - -makeBasicMixture -( - pureMixture, - sutherlandTransport, - sensibleInternalEnergy, - hConstThermo, - perfectGas, - specie -); - -makeBasicMixture -( - pureMixture, - sutherlandTransport, - sensibleInternalEnergy, - janafThermo, - perfectGas, - specie -); - -makeBasicMixture -( - pureMixture, - constTransport, - sensibleInternalEnergy, - hConstThermo, - rhoConst, - specie -); - -makeBasicMixture -( - pureMixture, - polynomialTransport, - sensibleInternalEnergy, - hPolynomialThermo, - icoPolynomial, - specie -); - -makeBasicMixture -( - pureMixture, - constTransport, - sensibleInternalEnergy, - hConstThermo, - incompressiblePerfectGas, - specie -); - -makeBasicMixture -( - pureMixture, - sutherlandTransport, - sensibleInternalEnergy, - hConstThermo, - incompressiblePerfectGas, - specie -); - -makeBasicMixture -( - pureMixture, - sutherlandTransport, - sensibleInternalEnergy, - janafThermo, - incompressiblePerfectGas, - specie -); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/mixtures/basicMixture/makeBasicMixture.H b/src/thermophysicalModels/basic/mixtures/basicMixture/makeBasicMixture.H deleted file mode 100644 index 29e93165a2..0000000000 --- a/src/thermophysicalModels/basic/mixtures/basicMixture/makeBasicMixture.H +++ /dev/null @@ -1,54 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-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 . - -InClass - Foam::basicMixture - -Description - Macros for creating 'basic' mixtures for basic fluid thermo packages - -\*---------------------------------------------------------------------------*/ - -#ifndef makeBasicMixture_H -#define makeBasicMixture_H - -#include "basicMixture.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define makeBasicMixture(Mixture,Transport,Type,Thermo,EqnOfState,Specie) \ - \ -typedef \ - Mixture >, Type> > > \ - Mixture##Transport##Type##Thermo##EqnOfState##Specie; \ - \ -defineTemplateTypeNameAndDebugWithName \ - (Mixture##Transport##Type##Thermo##EqnOfState##Specie, \ - #Mixture"<"#Transport"<"#Thermo"<"#EqnOfState"<"#Specie">>,"#Type">>", 0) - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/mixtures/pureMixture/pureMixture.C b/src/thermophysicalModels/basic/mixtures/pureMixture/pureMixture.C index 02d5ddafc5..bfd8ed2a8f 100644 --- a/src/thermophysicalModels/basic/mixtures/pureMixture/pureMixture.C +++ b/src/thermophysicalModels/basic/mixtures/pureMixture/pureMixture.C @@ -45,13 +45,6 @@ pureMixture::pureMixture {} -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -template -pureMixture::~pureMixture() -{} - - // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template diff --git a/src/thermophysicalModels/basic/mixtures/pureMixture/pureMixture.H b/src/thermophysicalModels/basic/mixtures/pureMixture/pureMixture.H index 5ed25b97f4..b2401e1123 100644 --- a/src/thermophysicalModels/basic/mixtures/pureMixture/pureMixture.H +++ b/src/thermophysicalModels/basic/mixtures/pureMixture/pureMixture.H @@ -65,20 +65,12 @@ public: typedef ThermoType thermoType; - //- Runtime type information - TypeName("pureMixture"); - - // Constructors //- Construct from dictionary and mesh pureMixture(const dictionary&, const fvMesh&); - //- Destructor - virtual ~pureMixture(); - - // Member functions const ThermoType& cellMixture(const label) const diff --git a/src/thermophysicalModels/basic/psiThermo/psiThermo/psiThermo.C b/src/thermophysicalModels/basic/psiThermo/psiThermo/psiThermo.C index 134103106e..e9a6a2219e 100644 --- a/src/thermophysicalModels/basic/psiThermo/psiThermo/psiThermo.C +++ b/src/thermophysicalModels/basic/psiThermo/psiThermo/psiThermo.C @@ -70,6 +70,15 @@ Foam::psiThermo::psiThermo(const fvMesh& mesh) {} +Foam::autoPtr Foam::psiThermo::New +( + const fvMesh& mesh +) +{ + return NewThermo(mesh); +} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::psiThermo::~psiThermo() diff --git a/src/thermophysicalModels/basic/psiThermo/psiThermo/psiThermoNew.C b/src/thermophysicalModels/basic/psiThermo/psiThermo/psiThermoNew.C deleted file mode 100644 index d0601fe15c..0000000000 --- a/src/thermophysicalModels/basic/psiThermo/psiThermo/psiThermoNew.C +++ /dev/null @@ -1,94 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-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 . - -\*---------------------------------------------------------------------------*/ - -#include "psiThermo.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -Foam::autoPtr Foam::psiThermo::New -( - const fvMesh& mesh -) -{ - IOdictionary thermoDict - ( - IOobject - ( - "thermophysicalProperties", - mesh.time().constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false - ) - ); - - word thermoTypeName; - - if (thermoDict.isDict("thermoType")) - { - const dictionary& thermoTypeDict(thermoDict.subDict("thermoType")); - - word type(thermoTypeDict.lookup("type")); - word mixture(thermoTypeDict.lookup("mixture")); - word transport(thermoTypeDict.lookup("transport")); - word thermo(thermoTypeDict.lookup("thermo")); - word energy(thermoTypeDict.lookup("energy")); - word equationOfState(thermoTypeDict.lookup("equationOfState")); - word specie(thermoTypeDict.lookup("specie")); - - thermoTypeName = - type + '<' - + mixture + '<' - + transport + '<' - + thermo + '<' - + equationOfState + '<' - + specie + ">>," - + energy + ">>>"; - } - else - { - thermoTypeName = word(thermoDict.lookup("thermoType")); - } - - Info<< "Selecting thermodynamics package " << thermoTypeName << endl; - - fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(thermoTypeName); - - if (cstrIter == fvMeshConstructorTablePtr_->end()) - { - FatalErrorIn("psiThermo::New(const fvMesh&)") - << "Unknown psiThermo type " << thermoTypeName << nl << nl - << "Valid psiThermo types are:" << nl - << fvMeshConstructorTablePtr_->sortedToc() << nl - << exit(FatalError); - } - - return autoPtr(cstrIter()(mesh)); -} - - -// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/rhoThermo/rhoThermo/rhoThermo.C b/src/thermophysicalModels/basic/rhoThermo/rhoThermo/rhoThermo.C index a43347cb91..ababc128c2 100644 --- a/src/thermophysicalModels/basic/rhoThermo/rhoThermo/rhoThermo.C +++ b/src/thermophysicalModels/basic/rhoThermo/rhoThermo/rhoThermo.C @@ -130,6 +130,15 @@ Foam::rhoThermo::rhoThermo(const fvMesh& mesh, const dictionary& dict) {} +Foam::autoPtr Foam::rhoThermo::New +( + const fvMesh& mesh +) +{ + return NewThermo(mesh); +} + + // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // Foam::rhoThermo::~rhoThermo() diff --git a/src/thermophysicalModels/basic/rhoThermo/rhoThermo/rhoThermoNew.C b/src/thermophysicalModels/basic/rhoThermo/rhoThermo/rhoThermoNew.C deleted file mode 100644 index cf46160a58..0000000000 --- a/src/thermophysicalModels/basic/rhoThermo/rhoThermo/rhoThermoNew.C +++ /dev/null @@ -1,72 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2011-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 . - -\*---------------------------------------------------------------------------*/ - -#include "rhoThermo.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -Foam::autoPtr Foam::rhoThermo::New -( - const fvMesh& mesh -) -{ - // get model name, but do not register the dictionary - // otherwise it is registered in the database twice - const word modelType - ( - IOdictionary - ( - IOobject - ( - "thermophysicalProperties", - mesh.time().constant(), - mesh, - IOobject::MUST_READ_IF_MODIFIED, - IOobject::NO_WRITE, - false - ) - ).lookup("thermoType") - ); - - Info<< "Selecting thermodynamics package " << modelType << endl; - - fvMeshConstructorTable::iterator cstrIter = - fvMeshConstructorTablePtr_->find(modelType); - - if (cstrIter == fvMeshConstructorTablePtr_->end()) - { - FatalErrorIn("rhoThermo::New(const fvMesh&)") - << "Unknown rhoThermo type " - << modelType << nl << nl - << "Valid rhoThermo types are:" << nl - << fvMeshConstructorTablePtr_->sortedToc() << nl - << exit(FatalError); - } - - return autoPtr(cstrIter()(mesh)); -} - - -// ************************************************************************* //