diff --git a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C index f0487ac2a2a5c5c9b62ff39ba8168c93a1615099..6531073136cec0d02abf3898e681223370e16637 100644 --- a/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.C +++ b/applications/utilities/postProcessing/miscellaneous/execFlowFunctionObjects/execFlowFunctionObjects.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) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,7 +47,7 @@ Description #include "incompressible/RAS/RASModel/RASModel.H" #include "incompressible/LES/LESModel/LESModel.H" -#include "basicPsiThermo.H" +#include "basicThermo.H" #include "compressible/RAS/RASModel/RASModel.H" #include "compressible/LES/LESModel/LESModel.H" @@ -265,7 +265,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) } else if (phi.dimensions() == dimensionSet(1, 0, -1, 0, 0)) { - autoPtr<basicPsiThermo> thermo(basicPsiThermo::New(mesh)); + autoPtr<basicThermo> thermo(basicThermo::New(mesh)); volScalarField rho ( diff --git a/applications/utilities/postProcessing/velocityField/Mach/Mach.C b/applications/utilities/postProcessing/velocityField/Mach/Mach.C index 2233465bfe98b9fb070661d5aa2163aed31f452b..3463175d7725ab445f191ed7c0d736a8215dd4fa 100644 --- a/applications/utilities/postProcessing/velocityField/Mach/Mach.C +++ b/applications/utilities/postProcessing/velocityField/Mach/Mach.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) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -33,9 +33,10 @@ Description \*---------------------------------------------------------------------------*/ #include "calc.H" -#include "basicPsiThermo.H" +#include "basicThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) { bool writeResults = !args.optionFound("noWrite"); @@ -74,9 +75,9 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) ) { // thermophysical Mach - autoPtr<basicPsiThermo> thermo + autoPtr<basicThermo> thermo ( - basicPsiThermo::New(mesh) + basicThermo::New(mesh) ); volScalarField Cp(thermo->Cp()); diff --git a/applications/utilities/postProcessing/velocityField/Mach/thermophysicalMach.H b/applications/utilities/postProcessing/velocityField/Mach/thermophysicalMach.H index 7283802f7790a6c0cf209195a9273e51697fc017..4e4ea81b3d87463b4c8d91fb115e0ea465e4b41b 100644 --- a/applications/utilities/postProcessing/velocityField/Mach/thermophysicalMach.H +++ b/applications/utilities/postProcessing/velocityField/Mach/thermophysicalMach.H @@ -18,9 +18,9 @@ { volVectorField U(Uheader, mesh); - autoPtr<basicPsiThermo> thermo + autoPtr<basicThermo> thermo ( - basicPsiThermo::New(mesh) + basicThermo::New(mesh) ); volScalarField Cp = thermo->Cp(); diff --git a/applications/utilities/postProcessing/velocityField/Pe/Pe.C b/applications/utilities/postProcessing/velocityField/Pe/Pe.C index c77c0cee056cda1e1e06ab8415ebd63ad118676b..c262482ce734e742ab063b8ac4b3463c832934b8 100644 --- a/applications/utilities/postProcessing/velocityField/Pe/Pe.C +++ b/applications/utilities/postProcessing/velocityField/Pe/Pe.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) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,7 +39,7 @@ Description #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" #include "incompressible/RAS/RASModel/RASModel.H" #include "incompressible/LES/LESModel/LESModel.H" -#include "basicPsiThermo.H" +#include "basicThermo.H" #include "compressible/RAS/RASModel/RASModel.H" #include "compressible/LES/LESModel/LESModel.H" @@ -204,7 +204,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) { IOdictionary RASProperties(RASPropertiesHeader); - autoPtr<basicPsiThermo> thermo(basicPsiThermo::New(mesh)); + autoPtr<basicThermo> thermo(basicThermo::New(mesh)); volScalarField rho ( @@ -252,7 +252,7 @@ void Foam::calc(const argList& args, const Time& runTime, const fvMesh& mesh) { IOdictionary LESProperties(LESPropertiesHeader); - autoPtr<basicPsiThermo> thermo(basicPsiThermo::New(mesh)); + autoPtr<basicThermo> thermo(basicThermo::New(mesh)); volScalarField rho ( diff --git a/applications/utilities/postProcessing/wall/wallHeatFlux/createFields.H b/applications/utilities/postProcessing/wall/wallHeatFlux/createFields.H index 609d4c3776006ef5be5295695fbcce84cf8a2ca7..d4f142d54523aa937da214a2f8dfc623fd80422c 100644 --- a/applications/utilities/postProcessing/wall/wallHeatFlux/createFields.H +++ b/applications/utilities/postProcessing/wall/wallHeatFlux/createFields.H @@ -1,6 +1,6 @@ -autoPtr<basicPsiThermo> thermo +autoPtr<basicThermo> thermo ( - basicPsiThermo::New(mesh) + basicThermo::New(mesh) ); const volScalarField& h = thermo->h(); diff --git a/applications/utilities/postProcessing/wall/wallHeatFlux/wallHeatFlux.C b/applications/utilities/postProcessing/wall/wallHeatFlux/wallHeatFlux.C index 070869ce28e93fa995d493afdc475613af847e75..2789b52f83d7d96655ac1fb30732b4693b0ca75d 100644 --- a/applications/utilities/postProcessing/wall/wallHeatFlux/wallHeatFlux.C +++ b/applications/utilities/postProcessing/wall/wallHeatFlux/wallHeatFlux.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) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -41,10 +41,11 @@ Description int main(int argc, char *argv[]) { timeSelector::addOptions(); +# include "addRegionOption.H" #include "setRootCase.H" #include "createTime.H" instantList timeDirs = timeSelector::select0(runTime, args); - #include "createMesh.H" + #include "createNamedMesh.H" forAll(timeDirs, timeI) { @@ -69,7 +70,7 @@ int main(int argc, char *argv[]) { Info<< mesh.boundary()[patchi].name() << " " - << sum + << gSum ( mesh.magSf().boundaryField()[patchi] *patchHeatFlux[patchi] diff --git a/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C b/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C index 6069837b9513d27ca51c72792ffde69f3eec68a4..83a1e57f42dccc7b522af52ac22430dd3be18830 100644 --- a/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.C +++ b/applications/utilities/postProcessing/wall/wallShearStress/wallShearStress.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) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -38,7 +38,7 @@ Description #include "incompressible/singlePhaseTransportModel/singlePhaseTransportModel.H" #include "incompressible/RAS/RASModel/RASModel.H" -#include "basicPsiThermo.H" +#include "basicThermo.H" #include "compressible/RAS/RASModel/RASModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -101,11 +101,8 @@ void calcCompressible #include "compressibleCreatePhi.H" - autoPtr<basicPsiThermo> pThermo - ( - basicPsiThermo::New(mesh) - ); - basicPsiThermo& thermo = pThermo(); + autoPtr<basicThermo> pThermo(basicThermo::New(mesh)); + basicThermo& thermo = pThermo(); autoPtr<compressible::RASModel> model ( diff --git a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C index 359c3bcb4fa7ddec8b5af27d19d10c95902c4c4e..c8de884de96c61ff6ba1571fecd27f6ebfe60746 100644 --- a/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.C +++ b/applications/utilities/postProcessing/wall/yPlusRAS/yPlusRAS.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) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,7 +39,7 @@ Description #include "incompressible/RAS/RASModel/RASModel.H" #include "nutkWallFunction/nutkWallFunctionFvPatchScalarField.H" -#include "basicPsiThermo.H" +#include "basicThermo.H" #include "compressible/RAS/RASModel/RASModel.H" #include "mutkWallFunction/mutkWallFunctionFvPatchScalarField.H" @@ -130,11 +130,11 @@ void calcCompressibleYPlus #include "compressibleCreatePhi.H" - autoPtr<basicPsiThermo> pThermo + autoPtr<basicThermo> pThermo ( - basicPsiThermo::New(mesh) + basicThermo::New(mesh) ); - basicPsiThermo& thermo = pThermo(); + basicThermo& thermo = pThermo(); autoPtr<compressible::RASModel> RASModel ( diff --git a/src/thermophysicalModels/basic/Make/files b/src/thermophysicalModels/basic/Make/files index 1a9d82af062507e937dcaa3fe2c4d3633f60dd97..1c08f455dfd1f1231e23ddf8d4b1835b2cec8fb9 100644 --- a/src/thermophysicalModels/basic/Make/files +++ b/src/thermophysicalModels/basic/Make/files @@ -2,6 +2,7 @@ mixtures/basicMixture/basicMixture.C mixtures/basicMixture/basicMixtures.C basicThermo/basicThermo.C +basicThermo/basicThermoNew.C psiThermo/basicPsiThermo/basicPsiThermo.C psiThermo/basicPsiThermo/basicPsiThermoNew.C diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.C b/src/thermophysicalModels/basic/basicThermo/basicThermo.C index 7b0d81aea78eb41e44baba35b885f283a451212f..ad40123d6eed02483f6c60a456757caace07808b 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.C +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.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) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,6 +39,7 @@ License namespace Foam { defineTypeNameAndDebug(basicThermo, 0); + defineRunTimeSelectionTable(basicThermo, fvMesh); } // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermo.H b/src/thermophysicalModels/basic/basicThermo/basicThermo.H index aa331ded7e1a86f57e98ca4b17757c91af04d9eb..0bb67f8b49557e891f55791f29ccd4c7f7031f9d 100644 --- a/src/thermophysicalModels/basic/basicThermo/basicThermo.H +++ b/src/thermophysicalModels/basic/basicThermo/basicThermo.H @@ -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) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,7 +29,7 @@ Description SourceFiles basicThermo.C - newBasicThermo.C + basicThermoNew.C \*---------------------------------------------------------------------------*/ @@ -109,12 +109,25 @@ public: TypeName("basicThermo"); + //- Declare run-time constructor selection table + declareRunTimeSelectionTable + ( + autoPtr, + basicThermo, + fvMesh, + (const fvMesh& mesh), + (mesh) + ); + // Constructors //- Construct from mesh basicThermo(const fvMesh&); + //- Selector + static autoPtr<basicThermo> New(const fvMesh&); + //- Destructor virtual ~basicThermo(); diff --git a/src/thermophysicalModels/basic/basicThermo/basicThermoNew.C b/src/thermophysicalModels/basic/basicThermo/basicThermoNew.C new file mode 100644 index 0000000000000000000000000000000000000000..e7dda0d9d548d8543a47f6346c02de0895bdbacb --- /dev/null +++ b/src/thermophysicalModels/basic/basicThermo/basicThermoNew.C @@ -0,0 +1,71 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / 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 "basicThermo.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +Foam::autoPtr<Foam::basicThermo> 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<basicThermo>(cstrIter()(mesh)); +} + + +// ************************************************************************* // diff --git a/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/makeBasicPsiThermo.H b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/makeBasicPsiThermo.H index 890b5f2b90f197863c5ecc793c067a831eca7d5d..d9322918d59a9f76e9050e2ce68376015f2852b4 100644 --- a/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/makeBasicPsiThermo.H +++ b/src/thermophysicalModels/basic/psiThermo/basicPsiThermo/makeBasicPsiThermo.H @@ -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) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,7 +55,14 @@ addToRunTimeSelectionTable \ basicPsiThermo, \ Cthermo##Mixture##Transport##Thermo##EqnOfState, \ fvMesh \ -) +); \ + \ +addToRunTimeSelectionTable \ +( \ + basicThermo, \ + Cthermo##Mixture##Transport##Thermo##EqnOfState, \ + fvMesh \ +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/makeBasicRhoThermo.H b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/makeBasicRhoThermo.H index 3edfa3a69c03407913421cd850d4bbadaf6f7cf8..e7a4de187e1272083c4f07eb27ce7d3e4a9fc63d 100644 --- a/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/makeBasicRhoThermo.H +++ b/src/thermophysicalModels/basic/rhoThermo/basicRhoThermo/makeBasicRhoThermo.H @@ -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) 2012 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -55,7 +55,14 @@ addToRunTimeSelectionTable \ basicRhoThermo, \ Cthermo##Mixture##Transport##Thermo##EqnOfState, \ fvMesh \ -) +); \ + \ +addToRunTimeSelectionTable \ +( \ + basicThermo, \ + Cthermo##Mixture##Transport##Thermo##EqnOfState, \ + fvMesh \ +); #define makeBasicRhoPolyThermo(Cthermo,Mixture,Order) \ @@ -88,7 +95,14 @@ addToRunTimeSelectionTable \ basicRhoThermo, \ Cthermo##Mixture##icoPoly##Order##ThermoPhysics, \ fvMesh \ -) +); \ + \ +addToRunTimeSelectionTable \ +( \ + basicThermo, \ + Cthermo##Mixture##icoPoly##Order##ThermoPhysics, \ + fvMesh \ +); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //