From 72ad8d5cc4abf24ad6922aa4e8e3a02a4735973a Mon Sep 17 00:00:00 2001 From: andy Date: Fri, 27 Aug 2010 13:31:12 +0100 Subject: [PATCH 01/29] BUG: removed todo items form headers - show up in doxygen --- src/OpenFOAM/db/dictionary/dictionary.H | 3 +-- src/mesh/blockMesh/curvedEdges/BSpline.H | 5 ++--- src/mesh/blockMesh/curvedEdges/CatmullRomSpline.H | 5 ++--- src/mesh/blockMesh/curvedEdges/polyLine.H | 1 - 4 files changed, 5 insertions(+), 9 deletions(-) diff --git a/src/OpenFOAM/db/dictionary/dictionary.H b/src/OpenFOAM/db/dictionary/dictionary.H index 7457d1e31f..bb5f186aad 100644 --- a/src/OpenFOAM/db/dictionary/dictionary.H +++ b/src/OpenFOAM/db/dictionary/dictionary.H @@ -38,8 +38,7 @@ Description dictionaries since, unlike the IOdictionary class, it does not use an objectRegistry itself to work. -ToDo - A merge() member function with a non-const dictionary parameter. + To add - a merge() member function with a non-const dictionary parameter? This would avoid unnecessary cloning in the add(entry*, bool) method. SourceFiles diff --git a/src/mesh/blockMesh/curvedEdges/BSpline.H b/src/mesh/blockMesh/curvedEdges/BSpline.H index 122d6e8a8c..93a8e75b43 100644 --- a/src/mesh/blockMesh/curvedEdges/BSpline.H +++ b/src/mesh/blockMesh/curvedEdges/BSpline.H @@ -47,12 +47,11 @@ Description segments. In rare cases (sections with very high curvatures), the resulting distribution may be sub-optimal. + A future implementation could also handle closed splines. + SeeAlso CatmullRomSpline -ToDo - A future implementation could also handle closed splines. - SourceFiles BSpline.C diff --git a/src/mesh/blockMesh/curvedEdges/CatmullRomSpline.H b/src/mesh/blockMesh/curvedEdges/CatmullRomSpline.H index 3726346f0f..b3ac25bc54 100644 --- a/src/mesh/blockMesh/curvedEdges/CatmullRomSpline.H +++ b/src/mesh/blockMesh/curvedEdges/CatmullRomSpline.H @@ -48,13 +48,12 @@ Description segments. In rare cases (sections with very high curvatures), the resulting distribution may be sub-optimal. + A future implementation could also handle closed splines. + SeeAlso http://www.algorithmist.net/catmullrom.html provides a nice introduction -ToDo - A future implementation could also handle closed splines. - SourceFiles CatmullRomSpline.C diff --git a/src/mesh/blockMesh/curvedEdges/polyLine.H b/src/mesh/blockMesh/curvedEdges/polyLine.H index 4014939e97..f44e61faf6 100644 --- a/src/mesh/blockMesh/curvedEdges/polyLine.H +++ b/src/mesh/blockMesh/curvedEdges/polyLine.H @@ -28,7 +28,6 @@ Description A series of straight line segments, which can also be interpreted as a series of control points for splines, etc. -ToDo A future implementation could also handle a closed polyLine. SourceFiles From 35354bab8dd65da9b5906cceafbe2329dba158a9 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 31 Aug 2010 10:02:13 +0100 Subject: [PATCH 02/29] BUG: Removed execution bits from tutorial input files --- tutorials/combustion/fireFoam/les/smallPoolFire2D/0/T | 0 tutorials/combustion/fireFoam/les/smallPoolFire2D/0/U | 0 tutorials/combustion/fireFoam/les/smallPoolFire2D/0/alphaSgs | 0 tutorials/combustion/fireFoam/les/smallPoolFire2D/0/b | 0 tutorials/combustion/fireFoam/les/smallPoolFire2D/0/ft | 0 tutorials/combustion/fireFoam/les/smallPoolFire2D/0/fu | 0 tutorials/combustion/fireFoam/les/smallPoolFire2D/0/k | 0 tutorials/combustion/fireFoam/les/smallPoolFire2D/0/muSgs | 0 tutorials/combustion/fireFoam/les/smallPoolFire2D/0/p | 0 .../parcelInBox/constant/polyMesh/boundary | 0 10 files changed, 0 insertions(+), 0 deletions(-) mode change 100755 => 100644 tutorials/combustion/fireFoam/les/smallPoolFire2D/0/T mode change 100755 => 100644 tutorials/combustion/fireFoam/les/smallPoolFire2D/0/U mode change 100755 => 100644 tutorials/combustion/fireFoam/les/smallPoolFire2D/0/alphaSgs mode change 100755 => 100644 tutorials/combustion/fireFoam/les/smallPoolFire2D/0/b mode change 100755 => 100644 tutorials/combustion/fireFoam/les/smallPoolFire2D/0/ft mode change 100755 => 100644 tutorials/combustion/fireFoam/les/smallPoolFire2D/0/fu mode change 100755 => 100644 tutorials/combustion/fireFoam/les/smallPoolFire2D/0/k mode change 100755 => 100644 tutorials/combustion/fireFoam/les/smallPoolFire2D/0/muSgs mode change 100755 => 100644 tutorials/combustion/fireFoam/les/smallPoolFire2D/0/p mode change 100755 => 100644 tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/constant/polyMesh/boundary diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/T b/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/T old mode 100755 new mode 100644 diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/U b/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/U old mode 100755 new mode 100644 diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/alphaSgs b/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/alphaSgs old mode 100755 new mode 100644 diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/b b/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/b old mode 100755 new mode 100644 diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/ft b/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/ft old mode 100755 new mode 100644 diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/fu b/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/fu old mode 100755 new mode 100644 diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/k b/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/k old mode 100755 new mode 100644 diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/muSgs b/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/muSgs old mode 100755 new mode 100644 diff --git a/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/p b/tutorials/combustion/fireFoam/les/smallPoolFire2D/0/p old mode 100755 new mode 100644 diff --git a/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/constant/polyMesh/boundary b/tutorials/lagrangian/porousExplicitSourceReactingParcelFoam/parcelInBox/constant/polyMesh/boundary old mode 100755 new mode 100644 From 251a557d86402f8580a864cd155fd81658e9709c Mon Sep 17 00:00:00 2001 From: andy Date: Thu, 2 Sep 2010 12:39:34 +0100 Subject: [PATCH 03/29] ENH: Using local calcYPlusLam function instead of turbulence model version --- .../mutkRoughWallFunctionFvPatchScalarField.C | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C index ee7ba7ef80..d5e91dac83 100644 --- a/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C +++ b/src/turbulenceModels/compressible/RAS/derivedFvPatchFields/wallFunctions/mutWallFunctions/mutkRoughWallFunction/mutkRoughWallFunctionFvPatchScalarField.C @@ -94,7 +94,7 @@ tmp mutkRoughWallFunctionFvPatchScalarField::calcMut() const if (KsPlus > 2.25) { Edash /= fnRough(KsPlus, Cs_[faceI]); - yPlusLamNew = rasModel.yPlusLam(kappa_, Edash); + yPlusLamNew = calcYPlusLam(kappa_, Edash); } if (debug) From 470ef283a13386bcb6b3fdb89261914f1b37fd56 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 6 Sep 2010 11:42:55 +0100 Subject: [PATCH 04/29] ENH: Added SLGThermo class - container for solid, liquid and gas thermos --- src/thermophysicalModels/SLGThermo/Make/files | 3 + .../SLGThermo/Make/options | 12 + .../SLGThermo/SLGThermo/SLGThermo.C | 248 ++++++++++++++++++ .../SLGThermo/SLGThermo/SLGThermo.H | 160 +++++++++++ 4 files changed, 423 insertions(+) create mode 100644 src/thermophysicalModels/SLGThermo/Make/files create mode 100644 src/thermophysicalModels/SLGThermo/Make/options create mode 100644 src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C create mode 100644 src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.H diff --git a/src/thermophysicalModels/SLGThermo/Make/files b/src/thermophysicalModels/SLGThermo/Make/files new file mode 100644 index 0000000000..0549b92c68 --- /dev/null +++ b/src/thermophysicalModels/SLGThermo/Make/files @@ -0,0 +1,3 @@ +SLGThermo/SLGThermo.C + +LIB = $(FOAM_LIBBIN)/libSLGThermo diff --git a/src/thermophysicalModels/SLGThermo/Make/options b/src/thermophysicalModels/SLGThermo/Make/options new file mode 100644 index 0000000000..4a54dad0d4 --- /dev/null +++ b/src/thermophysicalModels/SLGThermo/Make/options @@ -0,0 +1,12 @@ +EXE_INC = \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude + +LIB_LIBS = \ + -lfiniteVolume diff --git a/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C b/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C new file mode 100644 index 0000000000..468b870d86 --- /dev/null +++ b/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C @@ -0,0 +1,248 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +\*---------------------------------------------------------------------------*/ + +#include "SLGThermo.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + defineTypeNameAndDebug(SLGThermo, 0); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::SLGThermo::SLGThermo(const fvMesh& mesh, basicThermo& thermo) +: + MeshObject(mesh), + thermo_(thermo), + carrier_(NULL), + liquids_(NULL), + solids_(NULL) +{ + Info<< "Creating component thermo properties:" << endl; + + if (isA(thermo)) + { + basicMultiComponentMixtureNew& mcThermo = + dynamic_cast(thermo); + carrier_ = &mcThermo; + + Info<< " multi-component carrier - " << mcThermo.species().size() + << " species" << endl; + } + else + { + Info<< " single component carrier" << endl; + } + + if (thermo.found("liquids")) + { + liquids_ = liquidMixture::New(thermo.subDict("liquids")); + Info<< " liquids - " << liquids_->components().size() + << " components" << endl; + } + else + { + Info<< " no liquid components" << endl; + } + + if (thermo.found("solids")) + { + solids_ = solidMixture::New(thermo.subDict("solids")); + Info<< " solids - " << solids_->components().size() + << " components" << endl; + } + else + { + Info<< " no solid components" << endl; + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::SLGThermo::~SLGThermo() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +const Foam::basicThermo& Foam::SLGThermo::thermo() const +{ + return thermo_; +} + + +const Foam::basicMultiComponentMixtureNew& Foam::SLGThermo::carrier() const +{ + if (carrier_ == NULL) + { + FatalErrorIn + ( + "const Foam::basicMultiComponentMixtureNew& " + "Foam::SLGThermo::carrier() const" + ) << "carrier requested, but object is not allocated" + << abort(FatalError); + } + + return *carrier_; +} + + +const Foam::liquidMixture& Foam::SLGThermo::liquids() const +{ + if (!liquids_.valid()) + { + FatalErrorIn + ( + "const Foam::liquidMixture& Foam::SLGThermo::liquids() const" + ) << "liquids requested, but object is not allocated" + << abort(FatalError); + } + + return liquids_(); +} + + +const Foam::solidMixture& Foam::SLGThermo::solids() const +{ + if (!solids_.valid()) + { + FatalErrorIn + ( + "const Foam::solidMixture& Foam::SLGThermo::solids() const" + ) << "solids requested, but object is not allocated" + << abort(FatalError); + } + + return solids_(); +} + + +Foam::label Foam::SLGThermo::carrierId +( + const word& cmptName, + bool allowNotfound +) const +{ + forAll(carrier().species(), i) + { + if (cmptName == carrier_->species()[i]) + { + return i; + } + } + + if (!allowNotfound) + { + FatalErrorIn + ( + "Foam::label Foam::SLGThermo::carrierId(const word&, bool) const" + ) << "Unknown carrier component " << cmptName + << ". Valid carrier components are:" << nl + << carrier_->species() << exit(FatalError); + } + + return -1; +} + + +Foam::label Foam::SLGThermo::liquidId +( + const word& cmptName, + bool allowNotfound +) const +{ + forAll(liquids().components(), i) + { + if (cmptName == liquids_->components()[i]) + { + return i; + } + } + + if (!allowNotfound) + { + FatalErrorIn + ( + "Foam::label Foam::SLGThermo::liquidId(const word&, bool) const" + ) << "Unknown liquid component " << cmptName << ". Valid liquids are:" + << nl << liquids_->components() << exit(FatalError); + } + + return -1; +} + + +Foam::label Foam::SLGThermo::solidId +( + const word& cmptName, + bool allowNotfound +) const +{ + forAll(solids().components(), i) + { + if (cmptName == solids_->components()[i]) + { + return i; + } + } + + if (!allowNotfound) + { + FatalErrorIn + ( + "Foam::label Foam::SLGThermo::solidId(const word&, bool) const" + ) << "Unknown solid component " << cmptName << ". Valid solids are:" + << nl << solids_->components() << exit(FatalError); + } + + return -1; +} + + +bool Foam::SLGThermo::hasMultiComponentCarrier() const +{ + return (carrier_ != NULL); +} + + +bool Foam::SLGThermo::hasLiquids() const +{ + return liquids_.valid(); +} + + +bool Foam::SLGThermo::hasSolids() const +{ + return solids_.valid(); +} + + +// ************************************************************************* // + diff --git a/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.H b/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.H new file mode 100644 index 0000000000..91989a0123 --- /dev/null +++ b/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.H @@ -0,0 +1,160 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 2 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, write to the Free Software Foundation, + Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA + +Class + Foam::SLGThermo + +Description + Thermo package for (S)olids (L)iquids and (G)ases + Takes reference to thermo package, and provides: + - carrier : components of thermo - access to elemental properties + - liquids : liquid components - access to elemental properties + - solids : solid components - access to elemental properties + + If thermo is not a multi-component thermo package, carrier is NULL. + Similarly, if no liquids or solids are specified, their respective + pointers will also be NULL. + + Registered to the mesh so that it can be looked-up + +SourceFiles + SLGThermo.C + +\*---------------------------------------------------------------------------*/ + +#ifndef SLGThermo_H +#define SLGThermo_H + +#include "MeshObject.H" +#include "basicThermo.H" +#include "basicMultiComponentMixtureNew.H" +#include "liquidMixture.H" +#include "solidMixture.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class SLGThermo Declaration +\*---------------------------------------------------------------------------*/ + +class SLGThermo +: + public MeshObject +{ + // Private data + + //- Thermo package + basicThermo& thermo_; + + //- Reference to the multi-component carrier phase thermo + basicMultiComponentMixtureNew* carrier_; + + //- Additional liquid properties data + autoPtr liquids_; + + //- Additional solid properties data + autoPtr solids_; + + +public: + + //- Runtime type information + TypeName("SLGThermo"); + + // Constructors + + //- Construct from mesh + SLGThermo(const fvMesh& mesh, basicThermo& thermo); + + + //- Destructor + virtual ~SLGThermo(); + + + // Member Functions + + // Access + + //- Return reference to the thermo database + const basicThermo& thermo() const; + + //- Return reference to the gaseous components + const basicMultiComponentMixtureNew& carrier() const; + + //- Return reference to the global (additional) liquids + const liquidMixture& liquids() const; + + //- Return reference to the global (additional) solids + const solidMixture& solids() const; + + + // Index retrieval + + //- Index of carrier component + label carrierId + ( + const word& cmptName, + bool allowNotFound = false + ) const; + + //- Index of liquid component + label liquidId + ( + const word& cmptName, + bool allowNotFound = false + ) const; + + //- Index of solid component + label solidId + ( + const word& cmptName, + bool allowNotFound = false + ) const; + + + // Checks + + //- Thermo database has multi-component carrier flag + bool hasMultiComponentCarrier() const; + + //- Thermo database has liquid components flag + bool hasLiquids() const; + + //- Thermo database has solid components flag + bool hasSolids() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // From 6e52ed3aac2566edcbb2924893ccd0fab2d32adc Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 6 Sep 2010 11:44:26 +0100 Subject: [PATCH 05/29] ENH: Added constGasThermoPhysics chemistry reader option --- .../chemistryReaders/chemistryReader/makeChemistryReaders.C | 1 + 1 file changed, 1 insertion(+) diff --git a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C index 70801f562a..faab787df6 100644 --- a/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C +++ b/src/thermophysicalModels/reactionThermo/chemistryReaders/chemistryReader/makeChemistryReaders.C @@ -36,6 +36,7 @@ namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // +makeChemistryReader(constGasThermoPhysics); makeChemistryReader(gasThermoPhysics); makeChemistryReader(icoPoly8ThermoPhysics); From 6e14f61f7710c77e64369a4f8dbbc513bd749f66 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 6 Sep 2010 11:45:23 +0100 Subject: [PATCH 06/29] ENH: Opened up the API to give access to per specie info --- .../basicMultiComponentMixture.H | 51 +++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.H index f49bb2df80..daa3a70138 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/basicMultiComponentMixture/basicMultiComponentMixture.H @@ -117,6 +117,57 @@ public: const volScalarField& ft, const dimensionedScalar& stoicRatio ) const; + + + // Per specie properties + + //- Number of moles [] + virtual scalar nMoles(const label specieI) const = 0; + + //- Molecular weight [kg/kmol] + virtual scalar W(const label specieI) const = 0; + + + // Per specie thermo properties + + //- Heat capacity at constant pressure [J/(kg K)] + virtual scalar Cp(const label specieI, const scalar T) const = 0; + + //- Heat capacity at constant volume [J/(kg K)] + virtual scalar Cv(const label specieI, const scalar T) const = 0; + + //- Enthalpy [J/kg] + virtual scalar H(const label specieI, const scalar T) const = 0; + + //- Sensible enthalpy [J/kg] + virtual scalar Hs(const label specieI, const scalar T) const = 0; + + //- Chemical enthalpy [J/kg] + virtual scalar Hc(const label specieI) const = 0; + + //- Entropy [J/(kg K)] + virtual scalar S(const label specieI, const scalar T) const = 0; + + //- Internal energy [J/kg] + virtual scalar E(const label specieI, const scalar T) const = 0; + + //- Gibbs free energy [J/kg] + virtual scalar G(const label specieI, const scalar T) const = 0; + + //- Helmholtz free energy [J/kg] + virtual scalar A(const label specieI, const scalar T) const = 0; + + + // Per specie transport properties + + //- Dynamic viscosity [kg/m/s] + virtual scalar mu(const label specieI, const scalar T) const = 0; + + //- Thermal conductivity [W/m/K] + virtual scalar kappa(const label specieI, const scalar T) const = 0; + + //- Thermal diffusivity [kg/m/s] + virtual scalar alpha(const label specieI, const scalar T) const = 0; }; From 9fa8cd63eb0337f6d040866e3408d1849c804175 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 6 Sep 2010 11:46:07 +0100 Subject: [PATCH 07/29] ENH: Implemented per specie info for mixtures --- .../mixtures/dieselMixture/dieselMixture.C | 185 +++++++++++++++++ .../mixtures/dieselMixture/dieselMixture.H | 54 +++++ .../mixtures/egrMixture/egrMixture.C | 185 +++++++++++++++++ .../mixtures/egrMixture/egrMixture.H | 54 +++++ .../homogeneousMixture/homogeneousMixture.C | 182 +++++++++++++++++ .../homogeneousMixture/homogeneousMixture.H | 54 +++++ .../inhomogeneousMixture.C | 186 ++++++++++++++++++ .../inhomogeneousMixture.H | 54 +++++ .../multiComponentMixture.C | 151 ++++++++++++++ .../multiComponentMixture.H | 51 +++++ .../veryInhomogeneousMixture.C | 186 ++++++++++++++++++ .../veryInhomogeneousMixture.H | 54 +++++ 12 files changed, 1396 insertions(+) diff --git a/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C index d7d312735d..014ef3da51 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.C @@ -97,4 +97,189 @@ void Foam::dieselMixture::read(const dictionary& thermoDict) } +template +const ThermoType& Foam::dieselMixture::getLocalThermo +( + const label specieI +) const +{ + if (specieI == 0) + { + return fuel_; + } + else if (specieI == 1) + { + return oxidant_; + } + else if (specieI == 2) + { + return products_; + } + else + { + FatalErrorIn + ( + "const ThermoType& Foam::dieselMixture::getLocalThermo" + "(" + "const label " + ") const" + ) << "Unknown specie index " << specieI << ". Valid indices are 0..2" + << abort(FatalError); + + return fuel_; + } +} + + +template +Foam::scalar Foam::dieselMixture::nMoles +( + const label specieI +) const +{ + return getLocalThermo(specieI).nMoles(); +} + + +template +Foam::scalar Foam::dieselMixture::W +( + const label specieI +) const +{ + return getLocalThermo(specieI).W(); +} + + +template +Foam::scalar Foam::dieselMixture::Cp +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cp(T); +} + + +template +Foam::scalar Foam::dieselMixture::Cv +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cv(T); +} + + +template +Foam::scalar Foam::dieselMixture::H +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).H(T); +} + + +template +Foam::scalar Foam::dieselMixture::Hs +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Hs(T); +} + + +template +Foam::scalar Foam::dieselMixture::Hc +( + const label specieI +) const +{ + return getLocalThermo(specieI).Hc(); +} + + +template +Foam::scalar Foam::dieselMixture::S +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).S(T); +} + + +template +Foam::scalar Foam::dieselMixture::E +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).E(T); +} + + +template +Foam::scalar Foam::dieselMixture::G +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).G(T); +} + + +template +Foam::scalar Foam::dieselMixture::A +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).A(T); +} + + +template +Foam::scalar Foam::dieselMixture::mu +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).mu(T); +} + + +template +Foam::scalar Foam::dieselMixture::kappa +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).kappa(T); +} + + +template +Foam::scalar Foam::dieselMixture::alpha +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).alpha(T); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H index b0b46a88cc..8625818a58 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/dieselMixture/dieselMixture.H @@ -151,6 +151,60 @@ public: //- Read dictionary void read(const dictionary&); + + //- Return thermo based on index + const ThermoType& getLocalThermo(const label specieI) const; + + + // Per specie properties + + //- Number of moles [] + virtual scalar nMoles(const label specieI) const; + + //- Molecular weight [kg/kmol] + virtual scalar W(const label specieI) const; + + + // Per specie thermo properties + + //- Heat capacity at constant pressure [J/(kg K)] + virtual scalar Cp(const label specieI, const scalar T) const; + + //- Heat capacity at constant volume [J/(kg K)] + virtual scalar Cv(const label specieI, const scalar T) const; + + //- Enthalpy [J/kg] + virtual scalar H(const label specieI, const scalar T) const; + + //- Sensible enthalpy [J/kg] + virtual scalar Hs(const label specieI, const scalar T) const; + + //- Chemical enthalpy [J/kg] + virtual scalar Hc(const label specieI) const; + + //- Entropy [J/(kg K)] + virtual scalar S(const label specieI, const scalar T) const; + + //- Internal energy [J/kg] + virtual scalar E(const label specieI, const scalar T) const; + + //- Gibbs free energy [J/kg] + virtual scalar G(const label specieI, const scalar T) const; + + //- Helmholtz free energy [J/kg] + virtual scalar A(const label specieI, const scalar T) const; + + + // Per specie transport properties + + //- Dynamic viscosity [kg/m/s] + virtual scalar mu(const label specieI, const scalar T) const; + + //- Thermal conductivity [W/m/K] + virtual scalar kappa(const label specieI, const scalar T) const; + + //- Thermal diffusivity [kg/m/s] + virtual scalar alpha(const label specieI, const scalar T) const; }; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C index 7ba65975e8..06cf80a47f 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.C @@ -107,4 +107,189 @@ void Foam::egrMixture::read(const dictionary& thermoDict) } +template +const ThermoType& Foam::egrMixture::getLocalThermo +( + const label specieI +) const +{ + if (specieI == 0) + { + return fuel_; + } + else if (specieI == 1) + { + return oxidant_; + } + else if (specieI == 2) + { + return products_; + } + else + { + FatalErrorIn + ( + "const ThermoType& Foam::egrMixture::getLocalThermo" + "(" + "const label " + ") const" + ) << "Unknown specie index " << specieI << ". Valid indices are 0..2" + << abort(FatalError); + + return fuel_; + } +} + + +template +Foam::scalar Foam::egrMixture::nMoles +( + const label specieI +) const +{ + return getLocalThermo(specieI).nMoles(); +} + + +template +Foam::scalar Foam::egrMixture::W +( + const label specieI +) const +{ + return getLocalThermo(specieI).W(); +} + + +template +Foam::scalar Foam::egrMixture::Cp +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cp(T); +} + + +template +Foam::scalar Foam::egrMixture::Cv +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cv(T); +} + + +template +Foam::scalar Foam::egrMixture::H +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).H(T); +} + + +template +Foam::scalar Foam::egrMixture::Hs +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Hs(T); +} + + +template +Foam::scalar Foam::egrMixture::Hc +( + const label specieI +) const +{ + return getLocalThermo(specieI).Hc(); +} + + +template +Foam::scalar Foam::egrMixture::S +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).S(T); +} + + +template +Foam::scalar Foam::egrMixture::E +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).E(T); +} + + +template +Foam::scalar Foam::egrMixture::G +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).G(T); +} + + +template +Foam::scalar Foam::egrMixture::A +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).A(T); +} + + +template +Foam::scalar Foam::egrMixture::mu +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).mu(T); +} + + +template +Foam::scalar Foam::egrMixture::kappa +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).kappa(T); +} + + +template +Foam::scalar Foam::egrMixture::alpha +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).alpha(T); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H index 0a9adf6aa7..95de13f321 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/egrMixture/egrMixture.H @@ -167,6 +167,60 @@ public: //- Read dictionary void read(const dictionary&); + + //- Return thermo based on index + const ThermoType& getLocalThermo(const label specieI) const; + + + // Per specie properties + + //- Number of moles [] + virtual scalar nMoles(const label specieI) const; + + //- Molecular weight [kg/kmol] + virtual scalar W(const label specieI) const; + + + // Per specie thermo properties + + //- Heat capacity at constant pressure [J/(kg K)] + virtual scalar Cp(const label specieI, const scalar T) const; + + //- Heat capacity at constant volume [J/(kg K)] + virtual scalar Cv(const label specieI, const scalar T) const; + + //- Enthalpy [J/kg] + virtual scalar H(const label specieI, const scalar T) const; + + //- Sensible enthalpy [J/kg] + virtual scalar Hs(const label specieI, const scalar T) const; + + //- Chemical enthalpy [J/kg] + virtual scalar Hc(const label specieI) const; + + //- Entropy [J/(kg K)] + virtual scalar S(const label specieI, const scalar T) const; + + //- Internal energy [J/kg] + virtual scalar E(const label specieI, const scalar T) const; + + //- Gibbs free energy [J/kg] + virtual scalar G(const label specieI, const scalar T) const; + + //- Helmholtz free energy [J/kg] + virtual scalar A(const label specieI, const scalar T) const; + + + // Per specie transport properties + + //- Dynamic viscosity [kg/m/s] + virtual scalar mu(const label specieI, const scalar T) const; + + //- Thermal conductivity [W/m/K] + virtual scalar kappa(const label specieI, const scalar T) const; + + //- Thermal diffusivity [kg/m/s] + virtual scalar alpha(const label specieI, const scalar T) const; }; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C index 89878ed40c..eca7ffd0d5 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.C @@ -89,4 +89,186 @@ void Foam::homogeneousMixture::read(const dictionary& thermoDict) } +template +const ThermoType& Foam::homogeneousMixture::getLocalThermo +( + const label specieI +) const +{ + if (specieI == 0) + { + return reactants_; + } + else if (specieI == 1) + { + return products_; + } + else + { + FatalErrorIn + ( + "const ThermoType& Foam::homogeneousMixture::" + "getLocalThermo" + "(" + "const label " + ") const" + ) << "Unknown specie index " << specieI << ". Valid indices are 0..1" + << abort(FatalError); + + return reactants_; + } +} + + +template +Foam::scalar Foam::homogeneousMixture::nMoles +( + const label specieI +) const +{ + return getLocalThermo(specieI).nMoles(); +} + + +template +Foam::scalar Foam::homogeneousMixture::W +( + const label specieI +) const +{ + return getLocalThermo(specieI).W(); +} + + +template +Foam::scalar Foam::homogeneousMixture::Cp +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cp(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::Cv +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cv(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::H +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).H(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::Hs +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Hs(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::Hc +( + const label specieI +) const +{ + return getLocalThermo(specieI).Hc(); +} + + +template +Foam::scalar Foam::homogeneousMixture::S +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).S(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::E +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).E(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::G +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).G(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::A +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).A(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::mu +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).mu(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::kappa +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).kappa(T); +} + + +template +Foam::scalar Foam::homogeneousMixture::alpha +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).alpha(T); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H index b03e63d7c7..a1fd589c83 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/homogeneousMixture/homogeneousMixture.H @@ -125,6 +125,60 @@ public: //- Read dictionary void read(const dictionary&); + + //- Return thermo based on index + const ThermoType& getLocalThermo(const label specieI) const; + + + // Per specie properties + + //- Number of moles [] + virtual scalar nMoles(const label specieI) const; + + //- Molecular weight [kg/kmol] + virtual scalar W(const label specieI) const; + + + // Per specie thermo properties + + //- Heat capacity at constant pressure [J/(kg K)] + virtual scalar Cp(const label specieI, const scalar T) const; + + //- Heat capacity at constant volume [J/(kg K)] + virtual scalar Cv(const label specieI, const scalar T) const; + + //- Enthalpy [J/kg] + virtual scalar H(const label specieI, const scalar T) const; + + //- Sensible enthalpy [J/kg] + virtual scalar Hs(const label specieI, const scalar T) const; + + //- Chemical enthalpy [J/kg] + virtual scalar Hc(const label specieI) const; + + //- Entropy [J/(kg K)] + virtual scalar S(const label specieI, const scalar T) const; + + //- Internal energy [J/kg] + virtual scalar E(const label specieI, const scalar T) const; + + //- Gibbs free energy [J/kg] + virtual scalar G(const label specieI, const scalar T) const; + + //- Helmholtz free energy [J/kg] + virtual scalar A(const label specieI, const scalar T) const; + + + // Per specie transport properties + + //- Dynamic viscosity [kg/m/s] + virtual scalar mu(const label specieI, const scalar T) const; + + //- Thermal conductivity [W/m/K] + virtual scalar kappa(const label specieI, const scalar T) const; + + //- Thermal diffusivity [kg/m/s] + virtual scalar alpha(const label specieI, const scalar T) const; }; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C index 743aeff98b..2ef52c112d 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.C @@ -101,4 +101,190 @@ void Foam::inhomogeneousMixture::read(const dictionary& thermoDict) } +template +const ThermoType& Foam::inhomogeneousMixture::getLocalThermo +( + const label specieI +) const +{ + if (specieI == 0) + { + return fuel_; + } + else if (specieI == 1) + { + return oxidant_; + } + else if (specieI == 2) + { + return products_; + } + else + { + FatalErrorIn + ( + "const ThermoType& Foam::inhomogeneousMixture::" + "getLocalThermo" + "(" + "const label " + ") const" + ) << "Unknown specie index " << specieI << ". Valid indices are 0..2" + << abort(FatalError); + + return fuel_; + } +} + + +template +Foam::scalar Foam::inhomogeneousMixture::nMoles +( + const label specieI +) const +{ + return getLocalThermo(specieI).nMoles(); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::W +( + const label specieI +) const +{ + return getLocalThermo(specieI).W(); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::Cp +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cp(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::Cv +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cv(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::H +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).H(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::Hs +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Hs(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::Hc +( + const label specieI +) const +{ + return getLocalThermo(specieI).Hc(); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::S +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).S(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::E +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).E(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::G +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).G(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::A +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).A(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::mu +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).mu(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::kappa +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).kappa(T); +} + + +template +Foam::scalar Foam::inhomogeneousMixture::alpha +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).alpha(T); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H index b4f9fc5f38..163052a848 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/inhomogeneousMixture/inhomogeneousMixture.H @@ -156,6 +156,60 @@ public: //- Read dictionary void read(const dictionary&); + + //- Return thermo based on index + const ThermoType& getLocalThermo(const label specieI) const; + + + // Per specie properties + + //- Number of moles [] + virtual scalar nMoles(const label specieI) const; + + //- Molecular weight [kg/kmol] + virtual scalar W(const label specieI) const; + + + // Per specie thermo properties + + //- Heat capacity at constant pressure [J/(kg K)] + virtual scalar Cp(const label specieI, const scalar T) const; + + //- Heat capacity at constant volume [J/(kg K)] + virtual scalar Cv(const label specieI, const scalar T) const; + + //- Enthalpy [J/kg] + virtual scalar H(const label specieI, const scalar T) const; + + //- Sensible enthalpy [J/kg] + virtual scalar Hs(const label specieI, const scalar T) const; + + //- Chemical enthalpy [J/kg] + virtual scalar Hc(const label specieI) const; + + //- Entropy [J/(kg K)] + virtual scalar S(const label specieI, const scalar T) const; + + //- Internal energy [J/kg] + virtual scalar E(const label specieI, const scalar T) const; + + //- Gibbs free energy [J/kg] + virtual scalar G(const label specieI, const scalar T) const; + + //- Helmholtz free energy [J/kg] + virtual scalar A(const label specieI, const scalar T) const; + + + // Per specie transport properties + + //- Dynamic viscosity [kg/m/s] + virtual scalar mu(const label specieI, const scalar T) const; + + //- Thermal conductivity [W/m/K] + virtual scalar kappa(const label specieI, const scalar T) const; + + //- Thermal diffusivity [kg/m/s] + virtual scalar alpha(const label specieI, const scalar T) const; }; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C index a8575e037c..a30dd5dd1b 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.C @@ -160,4 +160,155 @@ void Foam::multiComponentMixture::read } +template +Foam::scalar Foam::multiComponentMixture::nMoles +( + const label specieI +) const +{ + return speciesData_[specieI].nMoles(); +} + + +template +Foam::scalar Foam::multiComponentMixture::W +( + const label specieI +) const +{ + return speciesData_[specieI].W(); +} + + +template +Foam::scalar Foam::multiComponentMixture::Cp +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].Cp(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::Cv +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].Cv(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::H +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].H(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::Hs +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].Hs(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::Hc +( + const label specieI +) const +{ + return speciesData_[specieI].Hc(); +} + + +template +Foam::scalar Foam::multiComponentMixture::S +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].S(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::E +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].E(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::G +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].G(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::A +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].A(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::mu +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].mu(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::kappa +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].kappa(T); +} + + +template +Foam::scalar Foam::multiComponentMixture::alpha +( + const label specieI, + const scalar T +) const +{ + return speciesData_[specieI].alpha(T); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H index 73d27f72cc..b388e9c411 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/multiComponentMixture/multiComponentMixture.H @@ -118,6 +118,57 @@ public: //- Read dictionary void read(const dictionary&); + + + // Per specie properties + + //- Number of moles [] + virtual scalar nMoles(const label specieI) const; + + //- Molecular weight [kg/kmol] + virtual scalar W(const label specieI) const; + + + // Per specie thermo properties + + //- Heat capacity at constant pressure [J/(kg K)] + virtual scalar Cp(const label specieI, const scalar T) const; + + //- Heat capacity at constant volume [J/(kg K)] + virtual scalar Cv(const label specieI, const scalar T) const; + + //- Enthalpy [J/kg] + virtual scalar H(const label specieI, const scalar T) const; + + //- Sensible enthalpy [J/kg] + virtual scalar Hs(const label specieI, const scalar T) const; + + //- Chemical enthalpy [J/kg] + virtual scalar Hc(const label specieI) const; + + //- Entropy [J/(kg K)] + virtual scalar S(const label specieI, const scalar T) const; + + //- Internal energy [J/kg] + virtual scalar E(const label specieI, const scalar T) const; + + //- Gibbs free energy [J/kg] + virtual scalar G(const label specieI, const scalar T) const; + + //- Helmholtz free energy [J/kg] + virtual scalar A(const label specieI, const scalar T) const; + + + // Per specie transport properties + + //- Dynamic viscosity [kg/m/s] + virtual scalar mu(const label specieI, const scalar T) const; + + //- Thermal conductivity [W/m/K] + virtual scalar kappa(const label specieI, const scalar T) const; + + //- Thermal diffusivity [kg/m/s] + virtual scalar alpha(const label specieI, const scalar T) const; }; diff --git a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C index 9781890b1a..3684fc3e09 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C +++ b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.C @@ -102,4 +102,190 @@ void Foam::veryInhomogeneousMixture::read } +template +const ThermoType& Foam::veryInhomogeneousMixture::getLocalThermo +( + const label specieI +) const +{ + if (specieI == 0) + { + return fuel_; + } + else if (specieI == 1) + { + return oxidant_; + } + else if (specieI == 2) + { + return products_; + } + else + { + FatalErrorIn + ( + "const ThermoType& Foam::veryInhomogeneousMixture::" + "getLocalThermo" + "(" + "const label " + ") const" + ) << "Unknown specie index " << specieI << ". Valid indices are 0..2" + << abort(FatalError); + + return fuel_; + } +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::nMoles +( + const label specieI +) const +{ + return getLocalThermo(specieI).nMoles(); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::W +( + const label specieI +) const +{ + return getLocalThermo(specieI).W(); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::Cp +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cp(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::Cv +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Cv(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::H +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).H(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::Hs +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).Hs(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::Hc +( + const label specieI +) const +{ + return getLocalThermo(specieI).Hc(); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::S +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).S(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::E +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).E(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::G +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).G(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::A +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).A(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::mu +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).mu(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::kappa +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).kappa(T); +} + + +template +Foam::scalar Foam::veryInhomogeneousMixture::alpha +( + const label specieI, + const scalar T +) const +{ + return getLocalThermo(specieI).alpha(T); +} + + // ************************************************************************* // diff --git a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H index f58335f4e4..1ae7a36985 100644 --- a/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H +++ b/src/thermophysicalModels/reactionThermo/mixtures/veryInhomogeneousMixture/veryInhomogeneousMixture.H @@ -157,6 +157,60 @@ public: //- Read dictionary void read(const dictionary&); + + //- Return thermo based on index + const ThermoType& getLocalThermo(const label specieI) const; + + + // Per specie properties + + //- Number of moles [] + virtual scalar nMoles(const label specieI) const; + + //- Molecular weight [kg/kmol] + virtual scalar W(const label specieI) const; + + + // Per specie thermo properties + + //- Heat capacity at constant pressure [J/(kg K)] + virtual scalar Cp(const label specieI, const scalar T) const; + + //- Heat capacity at constant volume [J/(kg K)] + virtual scalar Cv(const label specieI, const scalar T) const; + + //- Enthalpy [J/kg] + virtual scalar H(const label specieI, const scalar T) const; + + //- Sensible enthalpy [J/kg] + virtual scalar Hs(const label specieI, const scalar T) const; + + //- Chemical enthalpy [J/kg] + virtual scalar Hc(const label specieI) const; + + //- Entropy [J/(kg K)] + virtual scalar S(const label specieI, const scalar T) const; + + //- Internal energy [J/kg] + virtual scalar E(const label specieI, const scalar T) const; + + //- Gibbs free energy [J/kg] + virtual scalar G(const label specieI, const scalar T) const; + + //- Helmholtz free energy [J/kg] + virtual scalar A(const label specieI, const scalar T) const; + + + // Per specie transport properties + + //- Dynamic viscosity [kg/m/s] + virtual scalar mu(const label specieI, const scalar T) const; + + //- Thermal conductivity [W/m/K] + virtual scalar kappa(const label specieI, const scalar T) const; + + //- Thermal diffusivity [kg/m/s] + virtual scalar alpha(const label specieI, const scalar T) const; }; From d8ee980ee5467b5787c5b1ecdc5977f9a0a2d321 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 6 Sep 2010 17:22:56 +0100 Subject: [PATCH 08/29] ENH: Updated lagrangian/intermediate lib to use new SLGThermo class --- src/lagrangian/intermediate/Make/files | 6 +- src/lagrangian/intermediate/Make/options | 6 +- .../Templates/ReactingCloud/ReactingCloud.C | 17 +-- .../Templates/ReactingCloud/ReactingCloud.H | 18 +-- .../Templates/ReactingCloud/ReactingCloudI.H | 16 --- .../ReactingMultiphaseCloud.C | 8 +- .../ReactingMultiphaseCloud.H | 2 +- .../Templates/ThermoCloud/ThermoCloud.C | 10 +- .../Templates/ThermoCloud/ThermoCloud.H | 13 +- .../Templates/ThermoCloud/ThermoCloudI.H | 13 +- .../basicReactingCloud.H} | 20 +-- .../basicReactingMultiphaseCloud.H} | 37 +---- .../ReactingMultiphaseParcel.C | 11 +- .../Templates/ReactingParcel/ReactingParcel.C | 56 ++++---- .../makeBasicKinematicParcelSubmodels.C | 4 +- .../basicReactingMultiphaseParcel.C} | 37 ++--- .../basicReactingMultiphaseParcel.H} | 55 +++---- .../defineBasicReactingMultiphaseParcel.C | 4 +- ...keBasicReactingMultiphaseParcelSubmodels.C | 48 +++---- .../basicReactingParcel.C} | 36 ++--- .../basicReactingParcel.H} | 64 ++++----- .../defineBasicReactingParcel.C | 4 +- .../makeBasicReactingParcelSubmodels.C | 36 ++--- .../include/createKinematicParcelTypes.H | 50 +++++++ .../createReactingMultiphaseParcelTypes.H | 65 ++------- .../include/createReactingParcelTypes.H | 37 ++--- .../parcels/include/createThermoParcelTypes.H | 51 +++++++ ...Models.H => makeParcelSurfaceFilmModels.H} | 8 +- ...eactingMultiphaseParcelCompositionModels.H | 32 +---- ...ngMultiphaseParcelDevolatilisationModels.H | 42 ++---- ...eReactingMultiphaseParcelInjectionModels.H | 60 +++----- ...eactingMultiphaseParcelSurfaceFilmModels.H | 74 ---------- ...ingMultiphaseParcelSurfaceReactionModels.H | 33 +---- .../makeReactingParcelCollisionModels.H | 117 --------------- .../makeReactingParcelCompositionModels.H | 30 +--- .../makeReactingParcelDispersionModels.H | 98 ------------- .../include/makeReactingParcelDragModels.H | 82 ----------- .../makeReactingParcelHeatTransferModels.H | 82 ----------- .../makeReactingParcelInjectionModels.H | 61 +++----- ...makeReactingParcelPatchInteractionModels.H | 92 ------------ .../makeReactingParcelPhaseChangeModels.H | 37 +---- .../makeReactingParcelPostProcessingModels.H | 84 ----------- .../makeReactingParcelSurfaceFilmModels.H | 36 +---- .../CollisionModel/CollisionModel.H | 15 -- .../DispersionModel/DispersionModel.H | 14 -- .../Kinematic/DragModel/DragModel/DragModel.H | 14 -- .../InjectionModel/InjectionModel.H | 15 -- .../PatchInteractionModel.H | 14 -- .../PostProcessingModel/PostProcessingModel.H | 14 -- .../SurfaceFilmModel/SurfaceFilmModel.H | 15 -- .../CompositionModel/CompositionModel.C | 135 ++++++++---------- .../CompositionModel/CompositionModel.H | 44 ++---- .../SingleMixtureFraction.C | 10 +- .../SinglePhaseMixture/SinglePhaseMixture.C | 6 +- .../LiquidEvaporation/LiquidEvaporation.C | 23 +-- .../LiquidEvaporation/LiquidEvaporation.H | 2 +- .../PhaseChangeModel/PhaseChangeModel.H | 15 +- .../DevolatilisationModel.H | 15 +- .../SurfaceReactionModel.H | 15 +- .../HeatTransferModel/HeatTransferModel.H | 14 -- .../ThermoSurfaceFilm/ThermoSurfaceFilmI.H | 135 ------------------ .../SLGThermo/SLGThermo/SLGThermo.C | 10 +- .../SLGThermo/SLGThermo/SLGThermo.H | 6 +- 63 files changed, 504 insertions(+), 1719 deletions(-) rename src/lagrangian/intermediate/clouds/derived/{BasicReactingCloud/BasicReactingCloud.H => basicReactingCloud/basicReactingCloud.H} (73%) rename src/lagrangian/intermediate/clouds/derived/{BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H => basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.H} (64%) rename src/lagrangian/intermediate/parcels/derived/{BasicReactingMultiphaseParcel/BasicReactingMultiphaseParcel.C => basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.C} (64%) rename src/lagrangian/intermediate/parcels/derived/{BasicReactingMultiphaseParcel/BasicReactingMultiphaseParcel.H => basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.H} (67%) rename src/lagrangian/intermediate/parcels/derived/{BasicReactingMultiphaseParcel => basicReactingMultiphaseParcel}/defineBasicReactingMultiphaseParcel.C (92%) rename src/lagrangian/intermediate/parcels/derived/{BasicReactingMultiphaseParcel => basicReactingMultiphaseParcel}/makeBasicReactingMultiphaseParcelSubmodels.C (59%) rename src/lagrangian/intermediate/parcels/derived/{BasicReactingParcel/BasicReactingParcel.C => basicReactingParcel/basicReactingParcel.C} (65%) rename src/lagrangian/intermediate/parcels/derived/{BasicReactingParcel/BasicReactingParcel.H => basicReactingParcel/basicReactingParcel.H} (67%) rename src/lagrangian/intermediate/parcels/derived/{BasicReactingParcel => basicReactingParcel}/defineBasicReactingParcel.C (94%) rename src/lagrangian/intermediate/parcels/derived/{BasicReactingParcel => basicReactingParcel}/makeBasicReactingParcelSubmodels.C (63%) create mode 100644 src/lagrangian/intermediate/parcels/include/createKinematicParcelTypes.H create mode 100644 src/lagrangian/intermediate/parcels/include/createThermoParcelTypes.H rename src/lagrangian/intermediate/parcels/include/{makeKinematicParcelSurfaceFilmModels.H => makeParcelSurfaceFilmModels.H} (94%) delete mode 100644 src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceFilmModels.H delete mode 100644 src/lagrangian/intermediate/parcels/include/makeReactingParcelCollisionModels.H delete mode 100644 src/lagrangian/intermediate/parcels/include/makeReactingParcelDispersionModels.H delete mode 100644 src/lagrangian/intermediate/parcels/include/makeReactingParcelDragModels.H delete mode 100644 src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H delete mode 100644 src/lagrangian/intermediate/parcels/include/makeReactingParcelPatchInteractionModels.H delete mode 100644 src/lagrangian/intermediate/parcels/include/makeReactingParcelPostProcessingModels.H delete mode 100644 src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilmI.H diff --git a/src/lagrangian/intermediate/Make/files b/src/lagrangian/intermediate/Make/files index 8ac0c9f1b6..47d4a2239f 100644 --- a/src/lagrangian/intermediate/Make/files +++ b/src/lagrangian/intermediate/Make/files @@ -33,13 +33,15 @@ $(THERMOPARCEL)/makeBasicThermoParcelSubmodels.C /* reacting parcel sub-models */ -REACTINGPARCEL=$(DERIVEDPARCELS)/BasicReactingParcel +REACTINGPARCEL=$(DERIVEDPARCELS)/basicReactingParcel +$(REACTINGPARCEL)/basicReactingParcel.C $(REACTINGPARCEL)/defineBasicReactingParcel.C $(REACTINGPARCEL)/makeBasicReactingParcelSubmodels.C /* reacting multiphase parcel sub-models */ -REACTINGMPPARCEL=$(DERIVEDPARCELS)/BasicReactingMultiphaseParcel +REACTINGMPPARCEL=$(DERIVEDPARCELS)/basicReactingMultiphaseParcel +$(REACTINGMPPARCEL)/basicReactingMultiphaseParcel.C $(REACTINGMPPARCEL)/defineBasicReactingMultiphaseParcel.C $(REACTINGMPPARCEL)/makeBasicReactingMultiphaseParcelSubmodels.C diff --git a/src/lagrangian/intermediate/Make/options b/src/lagrangian/intermediate/Make/options index c67687c84e..5625914e28 100644 --- a/src/lagrangian/intermediate/Make/options +++ b/src/lagrangian/intermediate/Make/options @@ -10,6 +10,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/turbulenceModels \ -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ @@ -19,7 +20,6 @@ EXE_INC = \ -I$(LIB_SRC)/surfaceFilmModels/lnInclude LIB_LIBS = \ - -lsurfaceFilmModels \ -lfiniteVolume \ -lmeshTools \ -llagrangian \ @@ -31,8 +31,10 @@ LIB_LIBS = \ -lspecie \ -lbasicThermophysicalModels \ -lreactionThermophysicalModels \ + -lSLGThermo \ -lchemistryModel \ -lradiation \ -lODE \ -lcompressibleRASModels \ - -lcompressibleLESModels + -lcompressibleLESModels \ + -lsurfaceFilmModels diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C index bb04cd20c4..fec5e02ea3 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C @@ -67,9 +67,9 @@ void Foam::ReactingCloud::preEvolve() template void Foam::ReactingCloud::evolveCloud() { - const volScalarField& T = this->carrierThermo().T(); - const volScalarField cp = this->carrierThermo().Cp(); - const volScalarField& p = this->carrierThermo().p(); + const volScalarField& T = this->thermo().thermo().T(); + const volScalarField cp = this->thermo().thermo().Cp(); + const volScalarField& p = this->thermo().thermo().p(); autoPtr > rhoInterp = interpolation::New ( @@ -149,17 +149,13 @@ Foam::ReactingCloud::ReactingCloud const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - basicThermo& thermo, + const SLGThermo& thermo, bool readFields ) : ThermoCloud(cloudName, rho, U, g, thermo, false), reactingCloud(), constProps_(this->particleProperties()), - mcCarrierThermo_ - ( - dynamic_cast&>(thermo) - ), compositionModel_ ( CompositionModel >::New @@ -176,12 +172,13 @@ Foam::ReactingCloud::ReactingCloud *this ) ), - rhoTrans_(mcCarrierThermo_.species().size()), + rhoTrans_(thermo.carrier().species().size()), dMassPhaseChange_(0.0) { // Set storage for mass source fields and initialise to zero forAll(rhoTrans_, i) { + const word& specieName = thermo.carrier().species()[i]; rhoTrans_.set ( i, @@ -189,7 +186,7 @@ Foam::ReactingCloud::ReactingCloud ( IOobject ( - this->name() + "rhoTrans_" + mcCarrierThermo_.species()[i], + this->name() + "rhoTrans_" + specieName, this->db().time().timeName(), this->db(), IOobject::NO_READ, diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H index 1c380a37f9..38b33eab48 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.H @@ -42,7 +42,6 @@ SourceFiles #include "ThermoCloud.H" #include "reactingCloud.H" -#include "multiComponentMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -67,11 +66,6 @@ class ReactingCloud public ThermoCloud, public reactingCloud { -public: - - //- Type of thermodynamics the cloud was instantiated for - typedef typename ParcelType::thermoType thermoType; - private: @@ -91,9 +85,6 @@ protected: //- Parcel constant properties typename ParcelType::constantProperties constProps_; - //- Multi-component carrier phase thermo - multiComponentMixture& mcCarrierThermo_; - // References to the cloud sub-models @@ -154,7 +145,7 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - basicThermo& thermo, + const SLGThermo& thermo, bool readFields = true ); @@ -175,13 +166,6 @@ public: inline const typename ParcelType::constantProperties& constProps() const; - //- Return const access to multi-component carrier phase thermo - inline const multiComponentMixture& - mcCarrierThermo() const; - - //- Return access to multi-component carrier phase thermo - inline multiComponentMixture& mcCarrierThermo(); - // Sub-models diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H index e68f44dba4..bc859a9060 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H @@ -33,22 +33,6 @@ Foam::ReactingCloud::constProps() const } -template -inline const Foam::multiComponentMixture& -Foam::ReactingCloud::mcCarrierThermo() const -{ - return mcCarrierThermo_; -} - - -template -inline Foam::multiComponentMixture& -Foam::ReactingCloud::mcCarrierThermo() -{ - return mcCarrierThermo_; -} - - template inline const Foam::CompositionModel >& Foam::ReactingCloud::composition() const diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C index cd9d597b71..954f048634 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C @@ -40,9 +40,9 @@ void Foam::ReactingMultiphaseCloud::preEvolve() template void Foam::ReactingMultiphaseCloud::evolveCloud() { - const volScalarField& T = this->carrierThermo().T(); - const volScalarField cp = this->carrierThermo().Cp(); - const volScalarField& p = this->carrierThermo().p(); + const volScalarField& T = this->thermo().thermo().T(); + const volScalarField cp = this->thermo().thermo().Cp(); + const volScalarField& p = this->thermo().thermo().p(); autoPtr > rhoInterp = interpolation::New ( @@ -122,7 +122,7 @@ Foam::ReactingMultiphaseCloud::ReactingMultiphaseCloud const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - basicThermo& thermo, + const SLGThermo& thermo, bool readFields ) : diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H index a6b4de3de6..efd1eaab8e 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H @@ -136,7 +136,7 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - basicThermo& thermo, + const SLGThermo& thermo, bool readFields = true ); diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C index deb2fa3daa..96d6d59b8a 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C @@ -41,8 +41,8 @@ void Foam::ThermoCloud::preEvolve() template void Foam::ThermoCloud::evolveCloud() { - const volScalarField& T = carrierThermo_.T(); - const volScalarField cp = carrierThermo_.Cp(); + const volScalarField& T = thermo_.thermo().T(); + const volScalarField cp = thermo_.thermo().Cp(); autoPtr > rhoInterp = interpolation::New ( @@ -115,7 +115,7 @@ Foam::ThermoCloud::ThermoCloud const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - basicThermo& thermo, + const SLGThermo& thermo, bool readFields ) : @@ -124,13 +124,13 @@ Foam::ThermoCloud::ThermoCloud cloudName, rho, U, - thermo.mu(), + thermo.thermo().mu(), g, false ), thermoCloud(), constProps_(this->particleProperties()), - carrierThermo_(thermo), + thermo_(thermo), heatTransferModel_ ( HeatTransferModel >::New diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H index 1450f8f10c..0f7c8afb23 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.H @@ -41,7 +41,7 @@ SourceFiles #include "KinematicCloud.H" #include "thermoCloud.H" -#include "basicThermo.H" +#include "SLGThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -82,8 +82,8 @@ protected: // References to the carrier gas fields - //- Thermodynamics package (basic) - basicThermo& carrierThermo_; + //- SLG thermodynamics package + const SLGThermo& thermo_; // References to the cloud sub-models @@ -136,7 +136,7 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - basicThermo& thermo, + const SLGThermo& thermo, bool readFields = true ); @@ -158,10 +158,7 @@ public: constProps() const; //- Return const access to thermo package - inline const basicThermo& carrierThermo() const; - - //- Return access to thermo package - inline basicThermo& carrierThermo(); + inline const SLGThermo& thermo() const; // Sub-models diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H index 83e0f5708d..a8907205ce 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H @@ -38,18 +38,9 @@ Foam::ThermoCloud::constProps() const template -inline const Foam::basicThermo& -Foam::ThermoCloud::carrierThermo() const +inline const Foam::SLGThermo& Foam::ThermoCloud::thermo() const { - return carrierThermo_; -} - - -template -inline Foam::basicThermo& -Foam::ThermoCloud::carrierThermo() -{ - return carrierThermo_; + return thermo_; } diff --git a/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.H b/src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.H similarity index 73% rename from src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.H rename to src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.H index 27159c7133..e9057ac69c 100644 --- a/src/lagrangian/intermediate/clouds/derived/BasicReactingCloud/BasicReactingCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/basicReactingCloud/basicReactingCloud.H @@ -22,35 +22,27 @@ License along with OpenFOAM. If not, see . Class - Foam::BasicReactingCloud + Foam::basicReactingCloud Description - Reacting cloud templated on the type of carrier phase thermodynamics + Cloud class to introduce reacting parcels SourceFiles BasicReactingCloud.C \*---------------------------------------------------------------------------*/ -#ifndef BasicReactingCloud_H -#define BasicReactingCloud_H +#ifndef basicReactingCloud_H +#define basicReactingCloud_H #include "ReactingCloud.H" -#include "BasicReactingParcel.H" -#include "thermoPhysicsTypes.H" +#include "basicReactingParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - typedef ReactingCloud > - constThermoReactingCloud; - - typedef ReactingCloud > - thermoReactingCloud; - - typedef ReactingCloud > - icoPoly8ThermoReactingCloud; + typedef ReactingCloud basicReactingCloud; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H b/src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.H similarity index 64% rename from src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H rename to src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.H index 8f14d51721..f56c60d1fa 100644 --- a/src/lagrangian/intermediate/clouds/derived/BasicReactingMultiphaseCloud/BasicReactingMultiphaseCloud.H +++ b/src/lagrangian/intermediate/clouds/derived/basicReactingMultiphaseCloud/basicReactingMultiphaseCloud.H @@ -22,20 +22,18 @@ License along with OpenFOAM. If not, see . Class - Foam::BasicReactingMultiphaseCloud + Foam::basicReactingMultiphaseCloud Description - Reacting multiphase cloud templated on the type of carrier phase - thermodynamics + Cloud class to introduce multi-phase reacting parcels \*---------------------------------------------------------------------------*/ -#ifndef BasicReactingMultiphaseCloud_H -#define BasicReactingMultiphaseCloud_H +#ifndef basicReactingMultiphaseCloud_H +#define basicReactingMultiphaseCloud_H #include "ReactingMultiphaseCloud.H" -#include "BasicReactingMultiphaseParcel.H" -#include "thermoPhysicsTypes.H" +#include "basicReactingMultiphaseParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -43,30 +41,9 @@ namespace Foam { typedef ReactingMultiphaseCloud < - BasicReactingMultiphaseParcel - < - constGasThermoPhysics - > + basicReactingMultiphaseParcel > - constThermoReactingMultiphaseCloud; - - typedef ReactingMultiphaseCloud - < - BasicReactingMultiphaseParcel - < - gasThermoPhysics - > - > - thermoReactingMultiphaseCloud; - - typedef ReactingMultiphaseCloud - < - BasicReactingMultiphaseParcel - < - icoPoly8ThermoPhysics - > - > - icoPoly8ThermoReactingMultiphaseCloud; + basicReactingMultiphaseCloud; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C index 6ff07adc81..1deed776b9 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.C @@ -170,8 +170,7 @@ void Foam::ReactingMultiphaseParcel::cellValueSourceCorrection forAll(td.cloud().rhoTrans(), i) { scalar Y = td.cloud().rhoTrans(i)[cellI]/addedMass; - cpEff += - Y*td.cloud().mcCarrierThermo().speciesData()[i].Cp(this->Tc_); + cpEff += Y*td.cloud().thermo().carrier().Cp(i, this->Tc_); } } const scalar cpc = td.cpInterp().psi()[cellI]; @@ -247,7 +246,7 @@ void Foam::ReactingMultiphaseParcel::calc scalar NCpW = 0.0; // Surface concentrations of emitted species - scalarField Cs(td.cloud().mcCarrierThermo().species().size(), 0.0); + scalarField Cs(td.cloud().composition().carrier().species().size(), 0.0); // Calc mass and enthalpy transfer due to phase change calcPhaseChange @@ -313,7 +312,7 @@ void Foam::ReactingMultiphaseParcel::calc scalarField dMassSRCarrier ( - td.cloud().mcCarrierThermo().species().size(), + td.cloud().composition().carrier().species().size(), 0.0 ); @@ -547,8 +546,8 @@ void Foam::ReactingMultiphaseParcel::calcDevolatilisation const scalar beta = sqr(cbrt(15.0) + cbrt(15.0)); const label id = td.cloud().composition().localToGlobalCarrierId(GAS, i); - const scalar Cp = td.cloud().mcCarrierThermo().speciesData()[id].Cp(Ts); - const scalar W = td.cloud().mcCarrierThermo().speciesData()[id].W(); + const scalar Cp = td.cloud().thermo().carrier().Cp(id, Ts); + const scalar W = td.cloud().thermo().carrier().W(id); const scalar Ni = dMassDV[i]/(this->areaS(d)*dt*W); // Dab calc'd using API vapour mass diffusivity function diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index 08d614ff9b..fa5f3f5ede 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -89,8 +89,7 @@ void Foam::ReactingParcel::cellValueSourceCorrection forAll(td.cloud().rhoTrans(), i) { scalar Y = td.cloud().rhoTrans(i)[cellI]/addedMass; - cpEff += - Y*td.cloud().mcCarrierThermo().speciesData()[i].Cp(this->Tc_); + cpEff += Y*td.cloud().composition().carrier().Cp(i, this->Tc_); } } const scalar cpc = td.cpInterp().psi()[cellI]; @@ -121,13 +120,13 @@ void Foam::ReactingParcel::correctSurfaceValues } // Far field carrier molar fractions - scalarField Xinf(td.cloud().mcCarrierThermo().speciesData().size()); + scalarField Xinf(td.cloud().thermo().carrier().species().size()); forAll(Xinf, i) { Xinf[i] = - td.cloud().mcCarrierThermo().Y(i)[cellI] - /td.cloud().mcCarrierThermo().speciesData()[i].W(); + td.cloud().thermo().carrier().Y(i)[cellI] + /td.cloud().thermo().carrier().W(i); } Xinf /= sum(Xinf); @@ -149,7 +148,7 @@ void Foam::ReactingParcel::correctSurfaceValues const scalar Csi = Cs[i] + Xsff*Xinf[i]*CsTot; Xs[i] = (2.0*Csi + Xinf[i]*CsTot)/3.0; - Ys[i] = Xs[i]*td.cloud().mcCarrierThermo().speciesData()[i].W(); + Ys[i] = Xs[i]*td.cloud().thermo().carrier().W(i); } Xs /= sum(Xs); Ys /= sum(Ys); @@ -164,16 +163,13 @@ void Foam::ReactingParcel::correctSurfaceValues forAll(Ys, i) { - const scalar sqrtW = - sqrt(td.cloud().mcCarrierThermo().speciesData()[i].W()); - const scalar cbrtW = - cbrt(td.cloud().mcCarrierThermo().speciesData()[i].W()); + const scalar sqrtW = sqrt(td.cloud().thermo().carrier().W(i)); + const scalar cbrtW = cbrt(td.cloud().thermo().carrier().W(i)); - rhos += Xs[i]*td.cloud().mcCarrierThermo().speciesData()[i].W(); - mus += Ys[i]*sqrtW*td.cloud().mcCarrierThermo().speciesData()[i].mu(T); - kappa += - Ys[i]*cbrtW*td.cloud().mcCarrierThermo().speciesData()[i].kappa(T); - cps += Xs[i]*td.cloud().mcCarrierThermo().speciesData()[i].Cp(T); + rhos += Xs[i]*td.cloud().thermo().carrier().W(i); + mus += Ys[i]*sqrtW*td.cloud().thermo().carrier().mu(i, T); + kappa += Ys[i]*cbrtW*td.cloud().thermo().carrier().kappa(i, T); + cps += Xs[i]*td.cloud().thermo().carrier().Cp(i, T); sumYiSqrtW += Ys[i]*sqrtW; sumYiCbrtW += Ys[i]*cbrtW; @@ -267,7 +263,7 @@ void Foam::ReactingParcel::calc scalar NCpW = 0.0; // Surface concentrations of emitted species - scalarField Cs(td.cloud().mcCarrierThermo().species().size(), 0.0); + scalarField Cs(td.cloud().composition().carrier().species().size(), 0.0); // Calc mass and enthalpy transfer due to phase change calcPhaseChange @@ -416,10 +412,10 @@ void Foam::ReactingParcel::calcPhaseChange scalarField& Cs ) { - typedef PhaseChangeModel - < - typename ReactingParcel::trackData::cloudType - > phaseChangeModelType; + typedef typename ReactingParcel::trackData::cloudType cloudType; + typedef PhaseChangeModel phaseChangeModelType; + const CompositionModel& composition = td.cloud().composition(); + if ( @@ -458,9 +454,8 @@ void Foam::ReactingParcel::calcPhaseChange forAll(YComponents, i) { - const label idc = - td.cloud().composition().localToGlobalCarrierId(idPhase, i); - const label idl = td.cloud().composition().globalIds(idPhase)[i]; + const label idc = composition.localToGlobalCarrierId(idPhase, i); + const label idl = composition.globalIds(idPhase)[i]; // Calculate enthalpy transfer if @@ -469,28 +464,25 @@ void Foam::ReactingParcel::calcPhaseChange == phaseChangeModelType::etLatentHeat ) { - scalar hlp = - td.cloud().composition().liquids().properties()[idl].hl(pc_, T); + scalar hlp = composition.liquids().properties()[idl].hl(pc_, T); Sh -= dMassPC[i]*hlp/dt; } else { // Note: enthalpies of both phases must use the same reference - scalar hc = td.cloud().mcCarrierThermo().speciesData()[idc].H(T); - scalar hp = - td.cloud().composition().liquids().properties()[idl].h(pc_, T); + scalar hc = composition.carrier().H(idc, T); + scalar hp = composition.liquids().properties()[idl].h(pc_, T); Sh -= dMassPC[i]*(hc - hp)/dt; } // Update particle surface thermo properties const scalar Dab = - td.cloud().composition().liquids().properties()[idl].D(pc_, Ts, Wc); + composition.liquids().properties()[idl].D(pc_, Ts, Wc); - const scalar Cp = - td.cloud().mcCarrierThermo().speciesData()[idc].Cp(Ts); - const scalar W = td.cloud().mcCarrierThermo().speciesData()[idc].W(); + const scalar Cp = composition.carrier().Cp(idc, Ts); + const scalar W = composition.carrier().W(idc); const scalar Ni = dMassPC[i]/(this->areaS(d)*dt*W); // Molar flux of species coming from the particle (kmol/m^2/s) diff --git a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C index 002e2eb66a..d6c2d4532e 100644 --- a/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C +++ b/src/lagrangian/intermediate/parcels/derived/basicKinematicParcel/makeBasicKinematicParcelSubmodels.C @@ -32,7 +32,7 @@ License #include "makeParcelCollisionModels.H" #include "makeParcelPatchInteractionModels.H" #include "makeParcelPostProcessingModels.H" -#include "makeKinematicParcelSurfaceFilmModels.H" +#include "makeParcelSurfaceFilmModels.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -45,7 +45,7 @@ namespace Foam makeParcelCollisionModels(basicKinematicParcel); makeParcelPatchInteractionModels(basicKinematicParcel); makeParcelPostProcessingModels(basicKinematicParcel); - makeKinematicParcelSurfaceFilmModels(basicKinematicParcel); + makeParcelSurfaceFilmModels(basicKinematicParcel); }; diff --git a/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/BasicReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.C similarity index 64% rename from src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/BasicReactingMultiphaseParcel.C rename to src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.C index 849575b92f..56359e0d96 100644 --- a/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/BasicReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.C @@ -23,19 +23,18 @@ License \*---------------------------------------------------------------------------*/ -#include "BasicReactingMultiphaseParcel.H" +#include "basicReactingMultiphaseParcel.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::BasicReactingMultiphaseParcel::BasicReactingMultiphaseParcel +Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel ( - ReactingMultiphaseCloud >& owner, + ReactingMultiphaseCloud& owner, const vector& position, const label cellI ) : - ReactingMultiphaseParcel > + ReactingMultiphaseParcel ( owner, position, @@ -44,10 +43,9 @@ Foam::BasicReactingMultiphaseParcel::BasicReactingMultiphaseParcel {} -template -Foam::BasicReactingMultiphaseParcel::BasicReactingMultiphaseParcel +Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel ( - ReactingMultiphaseCloud >& owner, + ReactingMultiphaseCloud& owner, const vector& position, const label cellI, const label typeId, @@ -61,12 +59,11 @@ Foam::BasicReactingMultiphaseParcel::BasicReactingMultiphaseParcel const scalarField& YLiquid0, const scalarField& YSolid0, const scalarField& Y0, - const typename - ReactingMultiphaseParcel:: + const ReactingMultiphaseParcel:: constantProperties& constProps ) : - ReactingMultiphaseParcel > + ReactingMultiphaseParcel ( owner, position, @@ -87,15 +84,14 @@ Foam::BasicReactingMultiphaseParcel::BasicReactingMultiphaseParcel {} -template -Foam::BasicReactingMultiphaseParcel::BasicReactingMultiphaseParcel +Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel ( - const Cloud >& cloud, + const Cloud& cloud, Istream& is, bool readFields ) : - ReactingMultiphaseParcel > + ReactingMultiphaseParcel ( cloud, is, @@ -104,21 +100,18 @@ Foam::BasicReactingMultiphaseParcel::BasicReactingMultiphaseParcel {} -template -Foam::BasicReactingMultiphaseParcel::BasicReactingMultiphaseParcel +Foam::basicReactingMultiphaseParcel::basicReactingMultiphaseParcel ( - const BasicReactingMultiphaseParcel& p + const basicReactingMultiphaseParcel& p ) : - ReactingMultiphaseParcel >(p) + ReactingMultiphaseParcel(p) {} // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // -template -Foam::BasicReactingMultiphaseParcel:: -~BasicReactingMultiphaseParcel() +Foam::basicReactingMultiphaseParcel::~basicReactingMultiphaseParcel() {} diff --git a/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/BasicReactingMultiphaseParcel.H b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.H similarity index 67% rename from src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/BasicReactingMultiphaseParcel.H rename to src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.H index cc50ae66d1..6cc9d2f535 100644 --- a/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/BasicReactingMultiphaseParcel.H +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/basicReactingMultiphaseParcel.H @@ -28,13 +28,13 @@ Description SourceFiles - BasicReactingMultiphaseParcel.C - BasicReactingMultiphaseParcelIO.C + basicReactingMultiphaseParcel.C + basicReactingMultiphaseParcelIO.C \*---------------------------------------------------------------------------*/ -#ifndef BasicReactingMultiphaseParcel_H -#define BasicReactingMultiphaseParcel_H +#ifndef basicReactingMultiphaseParcel_H +#define basicReactingMultiphaseParcel_H #include "ReactingMultiphaseParcel.H" @@ -44,43 +44,35 @@ SourceFiles namespace Foam { -// Forward declaration of classes -template -class BasicReactingMultiphaseParcel; - /*---------------------------------------------------------------------------*\ - Class BasicReactingMultiphaseParcel Declaration + Class basicReactingMultiphaseParcel Declaration \*---------------------------------------------------------------------------*/ -template -class BasicReactingMultiphaseParcel +class basicReactingMultiphaseParcel : - public ReactingMultiphaseParcel > + public ReactingMultiphaseParcel { public: - //- The type of thermodynamics this parcel was instantiated for - typedef ThermoType thermoType; - //- Run-time type information - TypeName("BasicReactingMultiphaseParcel"); + TypeName("basicReactingMultiphaseParcel"); // Constructors //- Construct from owner, position, and cloud owner // Other properties initialised as null - BasicReactingMultiphaseParcel + basicReactingMultiphaseParcel ( - ReactingMultiphaseCloud& owner, + ReactingMultiphaseCloud& owner, const vector& position, const label cellI ); //- Construct from components - BasicReactingMultiphaseParcel + basicReactingMultiphaseParcel ( - ReactingMultiphaseCloud& owner, + ReactingMultiphaseCloud& owner, const vector& position, const label cellI, const label typeId, @@ -94,35 +86,34 @@ public: const scalarField& YLiquid0, const scalarField& YSolid0, const scalarField& Y0, - const typename - ReactingMultiphaseParcel:: + const ReactingMultiphaseParcel:: constantProperties& constProps ); //- Construct from Istream - BasicReactingMultiphaseParcel + basicReactingMultiphaseParcel ( - const Cloud& c, + const Cloud& c, Istream& is, bool readFields = true ); //- Construct as a copy - BasicReactingMultiphaseParcel(const BasicReactingMultiphaseParcel& p); + basicReactingMultiphaseParcel(const basicReactingMultiphaseParcel& p); //- Construct and return a clone - autoPtr clone() const + autoPtr clone() const { return - autoPtr + autoPtr ( - new BasicReactingMultiphaseParcel(*this) + new basicReactingMultiphaseParcel(*this) ); } //- Destructor - virtual ~BasicReactingMultiphaseParcel(); + virtual ~basicReactingMultiphaseParcel(); }; @@ -132,12 +123,6 @@ public: // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#ifdef NoRepository - #include "BasicReactingMultiphaseParcel.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C similarity index 92% rename from src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C rename to src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C index cbcc47926a..3c3e9fe8fa 100644 --- a/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/defineBasicReactingMultiphaseParcel.C @@ -24,13 +24,13 @@ License \*---------------------------------------------------------------------------*/ #include "createReactingMultiphaseParcelTypes.H" -#include "BasicReactingMultiphaseParcel.H" +#include "basicReactingMultiphaseParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - createReactingMultiphaseParcelType(BasicReactingMultiphaseParcel); + createReactingMultiphaseParcelTypes(basicReactingMultiphaseParcel); }; diff --git a/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C similarity index 59% rename from src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C rename to src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C index b33358db3f..4db5e925a0 100644 --- a/src/lagrangian/intermediate/parcels/derived/BasicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingMultiphaseParcel/makeBasicReactingMultiphaseParcelSubmodels.C @@ -23,26 +23,26 @@ License \*---------------------------------------------------------------------------*/ -#include "BasicReactingMultiphaseParcel.H" +#include "basicReactingMultiphaseParcel.H" // Kinematic -#include "makeReactingParcelDispersionModels.H" -#include "makeReactingParcelDragModels.H" +#include "makeParcelDispersionModels.H" +#include "makeParcelDragModels.H" #include "makeReactingMultiphaseParcelInjectionModels.H" // MP variant -#include "makeReactingParcelCollisionModels.H" -#include "makeReactingParcelPatchInteractionModels.H" -#include "makeReactingParcelPostProcessingModels.H" +#include "makeParcelCollisionModels.H" +#include "makeParcelPatchInteractionModels.H" +#include "makeParcelPostProcessingModels.H" // Thermodynamic -#include "makeReactingParcelHeatTransferModels.H" +#include "makeParcelHeatTransferModels.H" // Reacting -#include "makeReactingMultiphaseParcelCompositionModels.H" // MP variant +#include "makeReactingMultiphaseParcelCompositionModels.H" // MP Variant #include "makeReactingParcelPhaseChangeModels.H" +#include "makeReactingParcelSurfaceFilmModels.H" // Reacting multiphase #include "makeReactingMultiphaseParcelDevolatilisationModels.H" -#include "makeReactingMultiphaseParcelSurfaceFilmModels.H" #include "makeReactingMultiphaseParcelSurfaceReactionModels.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -50,32 +50,32 @@ License namespace Foam { // Kinematic sub-models - makeReactingDispersionModels(BasicReactingMultiphaseParcel); - makeReactingDragModels(BasicReactingMultiphaseParcel); - makeReactingMultiphaseInjectionModels(BasicReactingMultiphaseParcel); - makeReactingCollisionModels(BasicReactingMultiphaseParcel); - makeReactingPatchInteractionModels(BasicReactingMultiphaseParcel); - makeReactingPostProcessingModels(BasicReactingMultiphaseParcel); + makeParcelDispersionModels(basicReactingMultiphaseParcel); + makeParcelDragModels(basicReactingMultiphaseParcel); + makeReactingMultiphaseParcelInjectionModels(basicReactingMultiphaseParcel); + makeParcelCollisionModels(basicReactingMultiphaseParcel); + makeParcelPatchInteractionModels(basicReactingMultiphaseParcel); + makeParcelPostProcessingModels(basicReactingMultiphaseParcel); // Thermo sub-models - makeReactingHeatTransferModels(BasicReactingMultiphaseParcel); + makeParcelHeatTransferModels(basicReactingMultiphaseParcel); // Reacting sub-models - makeReactingMultiphaseCompositionModels(BasicReactingMultiphaseParcel); - makeReactingPhaseChangeModels(BasicReactingMultiphaseParcel); + makeReactingMultiphaseParcelCompositionModels(basicReactingMultiphaseParcel); + makeReactingParcelPhaseChangeModels(basicReactingMultiphaseParcel); // Reacting multiphase sub-models - makeReactingMultiphaseDevolatilisationModels + makeReactingMultiphaseParcelDevolatilisationModels ( - BasicReactingMultiphaseParcel + basicReactingMultiphaseParcel ); - makeReactingMultiphaseSurfaceFilmModels + makeReactingParcelSurfaceFilmModels ( - BasicReactingMultiphaseParcel + basicReactingMultiphaseParcel ); - makeReactingMultiphaseSurfaceReactionModels + makeReactingMultiphaseParcelSurfaceReactionModels ( - BasicReactingMultiphaseParcel + basicReactingMultiphaseParcel ); }; diff --git a/src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/BasicReactingParcel.C b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.C similarity index 65% rename from src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/BasicReactingParcel.C rename to src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.C index 5e173ff85e..23ef85c02e 100644 --- a/src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/BasicReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.C @@ -23,26 +23,24 @@ License \*---------------------------------------------------------------------------*/ -#include "BasicReactingParcel.H" +#include "basicReactingParcel.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -template -Foam::BasicReactingParcel::BasicReactingParcel +Foam::basicReactingParcel::basicReactingParcel ( - ReactingCloud >& owner, + ReactingCloud& owner, const vector& position, const label cellI ) : - ReactingParcel >(owner, position, cellI) + ReactingParcel(owner, position, cellI) {} -template -Foam::BasicReactingParcel::BasicReactingParcel +Foam::basicReactingParcel::basicReactingParcel ( - ReactingCloud >& owner, + ReactingCloud& owner, const vector& position, const label cellI, const label typeId, @@ -53,11 +51,10 @@ Foam::BasicReactingParcel::BasicReactingParcel const vector& angularMomentum0, const vector& torque0, const scalarField& Y0, - const typename ReactingParcel >:: - constantProperties& constProps + const ReactingParcel::constantProperties& constProps ) : - ReactingParcel > + ReactingParcel ( owner, position, @@ -75,32 +72,29 @@ Foam::BasicReactingParcel::BasicReactingParcel {} -template -Foam::BasicReactingParcel::BasicReactingParcel +Foam::basicReactingParcel::basicReactingParcel ( - const Cloud >& cloud, + const Cloud& cloud, Istream& is, bool readFields ) : - ReactingParcel >(cloud, is, readFields) + ReactingParcel(cloud, is, readFields) {} -template -Foam::BasicReactingParcel::BasicReactingParcel +Foam::basicReactingParcel::basicReactingParcel ( - const BasicReactingParcel& p + const basicReactingParcel& p ) : - ReactingParcel(p) + ReactingParcel(p) {} // * * * * * * * * * * * * * * * * Destructors * * * * * * * * * * * * * * // -template -Foam::BasicReactingParcel::~BasicReactingParcel() +Foam::basicReactingParcel::~basicReactingParcel() {} diff --git a/src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/BasicReactingParcel.H b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.H similarity index 67% rename from src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/BasicReactingParcel.H rename to src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.H index dc3d69e75d..86e9d726f5 100644 --- a/src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/BasicReactingParcel.H +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/basicReactingParcel.H @@ -22,19 +22,18 @@ License along with OpenFOAM. If not, see . Class - Foam::BasicReactingParcel + Foam::basicReactingParcel Description SourceFiles - BasicReactingParcel.C - BasicReactingParcelIO.C + basicReactingParcel.C \*---------------------------------------------------------------------------*/ -#ifndef BasicReactingParcel_H -#define BasicReactingParcel_H +#ifndef basicReactingParcel_H +#define basicReactingParcel_H #include "ReactingParcel.H" @@ -43,43 +42,35 @@ SourceFiles namespace Foam { -// Forward declaration of classes -template -class BasicReactingParcel; - /*---------------------------------------------------------------------------*\ - Class BasicReactingParcel Declaration + Class basicReactingParcel Declaration \*---------------------------------------------------------------------------*/ -template -class BasicReactingParcel +class basicReactingParcel : - public ReactingParcel > + public ReactingParcel { public: - //- The type of thermodynamics this parcel was instantiated for - typedef ThermoType thermoType; - //- Run-time type information - TypeName("BasicReactingParcel"); + TypeName("basicReactingParcel"); // Constructors //- Construct from owner, position, and cloud owner // Other properties initialised as null - BasicReactingParcel + basicReactingParcel ( - ReactingCloud& owner, + ReactingCloud& owner, const vector& position, const label cellI ); //- Construct from components - BasicReactingParcel + basicReactingParcel ( - ReactingCloud& owner, + ReactingCloud& owner, const vector& position, const label cellI, const label typeId, @@ -90,49 +81,50 @@ public: const vector& angularMomentum0, const vector& torque0, const scalarField& Y0, - const typename ReactingParcel:: - constantProperties& constProps + const ReactingParcel::constantProperties& + constProps ); //- Construct from Istream - BasicReactingParcel + basicReactingParcel ( - const Cloud& c, + const Cloud& c, Istream& is, bool readFields = true ); //- Construct as a copy - BasicReactingParcel(const BasicReactingParcel& p); + basicReactingParcel(const basicReactingParcel& p); //- Construct and return a clone - autoPtr clone() const + autoPtr clone() const { return - autoPtr + autoPtr ( - new BasicReactingParcel(*this) + new basicReactingParcel(*this) ); } //- Destructor - virtual ~BasicReactingParcel(); + virtual ~basicReactingParcel(); }; +template<> +inline bool contiguous() +{ + return false; +} + + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // } // End namespace Foam // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#ifdef NoRepository - #include "BasicReactingParcel.C" -#endif - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - #endif // ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/defineBasicReactingParcel.C b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/defineBasicReactingParcel.C similarity index 94% rename from src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/defineBasicReactingParcel.C rename to src/lagrangian/intermediate/parcels/derived/basicReactingParcel/defineBasicReactingParcel.C index c4dc663cbd..0eb06eedd5 100644 --- a/src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/defineBasicReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/defineBasicReactingParcel.C @@ -23,14 +23,14 @@ License \*---------------------------------------------------------------------------*/ +#include "basicReactingParcel.H" #include "createReactingParcelTypes.H" -#include "BasicReactingParcel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // namespace Foam { - createReactingParcelType(BasicReactingParcel); + createReactingParcelTypes(basicReactingParcel); }; diff --git a/src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/makeBasicReactingParcelSubmodels.C b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C similarity index 63% rename from src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/makeBasicReactingParcelSubmodels.C rename to src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C index d2e23542d1..cd4f0e1775 100644 --- a/src/lagrangian/intermediate/parcels/derived/BasicReactingParcel/makeBasicReactingParcelSubmodels.C +++ b/src/lagrangian/intermediate/parcels/derived/basicReactingParcel/makeBasicReactingParcelSubmodels.C @@ -23,18 +23,18 @@ License \*---------------------------------------------------------------------------*/ -#include "BasicReactingParcel.H" +#include "basicReactingParcel.H" // Kinematic -#include "makeReactingParcelDispersionModels.H" -#include "makeReactingParcelDragModels.H" -#include "makeReactingParcelInjectionModels.H" -#include "makeReactingParcelCollisionModels.H" -#include "makeReactingParcelPatchInteractionModels.H" -#include "makeReactingParcelPostProcessingModels.H" +#include "makeParcelDispersionModels.H" +#include "makeParcelDragModels.H" +#include "makeReactingParcelInjectionModels.H" // Reacting variant +#include "makeParcelCollisionModels.H" +#include "makeParcelPatchInteractionModels.H" +#include "makeParcelPostProcessingModels.H" // Thermodynamic -#include "makeReactingParcelHeatTransferModels.H" +#include "makeParcelHeatTransferModels.H" // Reacting #include "makeReactingParcelCompositionModels.H" @@ -46,20 +46,20 @@ License namespace Foam { // Kinematic sub-models - makeReactingDispersionModels(BasicReactingParcel); - makeReactingDragModels(BasicReactingParcel); - makeReactingInjectionModels(BasicReactingParcel); - makeReactingCollisionModels(BasicReactingParcel); - makeReactingPatchInteractionModels(BasicReactingParcel); - makeReactingPostProcessingModels(BasicReactingParcel); + makeParcelDispersionModels(basicReactingParcel); + makeParcelDragModels(basicReactingParcel); + makeReactingParcelInjectionModels(basicReactingParcel); + makeParcelCollisionModels(basicReactingParcel); + makeParcelPatchInteractionModels(basicReactingParcel); + makeParcelPostProcessingModels(basicReactingParcel); // Thermo sub-models - makeReactingHeatTransferModels(BasicReactingParcel); + makeParcelHeatTransferModels(basicReactingParcel); // Reacting sub-models - makeReactingCompositionModels(BasicReactingParcel); - makeReactingPhaseChangeModels(BasicReactingParcel); - makeReactingSurfaceFilmModels(BasicReactingParcel); + makeReactingParcelCompositionModels(basicReactingParcel); + makeReactingParcelPhaseChangeModels(basicReactingParcel); + makeReactingParcelSurfaceFilmModels(basicReactingParcel); }; diff --git a/src/lagrangian/intermediate/parcels/include/createKinematicParcelTypes.H b/src/lagrangian/intermediate/parcels/include/createKinematicParcelTypes.H new file mode 100644 index 0000000000..acdace44af --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/createKinematicParcelTypes.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef createKinematicParcelTypes_H +#define createKinematicParcelTypes_H + +#include "KinematicParcel.H" +#include "KinematicCloud.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define createKinematicParcelTypes(ParcelType) \ + \ + defineTemplateTypeNameAndDebug(ParcelType, 0); \ + defineTemplateTypeNameAndDebug(Particle, 0); \ + defineTemplateTypeNameAndDebug(Cloud, 0); \ + \ + defineParcelTypeNameAndDebug(KinematicParcel, 0); \ + defineTemplateTypeNameAndDebug(KinematicParcel, 0); \ + defineParcelTypeNameAndDebug(KinematicCloud, 0); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // + diff --git a/src/lagrangian/intermediate/parcels/include/createReactingMultiphaseParcelTypes.H b/src/lagrangian/intermediate/parcels/include/createReactingMultiphaseParcelTypes.H index 5013e8d905..50a31657bb 100644 --- a/src/lagrangian/intermediate/parcels/include/createReactingMultiphaseParcelTypes.H +++ b/src/lagrangian/intermediate/parcels/include/createReactingMultiphaseParcelTypes.H @@ -26,67 +26,20 @@ License #ifndef createReactingMultiphaseParcelTypes_H #define createReactingMultiphaseParcelTypes_H -#include "thermoPhysicsTypes.H" +#include "ReactingMultiphaseParcel.H" +#include "ReactingMultiphaseCloud.H" + +#include "createReactingParcelTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define createReactingMultiphaseParcelType(ParcelType) \ +#define createReactingMultiphaseParcelTypes(ParcelType) \ \ - createReactingMultiphaseParcelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - createReactingMultiphaseParcelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - createReactingMultiphaseParcelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define createReactingMultiphaseParcelThermoType(ParcelType, ThermoType) \ + createReactingParcelTypes(ParcelType); \ \ - typedef ParcelType ParcelType##ThermoType; \ - \ - defineTemplateTypeNameAndDebug(ParcelType##ThermoType, 0); \ - defineTemplateTypeNameAndDebug(Particle, 0); \ - defineTemplateTypeNameAndDebug(Cloud, 0); \ - \ - defineParcelTypeNameAndDebug(KinematicParcel, 0); \ - defineTemplateTypeNameAndDebug \ - ( \ - KinematicParcel, \ - 0 \ - ); \ - defineParcelTypeNameAndDebug(ThermoParcel, 0); \ - defineTemplateTypeNameAndDebug(ThermoParcel, 0); \ - defineParcelTypeNameAndDebug(ReactingParcel, 0); \ - defineTemplateTypeNameAndDebug(ReactingParcel, 0);\ - defineParcelTypeNameAndDebug \ - ( \ - ReactingMultiphaseParcel, \ - 0 \ - ); \ - defineTemplateTypeNameAndDebug \ - ( \ - ReactingMultiphaseParcel, \ - 0 \ - ); \ - \ - defineParcelTypeNameAndDebug(KinematicCloud, 0); \ - defineParcelTypeNameAndDebug(ThermoCloud, 0); \ - defineParcelTypeNameAndDebug(ReactingCloud, 0); \ - defineParcelTypeNameAndDebug \ - ( \ - ReactingMultiphaseCloud, \ - 0 \ - ); - + defineParcelTypeNameAndDebug(ReactingMultiphaseParcel, 0); \ + defineTemplateTypeNameAndDebug(ReactingMultiphaseParcel, 0); \ + defineParcelTypeNameAndDebug(ReactingMultiphaseCloud, 0); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/createReactingParcelTypes.H b/src/lagrangian/intermediate/parcels/include/createReactingParcelTypes.H index a530b43f8b..fb06844c9b 100644 --- a/src/lagrangian/intermediate/parcels/include/createReactingParcelTypes.H +++ b/src/lagrangian/intermediate/parcels/include/createReactingParcelTypes.H @@ -26,39 +26,20 @@ License #ifndef createReactingParcelTypes_H #define createReactingParcelTypes_H -#include "thermoPhysicsTypes.H" +#include "ReactingParcel.H" +#include "ReactingCloud.H" + +#include "createThermoParcelTypes.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define createReactingParcelType(ParcelType) \ +#define createReactingParcelTypes(ParcelType) \ \ - createReactingParcelThermoType(ParcelType, constGasThermoPhysics); \ - createReactingParcelThermoType(ParcelType, gasThermoPhysics); \ - createReactingParcelThermoType(ParcelType, icoPoly8ThermoPhysics); - - -#define createReactingParcelThermoType(ParcelType, ThermoType) \ + createThermoParcelTypes(ParcelType); \ \ - typedef ParcelType ParcelType##ThermoType; \ - \ - defineTemplateTypeNameAndDebug(ParcelType##ThermoType, 0); \ - defineTemplateTypeNameAndDebug(Particle, 0); \ - defineTemplateTypeNameAndDebug(Cloud, 0); \ - \ - defineParcelTypeNameAndDebug(KinematicParcel, 0); \ - defineTemplateTypeNameAndDebug \ - ( \ - KinematicParcel, \ - 0 \ - ); \ - defineParcelTypeNameAndDebug(ThermoParcel, 0); \ - defineTemplateTypeNameAndDebug(ThermoParcel, 0); \ - defineParcelTypeNameAndDebug(ReactingParcel, 0); \ - defineTemplateTypeNameAndDebug(ReactingParcel, 0);\ - \ - defineParcelTypeNameAndDebug(KinematicCloud, 0); \ - defineParcelTypeNameAndDebug(ThermoCloud, 0); \ - defineParcelTypeNameAndDebug(ReactingCloud, 0); + defineParcelTypeNameAndDebug(ReactingParcel, 0); \ + defineTemplateTypeNameAndDebug(ReactingParcel, 0); \ + defineParcelTypeNameAndDebug(ReactingCloud, 0); // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/parcels/include/createThermoParcelTypes.H b/src/lagrangian/intermediate/parcels/include/createThermoParcelTypes.H new file mode 100644 index 0000000000..1cbab2a4bb --- /dev/null +++ b/src/lagrangian/intermediate/parcels/include/createThermoParcelTypes.H @@ -0,0 +1,51 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef createThermoParcelTypes_H +#define createThermoParcelTypes_H + +#include "ThermoParcel.H" +#include "ThermoCloud.H" + +#include "createKinematicParcelTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#define createThermoParcelTypes(ParcelType) \ + \ + createKinematicParcelTypes(ParcelType); \ + \ + defineParcelTypeNameAndDebug(ThermoParcel, 0); \ + defineTemplateTypeNameAndDebug(ThermoParcel, 0); \ + defineParcelTypeNameAndDebug(ThermoCloud, 0); + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // + + diff --git a/src/lagrangian/intermediate/parcels/include/makeKinematicParcelSurfaceFilmModels.H b/src/lagrangian/intermediate/parcels/include/makeParcelSurfaceFilmModels.H similarity index 94% rename from src/lagrangian/intermediate/parcels/include/makeKinematicParcelSurfaceFilmModels.H rename to src/lagrangian/intermediate/parcels/include/makeParcelSurfaceFilmModels.H index 9f695653e6..b150710a4f 100644 --- a/src/lagrangian/intermediate/parcels/include/makeKinematicParcelSurfaceFilmModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeParcelSurfaceFilmModels.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -29,11 +29,12 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "KinematicCloud.H" + #include "NoSurfaceFilm.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeKinematicParcelSurfaceFilmModels(ParcelType) \ +#define makeParcelSurfaceFilmModels(ParcelType) \ \ makeSurfaceFilmModel(KinematicCloud); \ \ @@ -44,8 +45,11 @@ License ParcelType \ ); + // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #endif // ************************************************************************* // + + diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelCompositionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelCompositionModels.H index e87b835f5d..814820d682 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelCompositionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelCompositionModels.H @@ -28,42 +28,20 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "thermoPhysicsTypes.H" -#include "ReactingCloud.H" - +#include "ReactingMultiphaseCloud.H" #include "SingleMixtureFraction.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeReactingMultiphaseCompositionModels(ParcelType) \ +#define makeReactingMultiphaseParcelCompositionModels(ParcelType) \ \ - makeReactingMultiphaseCompositionModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - makeReactingMultiphaseCompositionModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - makeReactingMultiphaseCompositionModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeReactingMultiphaseCompositionModelThermoType(ParcelType, ThermoType)\ + makeCompositionModel(ReactingCloud); \ \ - makeCompositionModel(ReactingCloud >); \ - \ - makeCompositionModelThermoType \ + makeCompositionModelType \ ( \ SingleMixtureFraction, \ ReactingCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelDevolatilisationModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelDevolatilisationModels.H index c1d14efcac..f44f9228a2 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelDevolatilisationModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelDevolatilisationModels.H @@ -28,7 +28,6 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "thermoPhysicsTypes.H" #include "ReactingMultiphaseCloud.H" #include "ConstantRateDevolatilisation.H" @@ -37,52 +36,27 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeReactingMultiphaseDevolatilisationModels(ParcelType) \ +#define makeReactingMultiphaseParcelDevolatilisationModels(ParcelType) \ \ - makeReactingMultiphaseDevolatilisationModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - makeReactingMultiphaseDevolatilisationModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - makeReactingMultiphaseDevolatilisationModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeReactingMultiphaseDevolatilisationModelThermoType(ParcelType, ThermoType)\ + makeDevolatilisationModel(ReactingMultiphaseCloud); \ \ - makeDevolatilisationModel \ - ( \ - ReactingMultiphaseCloud > \ - ); \ - \ - makeDevolatilisationModelThermoType \ + makeDevolatilisationModelType \ ( \ ConstantRateDevolatilisation, \ ReactingMultiphaseCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); \ - makeDevolatilisationModelThermoType \ + makeDevolatilisationModelType \ ( \ NoDevolatilisation, \ ReactingMultiphaseCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); \ - makeDevolatilisationModelThermoType \ + makeDevolatilisationModelType \ ( \ SingleKineticRateDevolatilisation, \ ReactingMultiphaseCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H index ca064118da..6bdc55f3bc 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelInjectionModels.H @@ -41,79 +41,51 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeReactingMultiphaseInjectionModels(ParcelType) \ +#define makeReactingMultiphaseParcelInjectionModels(ParcelType) \ \ - makeReactingMultiphaseInjectionModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ + makeInjectionModel(KinematicCloud); \ \ - makeReactingMultiphaseInjectionModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - \ - makeReactingMultiphaseInjectionModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeReactingMultiphaseInjectionModelThermoType(ParcelType, ThermoType)\ - \ - makeInjectionModel(KinematicCloud >); \ - \ - makeInjectionModelThermoType \ + makeInjectionModelType \ ( \ ConeInjection, \ KinematicCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); \ - makeInjectionModelThermoType \ + makeInjectionModelType \ ( \ ConeInjectionMP, \ KinematicCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); \ - makeInjectionModelThermoType \ + makeInjectionModelType \ ( \ FieldActivatedInjection, \ KinematicCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); \ - makeInjectionModelThermoType \ + makeInjectionModelType \ ( \ ManualInjection, \ KinematicCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); \ - makeInjectionModelThermoType \ + makeInjectionModelType \ ( \ NoInjection, \ KinematicCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); \ - makeInjectionModelThermoType \ + makeInjectionModelType \ ( \ PatchInjection, \ KinematicCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); \ - makeInjectionModelThermoType \ + makeInjectionModelType \ ( \ ReactingMultiphaseLookupTableInjection, \ KinematicCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceFilmModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceFilmModels.H deleted file mode 100644 index 92ed38da94..0000000000 --- a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceFilmModels.H +++ /dev/null @@ -1,74 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 . - -\*---------------------------------------------------------------------------*/ - -#ifndef makeReactingMultiphaseParcelSurfaceFilmModels_H -#define makeReactingMultiphaseParcelSurfaceFilmModels_H - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "thermoPhysicsTypes.H" -#include "ReactingMultiphaseCloud.H" - -#include "NoSurfaceFilm.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define makeReactingMultiphaseSurfaceFilmModels(ParcelType) \ - \ - makeReactingMultiphaseSurfaceFilmModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - makeReactingMultiphaseSurfaceFilmModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - makeReactingMultiphaseSurfaceFilmModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeReactingMultiphaseSurfaceFilmModelThermoType(ParcelType, ThermoType)\ - \ - makeSurfaceFilmModel(KinematicCloud >); \ - \ - makeSurfaceFilmModelThermoType \ - ( \ - NoSurfaceFilm, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceReactionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceReactionModels.H index 4aa621ffb4..b548fd2308 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceReactionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingMultiphaseParcelSurfaceReactionModels.H @@ -28,45 +28,20 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "thermoPhysicsTypes.H" #include "ReactingMultiphaseCloud.H" - #include "NoSurfaceReaction.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeReactingMultiphaseSurfaceReactionModels(ParcelType) \ +#define makeReactingMultiphaseParcelSurfaceReactionModels(ParcelType) \ \ - makeReactingMultiphaseSurfaceReactionModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - makeReactingMultiphaseSurfaceReactionModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - makeReactingMultiphaseSurfaceReactionModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeReactingMultiphaseSurfaceReactionModelThermoType(ParcelType, ThermoType)\ + makeSurfaceReactionModel(ReactingMultiphaseCloud); \ \ - makeSurfaceReactionModel \ - ( \ - ReactingMultiphaseCloud > \ - ); \ - \ - makeSurfaceReactionModelThermoType \ + makeSurfaceReactionModelType \ ( \ NoSurfaceReaction, \ ReactingMultiphaseCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelCollisionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelCollisionModels.H deleted file mode 100644 index 289615125f..0000000000 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelCollisionModels.H +++ /dev/null @@ -1,117 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. - \\/ 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 . - -\*---------------------------------------------------------------------------*/ - -#ifndef makeReactingParcelCollisionModels_H -#define makeReactingParcelCollisionModels_H - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "thermoPhysicsTypes.H" -#include "KinematicCloud.H" - -#include "NoCollision.H" -#include "PairCollision.H" - -#include "PairSpringSliderDashpot.H" - -#include "WallSpringSliderDashpot.H" -#include "WallLocalSpringSliderDashpot.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define makeReactingCollisionModels(ParcelType) \ - \ - makeReactingCollisionModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - \ - makeReactingCollisionModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - \ - makeReactingCollisionModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeReactingCollisionModelThermoType(ParcelType, ThermoType) \ - \ - makeCollisionModel(KinematicCloud >); \ - \ - makeCollisionModelThermoType \ - ( \ - NoCollision, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - \ - makeCollisionModelThermoType \ - ( \ - PairCollision, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - \ - makePairModel(KinematicCloud >); \ - \ - makePairModelThermoType \ - ( \ - PairSpringSliderDashpot, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - \ - makeWallModel(KinematicCloud >); \ - \ - makeWallModelThermoType \ - ( \ - WallSpringSliderDashpot, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - \ - makeWallModelThermoType \ - ( \ - WallLocalSpringSliderDashpot, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelCompositionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelCompositionModels.H index 8f8fdb7061..a9e35c7446 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelCompositionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelCompositionModels.H @@ -28,42 +28,20 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "thermoPhysicsTypes.H" #include "ReactingCloud.H" - #include "SinglePhaseMixture.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeReactingCompositionModels(ParcelType) \ +#define makeReactingParcelCompositionModels(ParcelType) \ \ - makeReactingCompositionModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - makeReactingCompositionModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - makeReactingCompositionModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeReactingCompositionModelThermoType(ParcelType, ThermoType) \ + makeCompositionModel(ReactingCloud); \ \ - makeCompositionModel(ReactingCloud >); \ - \ - makeCompositionModelThermoType \ + makeCompositionModelType \ ( \ SinglePhaseMixture, \ ReactingCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelDispersionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelDispersionModels.H deleted file mode 100644 index a010713aaf..0000000000 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelDispersionModels.H +++ /dev/null @@ -1,98 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. - \\/ 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 . - -\*---------------------------------------------------------------------------*/ - -#ifndef makeReactingParcelDispersionModels_H -#define makeReactingParcelDispersionModels_H - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "thermoPhysicsTypes.H" -#include "KinematicCloud.H" - -#include "NoDispersion.H" -#include "GradientDispersionRAS.H" -#include "StochasticDispersionRAS.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define makeReactingDispersionModels(ParcelType) \ - \ - makeReactingDispersionModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - \ - makeReactingDispersionModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - \ - makeReactingDispersionModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeReactingDispersionModelThermoType(ParcelType, ThermoType) \ - \ - makeDispersionModel(KinematicCloud >); \ - \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - DispersionRASModel > >, \ - 0 \ - ); \ - \ - makeDispersionModelThermoType \ - ( \ - NoDispersion, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makeDispersionModelThermoType \ - ( \ - GradientDispersionRAS, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makeDispersionModelThermoType \ - ( \ - StochasticDispersionRAS, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelDragModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelDragModels.H deleted file mode 100644 index 05ad04fa29..0000000000 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelDragModels.H +++ /dev/null @@ -1,82 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. - \\/ 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 . - -\*---------------------------------------------------------------------------*/ - -#ifndef makeReactingParcelDragModels_H -#define makeReactingParcelDragModels_H - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "thermoPhysicsTypes.H" -#include "KinematicCloud.H" - -#include "NoDrag.H" -#include "SphereDrag.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define makeReactingDragModels(ParcelType) \ - \ - makeReactingDragModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - makeReactingDragModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - makeReactingDragModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeReactingDragModelThermoType(ParcelType, ThermoType) \ - \ - makeDragModel(KinematicCloud >); \ - \ - makeDragModelThermoType \ - ( \ - NoDrag, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makeDragModelThermoType \ - ( \ - SphereDrag, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H deleted file mode 100644 index 864177001c..0000000000 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelHeatTransferModels.H +++ /dev/null @@ -1,82 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. - \\/ 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 . - -\*---------------------------------------------------------------------------*/ - -#ifndef makeReactingParcelHeatTransferModels_H -#define makeReactingParcelHeatTransferModels_H - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "thermoPhysicsTypes.H" -#include "ThermoCloud.H" - -#include "NoHeatTransfer.H" -#include "RanzMarshall.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define makeReactingHeatTransferModels(ParcelType) \ - \ - makeReactingHeatTransferModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - makeReactingHeatTransferModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - makeReactingHeatTransferModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeReactingHeatTransferModelThermoType(ParcelType, ThermoType) \ - \ - makeHeatTransferModel(ThermoCloud >); \ - \ - makeHeatTransferModelThermoType \ - ( \ - NoHeatTransfer, \ - ThermoCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makeHeatTransferModelThermoType \ - ( \ - RanzMarshall, \ - ThermoCloud, \ - ParcelType, \ - ThermoType \ - ); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H index cae3ea5bbc..c68403914c 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelInjectionModels.H @@ -28,7 +28,6 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "thermoPhysicsTypes.H" #include "KinematicCloud.H" #include "ConeInjection.H" @@ -41,79 +40,51 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeReactingInjectionModels(ParcelType) \ +#define makeReactingParcelInjectionModels(ParcelType) \ \ - makeReactingInjectionModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ + makeInjectionModel(KinematicCloud); \ \ - makeReactingInjectionModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - \ - makeReactingInjectionModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeReactingInjectionModelThermoType(ParcelType, ThermoType) \ - \ - makeInjectionModel(KinematicCloud >); \ - \ - makeInjectionModelThermoType \ + makeInjectionModelType \ ( \ ConeInjection, \ KinematicCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); \ - makeInjectionModelThermoType \ + makeInjectionModelType \ ( \ ConeInjectionMP, \ KinematicCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); \ - makeInjectionModelThermoType \ + makeInjectionModelType \ ( \ FieldActivatedInjection, \ KinematicCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); \ - makeInjectionModelThermoType \ + makeInjectionModelType \ ( \ ManualInjection, \ KinematicCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); \ - makeInjectionModelThermoType \ + makeInjectionModelType \ ( \ NoInjection, \ KinematicCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); \ - makeInjectionModelThermoType \ + makeInjectionModelType \ ( \ PatchInjection, \ KinematicCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); \ - makeInjectionModelThermoType \ + makeInjectionModelType \ ( \ ReactingLookupTableInjection, \ KinematicCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelPatchInteractionModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelPatchInteractionModels.H deleted file mode 100644 index b41f1ce7a4..0000000000 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelPatchInteractionModels.H +++ /dev/null @@ -1,92 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. - \\/ 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 . - -\*---------------------------------------------------------------------------*/ - -#ifndef makeReactingParcelPatchInteractionModels_H -#define makeReactingParcelPatchInteractionModels_H - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "thermoPhysicsTypes.H" -#include "KinematicCloud.H" - -#include "LocalInteraction.H" -#include "Rebound.H" -#include "StandardWallInteraction.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define makeReactingPatchInteractionModels(ParcelType) \ - \ - makeReactingPatchInteractionModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - \ - makeReactingPatchInteractionModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - \ - makeReactingPatchInteractionModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeReactingPatchInteractionModelThermoType(ParcelType, ThermoType) \ - \ - makePatchInteractionModel(KinematicCloud >); \ - \ - makePatchInteractionModelThermoType \ - ( \ - LocalInteraction, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makePatchInteractionModelThermoType \ - ( \ - Rebound, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makePatchInteractionModelThermoType \ - ( \ - StandardWallInteraction, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelPhaseChangeModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelPhaseChangeModels.H index 0505383759..e08e703fdb 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelPhaseChangeModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelPhaseChangeModels.H @@ -28,7 +28,6 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "thermoPhysicsTypes.H" #include "ReactingCloud.H" #include "NoPhaseChange.H" @@ -36,44 +35,21 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeReactingPhaseChangeModels(ParcelType) \ +#define makeReactingParcelPhaseChangeModels(ParcelType) \ \ - makeReactingPhaseChangeModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ + makePhaseChangeModel(ReactingCloud); \ \ - makeReactingPhaseChangeModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - \ - makeReactingPhaseChangeModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeReactingPhaseChangeModelThermoType(ParcelType, ThermoType) \ - \ - makePhaseChangeModel(ReactingCloud >); \ - \ - makePhaseChangeModelThermoType \ + makePhaseChangeModelType \ ( \ NoPhaseChange, \ ReactingCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); \ - makePhaseChangeModelThermoType \ + makePhaseChangeModelType \ ( \ LiquidEvaporation, \ ReactingCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); @@ -82,3 +58,4 @@ License #endif // ************************************************************************* // + diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelPostProcessingModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelPostProcessingModels.H deleted file mode 100644 index b6a900ddab..0000000000 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelPostProcessingModels.H +++ /dev/null @@ -1,84 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2008-2010 OpenCFD Ltd. - \\/ 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 . - -\*---------------------------------------------------------------------------*/ - -#ifndef makeReactingParcelPostProcessingModels_H -#define makeReactingParcelPostProcessingModels_H - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "thermoPhysicsTypes.H" -#include "KinematicCloud.H" - -#include "NoPostProcessing.H" -#include "PatchPostProcessing.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#define makeReactingPostProcessingModels(ParcelType) \ - \ - makeReactingPostProcessingModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ - \ - makeReactingPostProcessingModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - \ - makeReactingPostProcessingModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeReactingPostProcessingModelThermoType(ParcelType, ThermoType) \ - \ - makePostProcessingModel(KinematicCloud >); \ - \ - makePostProcessingModelThermoType \ - ( \ - NoPostProcessing, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); \ - makePostProcessingModelThermoType \ - ( \ - PatchPostProcessing, \ - KinematicCloud, \ - ParcelType, \ - ThermoType \ - ); - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/parcels/include/makeReactingParcelSurfaceFilmModels.H b/src/lagrangian/intermediate/parcels/include/makeReactingParcelSurfaceFilmModels.H index b2b1bf2d89..a7ae4e064e 100644 --- a/src/lagrangian/intermediate/parcels/include/makeReactingParcelSurfaceFilmModels.H +++ b/src/lagrangian/intermediate/parcels/include/makeReactingParcelSurfaceFilmModels.H @@ -28,7 +28,6 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#include "thermoPhysicsTypes.H" #include "KinematicCloud.H" #include "NoSurfaceFilm.H" @@ -36,44 +35,21 @@ License // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -#define makeReactingSurfaceFilmModels(ParcelType) \ +#define makeReactingParcelSurfaceFilmModels(ParcelType) \ \ - makeReactingSurfaceFilmModelThermoType \ - ( \ - ParcelType, \ - constGasThermoPhysics \ - ); \ + makeSurfaceFilmModel(KinematicCloud); \ \ - makeReactingSurfaceFilmModelThermoType \ - ( \ - ParcelType, \ - gasThermoPhysics \ - ); \ - \ - makeReactingSurfaceFilmModelThermoType \ - ( \ - ParcelType, \ - icoPoly8ThermoPhysics \ - ); - - -#define makeReactingSurfaceFilmModelThermoType(ParcelType, ThermoType) \ - \ - makeSurfaceFilmModel(KinematicCloud >); \ - \ - makeSurfaceFilmModelThermoType \ + makeSurfaceFilmModelType \ ( \ NoSurfaceFilm, \ KinematicCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); \ - makeSurfaceFilmModelThermoType \ + makeSurfaceFilmModelType \ ( \ ThermoSurfaceFilm, \ KinematicCloud, \ - ParcelType, \ - ThermoType \ + ParcelType \ ); diff --git a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.H b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.H index fc6f9a4886..4ff1cc0000 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/CollisionModel/CollisionModel/CollisionModel.H @@ -172,21 +172,6 @@ public: add##SS##CloudType##ParcelType##ConstructorToTable_; -#define makeCollisionModelThermoType(SS, CloudType, ParcelType, ThermoType) \ - \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - SS > >, \ - 0 \ - ); \ - \ - CollisionModel > >:: \ - adddictionaryConstructorToTable \ - > > > \ - add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; - - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "CollisionModelI.H" diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModel.H b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModel.H index 68ebe671c1..b1634db21e 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/DispersionModel/DispersionModel/DispersionModel.H @@ -162,20 +162,6 @@ public: add##SS##CloudType##ParcelType##ConstructorToTable_; -#define makeDispersionModelThermoType(SS, CloudType, ParcelType, ThermoType) \ - \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - SS > >, \ - 0 \ - ); \ - \ - DispersionModel > >:: \ - adddictionaryConstructorToTable \ - > > > \ - add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository diff --git a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.H b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.H index 67d0e36f94..e60126e1d0 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/DragModel/DragModel/DragModel.H @@ -147,20 +147,6 @@ public: add##SS##CloudType##ParcelType##ConstructorToTable_; -#define makeDragModelThermoType(SS, CloudType, ParcelType, ThermoType) \ - \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - SS > >, \ - 0 \ - ); \ - \ - DragModel > >:: \ - adddictionaryConstructorToTable \ - > > > \ - add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H index ad3d4b1dae..b40abbde90 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.H @@ -357,21 +357,6 @@ public: add##SS##CloudType##ParcelType##ConstructorToTable_; -#define makeInjectionModelThermoType(SS, CloudType, ParcelType, ThermoType) \ - \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - SS > >, \ - 0 \ - ); \ - \ - InjectionModel > >:: \ - adddictionaryConstructorToTable \ - > > > \ - add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; - - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "InjectionModelI.H" diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H index 95a4b04f99..1bd1684773 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.H @@ -187,20 +187,6 @@ public: add##SS##CloudType##ParcelType##ConstructorToTable_; -#define makePatchInteractionModelThermoType(SS, CloudType, ParcelType, ThermoType)\ - \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - SS > >, \ - 0 \ - ); \ - \ - PatchInteractionModel > >:: \ - adddictionaryConstructorToTable \ - > > > \ - add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModel.H b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModel.H index 8942dec879..0d503bbdc5 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/PostProcessingModel/PostProcessingModel/PostProcessingModel.H @@ -177,20 +177,6 @@ public: add##SS##CloudType##ParcelType##ConstructorToTable_; -#define makePostProcessingModelThermoType(SS, CloudType, ParcelType, ThermoType)\ - \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - SS > >, \ - 0 \ - ); \ - \ - PostProcessingModel > >:: \ - adddictionaryConstructorToTable \ - > > > \ - add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "PostProcessingModelI.H" diff --git a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H index 2ba518788f..986bd943d8 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H +++ b/src/lagrangian/intermediate/submodels/Kinematic/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H @@ -263,21 +263,6 @@ public: add##SS##CloudType##ParcelType##ConstructorToTable_; -#define makeSurfaceFilmModelThermoType(SS, CloudType, ParcelType, ThermoType) \ - \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - SS > >, \ - 0 \ - ); \ - \ - SurfaceFilmModel > >:: \ - adddictionaryConstructorToTable \ - > > > \ - add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; - - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #include "SurfaceFilmModelI.H" diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C index e1a3a54f4e..7ce1c6d3c0 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C @@ -38,33 +38,13 @@ Foam::CompositionModel::CompositionModel dict_(dict), owner_(owner), coeffDict_(dict.subDict(type + "Coeffs")), - mcCarrierThermo_(owner.mcCarrierThermo()), - liquids_ - ( - liquidMixture::New - ( - owner.mesh().objectRegistry::lookupObject - ( - owner.carrierThermo().name() - ) - ) - ), - solids_ - ( - solidMixture::New - ( - owner.mesh().objectRegistry::lookupObject - ( - owner.carrierThermo().name() - ) - ) - ), + thermo_(owner.thermo()), phaseProps_ ( coeffDict_.lookup("phases"), - mcCarrierThermo_.species(), - liquids_().components(), - solids_().components() + thermo_.carrier().species(), + thermo_.liquids().components(), + thermo_.solids().components() ) {} @@ -100,24 +80,31 @@ const Foam::dictionary& Foam::CompositionModel::coeffDict() const template -const Foam::multiComponentMixture& -Foam::CompositionModel::mcCarrierThermo() const +const Foam::SLGThermo& Foam::CompositionModel::thermo() const { - return mcCarrierThermo_; + return thermo_; +} + + +template +const Foam::basicMultiComponentMixture& +Foam::CompositionModel::carrier() const +{ + return thermo_.carrier(); } template const Foam::liquidMixture& Foam::CompositionModel::liquids() const { - return liquids_(); + return thermo_.liquids(); } template const Foam::solidMixture& Foam::CompositionModel::solids() const { - return solids_(); + return thermo_.solids(); } @@ -137,8 +124,7 @@ Foam::label Foam::CompositionModel::nPhase() const template -const Foam::wordList& -Foam::CompositionModel::phaseTypes() const +const Foam::wordList& Foam::CompositionModel::phaseTypes() const { // if only 1 phase, return the constituent component names if (phaseProps_.size() == 1) @@ -153,8 +139,7 @@ Foam::CompositionModel::phaseTypes() const template -const Foam::wordList& -Foam::CompositionModel::stateLabels() const +const Foam::wordList& Foam::CompositionModel::stateLabels() const { return phaseProps_.stateLabels(); } @@ -174,24 +159,22 @@ Foam::label Foam::CompositionModel::globalCarrierId const word& cmptName ) const { - forAll(mcCarrierThermo_.species(), i) + label id = thermo_.carrierId(cmptName); + + if (id < 0) { - if (cmptName == mcCarrierThermo_.species()[i]) - { - return i; - } + FatalErrorIn + ( + "Foam::label Foam::CompositionModel::globalCarrierId" + "(" + "const word&" + ") const" + ) << "Unable to determine global id for requested component " + << cmptName << ". Available components are " << nl + << thermo_.carrier().species() << abort(FatalError); } - FatalErrorIn - ( - "Foam::label Foam::CompositionModel::globalCarrierId" - "(" - "const word&" - ") const" - ) << "Unable to determine global id for requested component " - << cmptName << nl << abort(FatalError); - - return -1; + return id; } @@ -214,7 +197,7 @@ Foam::label Foam::CompositionModel::globalId "const word&" ") const" ) << "Unable to determine global id for requested component " - << cmptName << nl << abort(FatalError); + << cmptName << abort(FatalError); } return id; @@ -250,7 +233,7 @@ Foam::label Foam::CompositionModel::localId "const word&" ") const" ) << "Unable to determine local id for component " << cmptName - << nl << abort(FatalError); + << abort(FatalError); } return id; @@ -278,7 +261,7 @@ Foam::label Foam::CompositionModel::localToGlobalCarrierId ") const" ) << "Unable to determine global carrier id for phase " << phaseI << " with local id " << id - << nl << abort(FatalError); + << abort(FatalError); } return gid; @@ -312,8 +295,8 @@ Foam::scalarField Foam::CompositionModel::X forAll(Y, i) { label gid = props.globalIds()[i]; - WInv += Y[i]/mcCarrierThermo_.speciesData()[gid].W(); - X[i] = Y[i]/mcCarrierThermo_.speciesData()[gid].W(); + WInv += Y[i]/thermo_.carrier().W(gid); + X[i] = Y[i]/thermo_.carrier().W(gid); } break; } @@ -322,8 +305,8 @@ Foam::scalarField Foam::CompositionModel::X forAll(Y, i) { label gid = props.globalIds()[i]; - WInv += Y[i]/this->liquids().properties()[gid].W(); - X[i] += Y[i]/this->liquids().properties()[gid].W(); + WInv += Y[i]/thermo_.liquids().properties()[gid].W(); + X[i] += Y[i]/thermo_.liquids().properties()[gid].W(); } break; } @@ -337,7 +320,7 @@ Foam::scalarField Foam::CompositionModel::X "const scalarField&" ") const" ) << "Only possible to convert gas and liquid mass fractions" - << nl << abort(FatalError); + << abort(FatalError); } } @@ -363,7 +346,7 @@ Foam::scalar Foam::CompositionModel::H forAll(Y, i) { label gid = props.globalIds()[i]; - HMixture += Y[i]*mcCarrierThermo_.speciesData()[gid].H(T); + HMixture += Y[i]*thermo_.carrier().H(gid, T); } break; } @@ -372,7 +355,7 @@ Foam::scalar Foam::CompositionModel::H forAll(Y, i) { label gid = props.globalIds()[i]; - HMixture += Y[i]*this->liquids().properties()[gid].h(p, T); + HMixture += Y[i]*thermo_.liquids().properties()[gid].h(p, T); } break; } @@ -384,8 +367,8 @@ Foam::scalar Foam::CompositionModel::H HMixture += Y[i] *( - this->solids().properties()[gid].Hf() - + this->solids().properties()[gid].cp()*T + thermo_.solids().properties()[gid].Hf() + + thermo_.solids().properties()[gid].cp()*T ); } break; @@ -401,7 +384,7 @@ Foam::scalar Foam::CompositionModel::H " const scalar, " " const scalar" ") const" - ) << "Unknown phase enumeration" << nl << abort(FatalError); + ) << "Unknown phase enumeration" << abort(FatalError); } } @@ -427,7 +410,7 @@ Foam::scalar Foam::CompositionModel::Hs forAll(Y, i) { label gid = props.globalIds()[i]; - HsMixture += Y[i]*mcCarrierThermo_.speciesData()[gid].Hs(T); + HsMixture += Y[i]*thermo_.carrier().Hs(gid, T); } break; } @@ -439,8 +422,8 @@ Foam::scalar Foam::CompositionModel::Hs HsMixture += Y[i] *( - this->liquids().properties()[gid].h(p, T) - - this->liquids().properties()[gid].h(p, 298.25) + thermo_.liquids().properties()[gid].h(p, T) + - thermo_.liquids().properties()[gid].h(p, 298.15) ); } break; @@ -450,7 +433,7 @@ Foam::scalar Foam::CompositionModel::Hs forAll(Y, i) { label gid = props.globalIds()[i]; - HsMixture += Y[i]*this->solids().properties()[gid].cp()*T; + HsMixture += Y[i]*thermo_.solids().properties()[gid].cp()*T; } break; } @@ -465,7 +448,7 @@ Foam::scalar Foam::CompositionModel::Hs " const scalar, " " const scalar" ") const" - ) << "Unknown phase enumeration" << nl << abort(FatalError); + ) << "Unknown phase enumeration" << abort(FatalError); } } @@ -491,7 +474,7 @@ Foam::scalar Foam::CompositionModel::Hc forAll(Y, i) { label gid = props.globalIds()[i]; - HcMixture += Y[i]*mcCarrierThermo_.speciesData()[gid].Hc(); + HcMixture += Y[i]*thermo_.carrier().Hc(gid); } break; } @@ -501,7 +484,7 @@ Foam::scalar Foam::CompositionModel::Hc { label gid = props.globalIds()[i]; HcMixture += - Y[i]*this->liquids().properties()[gid].h(p, 298.15); + Y[i]*thermo_.liquids().properties()[gid].h(p, 298.15); } break; } @@ -510,7 +493,7 @@ Foam::scalar Foam::CompositionModel::Hc forAll(Y, i) { label gid = props.globalIds()[i]; - HcMixture += Y[i]*this->solids().properties()[gid].Hf(); + HcMixture += Y[i]*thermo_.solids().properties()[gid].Hf(); } break; } @@ -525,7 +508,7 @@ Foam::scalar Foam::CompositionModel::Hc " const scalar, " " const scalar" ") const" - ) << "Unknown phase enumeration" << nl << abort(FatalError); + ) << "Unknown phase enumeration" << abort(FatalError); } } @@ -551,7 +534,7 @@ Foam::scalar Foam::CompositionModel::cp forAll(Y, i) { label gid = props.globalIds()[i]; - cpMixture += Y[i]*mcCarrierThermo_.speciesData()[gid].Cp(T); + cpMixture += Y[i]*thermo_.carrier().Cp(gid, T); } break; } @@ -560,7 +543,7 @@ Foam::scalar Foam::CompositionModel::cp forAll(Y, i) { label gid = props.globalIds()[i]; - cpMixture += Y[i]*this->liquids().properties()[gid].cp(p, T); + cpMixture += Y[i]*thermo_.liquids().properties()[gid].cp(p, T); } break; } @@ -569,7 +552,7 @@ Foam::scalar Foam::CompositionModel::cp forAll(Y, i) { label gid = props.globalIds()[i]; - cpMixture += Y[i]*this->solids().properties()[gid].cp(); + cpMixture += Y[i]*thermo_.solids().properties()[gid].cp(); } break; } @@ -584,7 +567,7 @@ Foam::scalar Foam::CompositionModel::cp "const scalar, " "const scalar" ") const" - ) << "Unknown phase enumeration" << nl << abort(FatalError); + ) << "Unknown phase enumeration" << abort(FatalError); } } @@ -627,7 +610,7 @@ Foam::scalar Foam::CompositionModel::L forAll(Y, i) { label gid = props.globalIds()[i]; - LMixture += Y[i]*this->liquids().properties()[gid].hl(p, T); + LMixture += Y[i]*thermo_.liquids().properties()[gid].hl(p, T); } break; } @@ -659,7 +642,7 @@ Foam::scalar Foam::CompositionModel::L "const scalar, " "const scalar" ") const" - ) << "Unknown phase enumeration" << nl << abort(FatalError); + ) << "Unknown phase enumeration" << abort(FatalError); } } diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H index 3c05f8e261..bff960c2ed 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H @@ -43,10 +43,7 @@ SourceFiles #include "runTimeSelectionTables.H" #include "PtrList.H" -#include "multiComponentMixture.H" - -#include "liquidMixture.H" -#include "solidMixture.H" +#include "SLGThermo.H" #include "phasePropertiesList.H" @@ -73,14 +70,8 @@ class CompositionModel //- The coefficients dictionary const dictionary& coeffDict_; - //- Reference to the multi-component carrier phase thermo - multiComponentMixture& mcCarrierThermo_; - - //- Global (additional) liquid properties data - autoPtr liquids_; - - //- Global (additional) solid properties data - autoPtr solids_; + //- Reference to the thermo database + const SLGThermo& thermo_; //- List of phase properties phasePropertiesList phaseProps_; @@ -141,13 +132,15 @@ public: //- Return the coefficients dictionary const dictionary& coeffDict() const; - //- Return the carrier phase thermo package - const multiComponentMixture& - mcCarrierThermo() const; + //- Return the thermo database + const SLGThermo& thermo() const; // Composition lists + //- Return the carrier components (wrapper function) + const basicMultiComponentMixture& carrier() const; + //- Return the global (additional) liquids const liquidMixture& liquids() const; @@ -197,11 +190,7 @@ public: //- Return the list of phase phaseI volume fractions fractions // based on supplied mass fractions Y - scalarField X - ( - const label phaseI, - const scalarField& Y - ) const; + scalarField X(const label phaseI, const scalarField& Y) const; // Mixture properties @@ -293,18 +282,13 @@ public: ); -#define makeCompositionModelThermoType(SS, CloudType, ParcelType, ThermoType) \ +#define makeCompositionModelType(SS, CloudType, ParcelType) \ \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - SS > >, \ - 0 \ - ); \ + defineNamedTemplateTypeNameAndDebug(SS >, 0); \ \ - CompositionModel > >:: \ - adddictionaryConstructorToTable \ - > > > \ - add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; + CompositionModel >:: \ + adddictionaryConstructorToTable > > \ + add##SS##CloudType##ParcelType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SingleMixtureFraction/SingleMixtureFraction.C b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SingleMixtureFraction/SingleMixtureFraction.C index 16f577f7a7..76abdaf2ff 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SingleMixtureFraction/SingleMixtureFraction.C +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SingleMixtureFraction/SingleMixtureFraction.C @@ -64,19 +64,19 @@ void Foam::SingleMixtureFraction::constructIds() { FatalErrorIn("Foam::SingleMixtureFraction::constructIds()") << "No gas phase found in phase list:" << nl - << this->phaseTypes() << nl << endl; + << this->phaseTypes() << exit(FatalError); } if (idLiquid_ < 0) { FatalErrorIn("Foam::SingleMixtureFraction::constructIds()") << "No liquid phase found in phase list:" << nl - << this->phaseTypes() << nl << endl; + << this->phaseTypes() << exit(FatalError); } if (idSolid_ < 0) { FatalErrorIn("Foam::SingleMixtureFraction::constructIds()") << "No solid phase found in phase list:" << nl - << this->phaseTypes() << nl << endl; + << this->phaseTypes() << exit(FatalError); } } @@ -111,7 +111,7 @@ Foam::SingleMixtureFraction::SingleMixtureFraction "CloudType&" ")" ) << "Incorrect numebr of phases: " << nl - << " Please specify 1 gas, 1 liquid and 1 solid" << nl + << " Please specify 1 gas, 1 liquid and 1 solid" << exit(FatalError); } @@ -130,7 +130,7 @@ Foam::SingleMixtureFraction::SingleMixtureFraction "CloudType&" ")" ) << "Sum of phases should be 1. Phase fractions:" << nl - << YMixture0_ << nl << exit(FatalError); + << YMixture0_ << exit(FatalError); } } diff --git a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SinglePhaseMixture/SinglePhaseMixture.C b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SinglePhaseMixture/SinglePhaseMixture.C index 4c0f3f332e..f1fd80384d 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SinglePhaseMixture/SinglePhaseMixture.C +++ b/src/lagrangian/intermediate/submodels/Reacting/CompositionModel/SinglePhaseMixture/SinglePhaseMixture.C @@ -35,14 +35,14 @@ void Foam::SinglePhaseMixture::constructIds() FatalErrorIn ( "void Foam::SinglePhaseMixture::constructIds()" - ) << "Phase list is empty" << nl << exit(FatalError); + ) << "Phase list is empty" << exit(FatalError); } else if (this->phaseProps().size() > 1) { FatalErrorIn ( "void Foam::SinglePhaseMixture::constructIds()" - ) << "Only one phase permitted" << nl << exit(FatalError); + ) << "Only one phase permitted" << exit(FatalError); } switch (this->phaseProps()[0].phase()) @@ -67,7 +67,7 @@ void Foam::SinglePhaseMixture::constructIds() FatalErrorIn ( "void Foam::SinglePhaseMixture::constructIds()" - ) << "Unknown phase enumeration" << nl << abort(FatalError); + ) << "Unknown phase enumeration" << abort(FatalError); } } } diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C index 45a8b67d55..fc7673f8a2 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C @@ -37,13 +37,13 @@ Foam::scalarField Foam::LiquidEvaporation::calcXc const label cellI ) const { - scalarField Xc(this->owner().mcCarrierThermo().Y().size()); + scalarField Xc(this->owner().thermo().carrier().Y().size()); forAll(Xc, i) { Xc[i] = - this->owner().mcCarrierThermo().Y()[i][cellI] - /this->owner().mcCarrierThermo().speciesData()[i].W(); + this->owner().thermo().carrier().Y()[i][cellI] + /this->owner().thermo().carrier().W(i); } return Xc/sum(Xc); @@ -71,16 +71,7 @@ Foam::LiquidEvaporation::LiquidEvaporation ) : PhaseChangeModel(dict, owner, typeName), - liquids_ - ( - liquidMixture::New - ( - owner.mesh().objectRegistry::lookupObject - ( - owner.carrierThermo().name() - ) - ) - ), + liquids_(owner.thermo().liquids()), activeLiquids_(this->coeffDict().lookup("activeLiquids")), liqToCarrierMap_(activeLiquids_.size(), -1), liqToLiqMap_(activeLiquids_.size(), -1) @@ -158,7 +149,7 @@ void Foam::LiquidEvaporation::calculate label lid = liqToLiqMap_[i]; // vapour diffusivity [m2/s] - scalar Dab = liquids_->properties()[lid].D(pc, Ts); + scalar Dab = liquids_.properties()[lid].D(pc, Ts); // saturation pressure for species i [pa] // - carrier phase pressure assumed equal to the liquid vapour pressure @@ -166,7 +157,7 @@ void Foam::LiquidEvaporation::calculate // NOTE: if pSat > pc then particle is superheated // calculated evaporation rate will be greater than that of a particle // at boiling point, but this is not a boiling model - scalar pSat = liquids_->properties()[lid].pv(pc, T); + scalar pSat = liquids_.properties()[lid].pv(pc, T); // Schmidt number scalar Sc = nu/(Dab + ROOTVSMALL); @@ -187,7 +178,7 @@ void Foam::LiquidEvaporation::calculate scalar Ni = max(kc*(Cs - Cinf), 0.0); // mass transfer [kg] - dMassPC[lid] += Ni*A*liquids_->properties()[lid].W()*dt; + dMassPC[lid] += Ni*A*liquids_.properties()[lid].W()*dt; } } diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H index a7d7cdd3d1..bef4d3e888 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.H @@ -54,7 +54,7 @@ protected: // Protected data //- Global liquid properties data - autoPtr liquids_; + const liquidMixture& liquids_; //- List of active liquid names List activeLiquids_; diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H index 99e39651f7..a216409d33 100644 --- a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/PhaseChangeModel/PhaseChangeModel.H @@ -191,18 +191,13 @@ public: ); -#define makePhaseChangeModelThermoType(SS, CloudType, ParcelType, ThermoType) \ +#define makePhaseChangeModelType(SS, CloudType, ParcelType) \ \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - SS > >, \ - 0 \ - ); \ + defineNamedTemplateTypeNameAndDebug(SS >, 0); \ \ - PhaseChangeModel > >:: \ - adddictionaryConstructorToTable \ - > > > \ - add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; + PhaseChangeModel >:: \ + adddictionaryConstructorToTable > > \ + add##SS##CloudType##ParcelType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H index e5572dd884..21c6b79594 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/DevolatilisationModel/DevolatilisationModel/DevolatilisationModel.H @@ -159,18 +159,13 @@ public: ); -#define makeDevolatilisationModelThermoType(SS, CloudType, ParcelType, ThermoType)\ +#define makeDevolatilisationModelType(SS, CloudType, ParcelType) \ \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - SS > >, \ - 0 \ - ); \ + defineNamedTemplateTypeNameAndDebug(SS >, 0); \ \ - DevolatilisationModel > >:: \ - adddictionaryConstructorToTable \ - > > > \ - add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; + DevolatilisationModel >:: \ + adddictionaryConstructorToTable > > \ + add##SS##CloudType##ParcelType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModel.H b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModel.H index a2a0d3c1eb..8ee2fb1874 100644 --- a/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModel.H +++ b/src/lagrangian/intermediate/submodels/ReactingMultiphase/SurfaceReactionModel/SurfaceReactionModel/SurfaceReactionModel.H @@ -171,18 +171,13 @@ public: ); -#define makeSurfaceReactionModelThermoType(SS, CloudType, ParcelType, ThermoType)\ +#define makeSurfaceReactionModelType(SS, CloudType, ParcelType) \ \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - SS > >, \ - 0 \ - ); \ + defineNamedTemplateTypeNameAndDebug(SS >, 0); \ \ - SurfaceReactionModel > >:: \ - adddictionaryConstructorToTable \ - > > > \ - add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; + SurfaceReactionModel >:: \ + adddictionaryConstructorToTable > > \ + add##SS##CloudType##ParcelType##ConstructorToTable_; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H index a71af0d37e..de10004531 100644 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H +++ b/src/lagrangian/intermediate/submodels/Thermodynamic/HeatTransferModel/HeatTransferModel/HeatTransferModel.H @@ -179,20 +179,6 @@ public: add##SS##CloudType##ParcelType##ConstructorToTable_; -#define makeHeatTransferModelThermoType(SS, CloudType, ParcelType, ThermoType)\ - \ - defineNamedTemplateTypeNameAndDebug \ - ( \ - SS > >, \ - 0 \ - ); \ - \ - HeatTransferModel > >:: \ - adddictionaryConstructorToTable \ - > > > \ - add##SS##CloudType##ParcelType##ThermoType##ConstructorToTable_; - - // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // #ifdef NoRepository diff --git a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilmI.H b/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilmI.H deleted file mode 100644 index aeebf2c418..0000000000 --- a/src/lagrangian/intermediate/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilmI.H +++ /dev/null @@ -1,135 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "ThermoSurfaceFilm.H" -#include "DimensionedFields.H" - -// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // - -template -inline const Foam::word& -Foam::ThermoSurfaceFilm::filmRegionName() const -{ - return filmRegionName_; -} - - -template -inline const Foam::wordList& -Foam::ThermoSurfaceFilm::patchNames() const -{ - return patchNames_; -} - - -template -inline const Foam::polyMesh& -Foam::ThermoSurfaceFilm::filmRegion() const -{ - return filmRegion_; -} - - -template -inline const Foam::volScalarField& -Foam::ThermoSurfaceFilm::hf() const -{ - return hf_; -} - - -template -inline const Foam::volScalarField& -Foam::ThermoSurfaceFilm::rho() const -{ - return rho_; -} - - -template -inline const Foam::volVectorField& -Foam::ThermoSurfaceFilm::U() const -{ - return U_; -} - - -template -inline const Foam::volScalarField& -Foam::ThermoSurfaceFilm::p() const -{ - return p_; -} - - -template -inline const Foam::volScalarField& -Foam::ThermoSurfaceFilm::h() const -{ - return h_; -} - - -template -inline const Foam::volScalarField& -Foam::ThermoSurfaceFilm::mu() const -{ - return mu_; -} - - -template -inline Foam::DimensionedField& -Foam::ThermoSurfaceFilm::rhoSp() -{ - return rhoSp_; -} - - -template -inline Foam::DimensionedField& -Foam::ThermoSurfaceFilm::USp() -{ - return USp_; -} - - -template -inline Foam::DimensionedField& -Foam::ThermoSurfaceFilm::hSp() -{ - return hSp_; -} - - -template -inline Foam::DimensionedField& -Foam::ThermoSurfaceFilm::pSp() -{ - return pSp_; -} - - -// ************************************************************************* // diff --git a/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C b/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C index 468b870d86..53587d1eb4 100644 --- a/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C +++ b/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.C @@ -46,10 +46,10 @@ Foam::SLGThermo::SLGThermo(const fvMesh& mesh, basicThermo& thermo) { Info<< "Creating component thermo properties:" << endl; - if (isA(thermo)) + if (isA(thermo)) { - basicMultiComponentMixtureNew& mcThermo = - dynamic_cast(thermo); + basicMultiComponentMixture& mcThermo = + dynamic_cast(thermo); carrier_ = &mcThermo; Info<< " multi-component carrier - " << mcThermo.species().size() @@ -98,13 +98,13 @@ const Foam::basicThermo& Foam::SLGThermo::thermo() const } -const Foam::basicMultiComponentMixtureNew& Foam::SLGThermo::carrier() const +const Foam::basicMultiComponentMixture& Foam::SLGThermo::carrier() const { if (carrier_ == NULL) { FatalErrorIn ( - "const Foam::basicMultiComponentMixtureNew& " + "const Foam::basicMultiComponentMixture& " "Foam::SLGThermo::carrier() const" ) << "carrier requested, but object is not allocated" << abort(FatalError); diff --git a/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.H b/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.H index 91989a0123..7a3b520171 100644 --- a/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.H +++ b/src/thermophysicalModels/SLGThermo/SLGThermo/SLGThermo.H @@ -48,7 +48,7 @@ SourceFiles #include "MeshObject.H" #include "basicThermo.H" -#include "basicMultiComponentMixtureNew.H" +#include "basicMultiComponentMixture.H" #include "liquidMixture.H" #include "solidMixture.H" @@ -71,7 +71,7 @@ class SLGThermo basicThermo& thermo_; //- Reference to the multi-component carrier phase thermo - basicMultiComponentMixtureNew* carrier_; + basicMultiComponentMixture* carrier_; //- Additional liquid properties data autoPtr liquids_; @@ -103,7 +103,7 @@ public: const basicThermo& thermo() const; //- Return reference to the gaseous components - const basicMultiComponentMixtureNew& carrier() const; + const basicMultiComponentMixture& carrier() const; //- Return reference to the global (additional) liquids const liquidMixture& liquids() const; From c537c68e05493f8c63c72d8522cd2688d8381f45 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 6 Sep 2010 17:23:52 +0100 Subject: [PATCH 09/29] ENH: Updated reactingParcelFilmFoam solver due to lib changes --- .../solvers/lagrangian/reactingParcelFilmFoam/Make/options | 4 ++-- .../solvers/lagrangian/reactingParcelFilmFoam/createClouds.H | 4 ++-- .../solvers/lagrangian/reactingParcelFilmFoam/createFields.H | 2 ++ .../reactingParcelFilmFoam/reactingParcelFilmFoam.C | 3 ++- 4 files changed, 8 insertions(+), 5 deletions(-) diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options b/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options index 8b15c3e9ae..230a08dfad 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/Make/options @@ -1,5 +1,3 @@ -DEV_PATH=./../.. - EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I${LIB_SRC}/meshTools/lnInclude \ @@ -13,6 +11,7 @@ EXE_INC = \ -I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/thermophysicalFunctions/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/chemistryModel/lnInclude \ -I$(LIB_SRC)/thermophysicalModels/radiation/lnInclude \ -I$(LIB_SRC)/surfaceFilmModels/lnInclude \ @@ -31,6 +30,7 @@ EXE_LIBS = \ -lsolidMixture \ -lthermophysicalFunctions \ -lreactionThermophysicalModels \ + -lSLGThermo \ -lchemistryModel \ -lradiation \ -lsurfaceFilmModels \ diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/createClouds.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/createClouds.H index f3e043143c..c568be12a1 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/createClouds.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/createClouds.H @@ -1,9 +1,9 @@ Info<< "\nConstructing reacting cloud" << endl; -thermoReactingCloud parcels +basicReactingCloud parcels ( "reactingCloud1", rho, U, g, - thermo + slgThermo ); diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H index 909d0351f7..2e3208b0ee 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/createFields.H @@ -8,6 +8,8 @@ hsCombustionThermo& thermo = chemistry.thermo(); + SLGThermo slgThermo(mesh, thermo); + basicMultiComponentMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); diff --git a/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C b/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C index f39d8f070a..f788da57e4 100644 --- a/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C +++ b/applications/solvers/lagrangian/reactingParcelFilmFoam/reactingParcelFilmFoam.C @@ -33,11 +33,12 @@ Description #include "fvCFD.H" #include "hCombustionThermo.H" #include "turbulenceModel.H" -#include "BasicReactingCloud.H" +#include "basicReactingCloud.H" #include "surfaceFilmModel.H" #include "psiChemistryModel.H" #include "chemistrySolver.H" #include "radiationModel.H" +#include "SLGThermo.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // From 68f3940b40dc4adc8af20af21ef7d0dd4ac566f2 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 6 Sep 2010 17:24:55 +0100 Subject: [PATCH 10/29] ENH: added SLGThermo to thermophysicalModels Allwmake --- src/thermophysicalModels/Allwmake | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/thermophysicalModels/Allwmake b/src/thermophysicalModels/Allwmake index a12ce3ea19..07ac10719b 100755 --- a/src/thermophysicalModels/Allwmake +++ b/src/thermophysicalModels/Allwmake @@ -18,6 +18,8 @@ wmake libso radiation wmake libso barotropicCompressibilityModel wmake libso thermalPorousZone +wmake libso SLGThermo + # Should be combined with solids&solidMixture wmake libso basicSolidThermo From d67d23278ef35e988b78f0e57ea04f1de4b45359 Mon Sep 17 00:00:00 2001 From: andy Date: Mon, 6 Sep 2010 17:27:12 +0100 Subject: [PATCH 11/29] ENH: Removed cloud injection surface film model --- .../injection/cloudInjection/cloudInjection.C | 118 --------------- .../injection/cloudInjection/cloudInjection.H | 142 ------------------ .../cloudInjection/cloudInjectionI.H | 44 ------ 3 files changed, 304 deletions(-) delete mode 100644 src/lagrangian/intermediate/submodels/addOns/surfaceFilmModel/injection/cloudInjection/cloudInjection.C delete mode 100644 src/lagrangian/intermediate/submodels/addOns/surfaceFilmModel/injection/cloudInjection/cloudInjection.H delete mode 100644 src/lagrangian/intermediate/submodels/addOns/surfaceFilmModel/injection/cloudInjection/cloudInjectionI.H diff --git a/src/lagrangian/intermediate/submodels/addOns/surfaceFilmModel/injection/cloudInjection/cloudInjection.C b/src/lagrangian/intermediate/submodels/addOns/surfaceFilmModel/injection/cloudInjection/cloudInjection.C deleted file mode 100644 index 8f41c43758..0000000000 --- a/src/lagrangian/intermediate/submodels/addOns/surfaceFilmModel/injection/cloudInjection/cloudInjection.C +++ /dev/null @@ -1,118 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "cloudInjection.H" -#include "addToRunTimeSelectionTable.H" -#include "fvMesh.H" -#include "Time.H" -#include "mathematicalConstants.H" -#include "Random.H" -#include "volFields.H" - -using namespace Foam::constant; - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace surfaceFilmModels - { - defineTypeNameAndDebug(cloudInjection, 0); - addToRunTimeSelectionTable(injectionModel, cloudInjection, dictionary); - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::cloudInjection::cloudInjection -( - const surfaceFilmModel& owner, - const dictionary& dict -) -: - injectionModel(type(), owner, dict), - cloudName_(coeffs_.lookup("cloudName")), - cloud_ - ( - const_cast - ( - owner.mesh().lookupObject(cloudName_) - ) - ), - particlesPerParcel_(readScalar(coeffs_.lookup("particlesPerParcel"))), - rndGen_(label(0)), - parcelPDF_(pdfs::pdf::New(coeffs_.subDict("parcelPDF"), rndGen_)), - diameter_(owner.film().nCells(), 0.0) -{ - forAll(diameter_, faceI) - { - diameter_[faceI] = parcelPDF_->sample(); - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -Foam::surfaceFilmModels::cloudInjection::~cloudInjection() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -void Foam::surfaceFilmModels::cloudInjection::correct -( - scalarField& massToInject, - scalarField& diameterToInject -) -{ - const scalarField& rhoFilm = owner().rho(); - - // Collect the data to be transferred - forAll(massToInject, cellI) - { - scalar rho = rhoFilm[cellI]; - scalar diam = diameter_[cellI]; - scalar minMass = particlesPerParcel_*rho*mathematical::pi/6*pow3(diam); - - if (massToInject[cellI] > minMass) - { - // All mass can be injected - set particle diameter - diameterToInject[cellI] = diameter_[cellI]; - - // Retrieve new particle diameter sample - diameter_[cellI] = parcelPDF_->sample(); - } - else - { - // Mass below minimum threshold - cannot be injected - massToInject[cellI] = 0.0; - diameterToInject[cellI] = -1.0; - } - } -} - - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/addOns/surfaceFilmModel/injection/cloudInjection/cloudInjection.H b/src/lagrangian/intermediate/submodels/addOns/surfaceFilmModel/injection/cloudInjection/cloudInjection.H deleted file mode 100644 index ec9d544e16..0000000000 --- a/src/lagrangian/intermediate/submodels/addOns/surfaceFilmModel/injection/cloudInjection/cloudInjection.H +++ /dev/null @@ -1,142 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 . - -Class - Foam::cloudInjection - -Description - Cloud injection model - -SourceFiles - cloudInjection.C - -\*---------------------------------------------------------------------------*/ - -#ifndef cloudInjection_H -#define cloudInjection_H - -#include "injectionModel.H" -#include "kinematicCloud.H" -#include "pdf.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace surfaceFilmModels -{ - -/*---------------------------------------------------------------------------*\ - Class cloudInjection Declaration -\*---------------------------------------------------------------------------*/ - -class cloudInjection -: - public injectionModel -{ -private: - - // Private member functions - - //- Disallow default bitwise copy construct - cloudInjection(const cloudInjection&); - - //- Disallow default bitwise assignment - void operator=(const cloudInjection&); - - -protected: - - // Protected data - - //- Name of the cloud owner for newly ejected parcels - word cloudName_; - - //- Reference to the cloud - kinematicCloud& cloud_; - - //- Number of particles per parcel - scalar particlesPerParcel_; - - //- Random number generator - Random rndGen_; - - //- Parcel size PDF model - const autoPtr parcelPDF_; - - //- Diameters of particles to inject into the cloud - scalarList diameter_; - - -public: - - //- Runtime type information - TypeName("cloudInjection"); - - - // Constructors - - //- Construct from surface film model - cloudInjection(const surfaceFilmModel& owner, const dictionary& dict); - - - //- Destructor - virtual ~cloudInjection(); - - - // Member Functions - - // Access - - //- Return the cloud name - inline const word& cloudName() const; - - //- Return a reference to the cloud - inline const kinematicCloud& cloud() const; - - - // Evolution - - //- Correct - virtual void correct - ( - scalarField& massToInject, - scalarField& diameterToInject - ); -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#include "cloudInjectionI.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/addOns/surfaceFilmModel/injection/cloudInjection/cloudInjectionI.H b/src/lagrangian/intermediate/submodels/addOns/surfaceFilmModel/injection/cloudInjection/cloudInjectionI.H deleted file mode 100644 index 4c85267e6a..0000000000 --- a/src/lagrangian/intermediate/submodels/addOns/surfaceFilmModel/injection/cloudInjection/cloudInjectionI.H +++ /dev/null @@ -1,44 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "cloudInjection.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -inline const Foam::word& -Foam::surfaceFilmModels::cloudInjection::cloudName() const -{ - return cloudName_; -} - - -inline const Foam::kinematicCloud& -Foam::surfaceFilmModels::cloudInjection::cloud() const -{ - return cloud_; -} - - -// ************************************************************************* // From 973be0cf7a9e0e13ec2f0acc6f3b2c176cc99ea6 Mon Sep 17 00:00:00 2001 From: andy Date: Tue, 7 Sep 2010 09:43:03 +0100 Subject: [PATCH 12/29] ENH: Merge recent surface film developments into main line --- src/surfaceFilmModels/Make/files | 13 + src/surfaceFilmModels/Make/options | 20 +- ...rectMappedFixedInternalValueFvPatchField.C | 6 +- .../directMappedNamedFixedValueFvPatchField.C | 334 +++ .../directMappedNamedFixedValueFvPatchField.H | 164 ++ ...directMappedNamedFixedValueFvPatchFields.C | 43 + ...directMappedNamedFixedValueFvPatchFields.H | 49 + ...ectMappedNamedFixedValueFvPatchFieldsFwd.H | 50 + ...ectMappedNamesFixedValueFvPatchFieldsFwd.H | 50 + .../htcConv/htcConvFvPatchScalarField.C | 165 ++ .../htcConv/htcConvFvPatchScalarField.H | 159 ++ ...alphatFilmWallFunctionFvPatchScalarField.C | 247 ++ ...alphatFilmWallFunctionFvPatchScalarField.H | 172 ++ .../mutFilmWallFunctionFvPatchScalarField.C | 246 ++ .../mutFilmWallFunctionFvPatchScalarField.H | 172 ++ .../cloudInjection/cloudInjection.C | 109 + .../cloudInjection/cloudInjection.H | 122 + .../injectionModel/injectionModel.C | 3 +- .../injectionModel/injectionModel.H | 2 +- .../injectionModel/injectionModelNew.C | 2 +- .../injectionModel/noInjection/noInjection.C | 4 +- .../removeInjection/removeInjection.C | 4 +- .../removeInjection/removeInjection.H | 2 +- .../constantHeatTransfer.C | 105 + .../constantHeatTransfer.H | 114 + .../heatTransferModel/heatTransferModel.C | 69 + .../heatTransferModel/heatTransferModel.H | 159 ++ .../heatTransferModel/heatTransferModelI.H | 44 + .../heatTransferModel/heatTransferModelNew.C | 59 + .../mappedConvectiveHeatTransfer.C | 121 + .../mappedConvectiveHeatTransfer.H | 120 + .../noPhaseChange/noPhaseChange.C | 10 +- .../noPhaseChange/noPhaseChange.H | 2 +- .../phaseChangeModel/phaseChangeModel.C | 15 +- .../phaseChangeModel/phaseChangeModel.H | 8 +- .../phaseChangeModel/phaseChangeModelNew.C | 2 +- .../standardPhaseChange/standardPhaseChange.C | 185 ++ .../standardPhaseChange/standardPhaseChange.H | 121 + .../kinematicSingleLayer.C | 2364 +++++++++-------- .../kinematicSingleLayer.H | 1040 ++++---- .../kinematicSingleLayerI.H | 35 + .../kinematicSingleLayerTemplates.C | 124 +- .../surfaceFilmModel/noFilm/noFilm.C | 76 +- .../surfaceFilmModel/noFilm/noFilm.H | 25 +- .../surfaceFilmModel/surfaceFilmModel.C | 65 +- .../surfaceFilmModel/surfaceFilmModel.H | 74 +- .../surfaceFilmModel/surfaceFilmModelI.H | 7 + .../surfaceFilmModel/surfaceFilmModelNew.C | 16 +- .../thermoSingleLayer/thermoSingleLayer.C | 471 +++- .../thermoSingleLayer/thermoSingleLayer.H | 177 +- .../thermoSingleLayer/thermoSingleLayerI.H | 67 +- 51 files changed, 5989 insertions(+), 1824 deletions(-) create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchField.C create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchField.H create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFields.C create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFields.H create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFieldsFwd.H create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamesFixedValueFvPatchFieldsFwd.H create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.H create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.H create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.C create mode 100644 src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.H create mode 100644 src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.C create mode 100644 src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.H create mode 100644 src/surfaceFilmModels/submodels/thermo/heatTransferModel/constantHeatTransfer/constantHeatTransfer.C create mode 100644 src/surfaceFilmModels/submodels/thermo/heatTransferModel/constantHeatTransfer/constantHeatTransfer.H create mode 100644 src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModel.C create mode 100644 src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModel.H create mode 100644 src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelI.H create mode 100644 src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C create mode 100644 src/surfaceFilmModels/submodels/thermo/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveHeatTransfer.C create mode 100644 src/surfaceFilmModels/submodels/thermo/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveHeatTransfer.H create mode 100644 src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C create mode 100644 src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.H diff --git a/src/surfaceFilmModels/Make/files b/src/surfaceFilmModels/Make/files index cbaf49b810..8b84a94e14 100644 --- a/src/surfaceFilmModels/Make/files +++ b/src/surfaceFilmModels/Make/files @@ -10,17 +10,30 @@ surfaceFilmModel/thermoSingleLayer/thermoSingleLayer.C submodels/kinematic/injectionModel/injectionModel/injectionModel.C submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C submodels/kinematic/injectionModel/noInjection/noInjection.C +submodels/kinematic/injectionModel/cloudInjection/cloudInjection.C submodels/kinematic/injectionModel/removeInjection/removeInjection.C submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.C submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.C +submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C + +submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModel.C +submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C +submodels/thermo/heatTransferModel/constantHeatTransfer/constantHeatTransfer.C +submodels/thermo/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveHeatTransfer.C /* Boundary conditions */ derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchFields.C +derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFields.C derivedFvPatchFields/directMappedFixedPushedInternalValue/directMappedFixedPushedInternalValueFvPatchFields.C derivedFvPatchFields/filmHeightInletVelocity/filmHeightInletVelocityFvPatchVectorField.C +derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C + +/* Wall functions for primary region */ +derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C +derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.C LIB = $(FOAM_LIBBIN)/libsurfaceFilmModels diff --git a/src/surfaceFilmModels/Make/options b/src/surfaceFilmModels/Make/options index d27c95d033..bd04197ec3 100644 --- a/src/surfaceFilmModels/Make/options +++ b/src/surfaceFilmModels/Make/options @@ -1,7 +1,23 @@ EXE_INC = \ -I$(LIB_SRC)/finiteVolume/lnInclude \ - -I$(LIB_SRC)/meshTools/lnInclude + -I$(LIB_SRC)/meshTools/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/specie/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/liquids/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/liquidMixture/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/solids/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/solidMixture/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/reactionThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/SLGThermo/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/pdfs/lnInclude \ + -I$(LIB_SRC)/turbulenceModels \ + -I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \ + -I$(LIB_SRC)/turbulenceModels/compressible/RAS/lnInclude EXE_LIBS = \ + -lSLGThermo \ -lfiniteVolume \ - -lmeshTools + -lmeshTools \ + -lpdf \ + -lcompressibleRASModels \ + -lcompressibleLESModels diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C index 0f5c3db7c1..9c84101d85 100644 --- a/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedFixedInternalValue/directMappedFixedInternalValueFvPatchField.C @@ -111,10 +111,8 @@ void directMappedFixedInternalValueFvPatchField::updateCoeffs() directMappedFixedValueFvPatchField::updateCoeffs(); // Get the coupling information from the directMappedPatchBase - const directMappedPatchBase& mpp = refCast - ( - this->patch().patch() - ); + const directMappedPatchBase& mpp = + refCast(this->patch().patch()); const polyMesh& nbrMesh = mpp.sampleMesh(); const fvPatch& nbrPatch = refCast diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchField.C b/src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchField.C new file mode 100644 index 0000000000..0be8a36bd1 --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchField.C @@ -0,0 +1,334 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 "directMappedNamedFixedValueFvPatchField.H" +#include "directMappedPatchBase.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +directMappedNamedFixedValueFvPatchField:: +directMappedNamedFixedValueFvPatchField +( + const fvPatch& p, + const DimensionedField& iF +) +: + fixedValueFvPatchField(p, iF), + fieldName_(iF.name()), + setAverage_(false), + average_(pTraits::zero) +{} + + +template +directMappedNamedFixedValueFvPatchField:: +directMappedNamedFixedValueFvPatchField +( + const directMappedNamedFixedValueFvPatchField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchField(ptf, p, iF, mapper), + fieldName_(ptf.fieldName_), + setAverage_(ptf.setAverage_), + average_(ptf.average_) +{ + if (!isA(this->patch().patch())) + { + FatalErrorIn + ( + "directMappedNamedFixedValueFvPatchField::" + "directMappedNamedFixedValueFvPatchField\n" + "(\n" + " const directMappedNamedFixedValueFvPatchField&,\n" + " const fvPatch&,\n" + " const Field&,\n" + " const fvPatchFieldMapper&\n" + ")\n" + ) << "\n patch type '" << p.type() + << "' not type '" << directMappedPatchBase::typeName << "'" + << "\n for patch " << p.name() + << " of field " << this->dimensionedInternalField().name() + << " in file " << this->dimensionedInternalField().objectPath() + << exit(FatalError); + } +} + + +template +directMappedNamedFixedValueFvPatchField:: +directMappedNamedFixedValueFvPatchField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + fixedValueFvPatchField(p, iF, dict), + fieldName_(dict.lookupOrDefault("fieldName", iF.name())), + setAverage_(readBool(dict.lookup("setAverage"))), + average_(pTraits(dict.lookup("average"))) +{ + if (!isA(this->patch().patch())) + { + FatalErrorIn + ( + "directMappedNamedFixedValueFvPatchField::" + "directMappedNamedFixedValueFvPatchField" + "(" + " const fvPatch&, " + " const DimensionedField& iF, " + " const dictionary&" + ")" + ) << "\n patch type '" << p.type() + << "' not type '" << directMappedPatchBase::typeName << "'" + << "\n for patch " << p.name() + << " of field " << fieldName_ + << " in file " << this->dimensionedInternalField().objectPath() + << exit(FatalError); + } + + //// Force calculation of schedule (uses parallel comms) + //const directMappedPatchBase& mpp = refCast + //( + // this->patch().patch() + //); + //(void)mpp.map().schedule(); +} + + +template +directMappedNamedFixedValueFvPatchField:: +directMappedNamedFixedValueFvPatchField +( + const directMappedNamedFixedValueFvPatchField& ptf +) +: + fixedValueFvPatchField(ptf), + fieldName_(ptf.fieldName_), + setAverage_(ptf.setAverage_), + average_(ptf.average_) +{} + + +template +directMappedNamedFixedValueFvPatchField:: +directMappedNamedFixedValueFvPatchField +( + const directMappedNamedFixedValueFvPatchField& ptf, + const DimensionedField& iF +) +: + fixedValueFvPatchField(ptf, iF), + fieldName_(ptf.fieldName_), + setAverage_(ptf.setAverage_), + average_(ptf.average_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void directMappedNamedFixedValueFvPatchField::updateCoeffs() +{ + if (this->updated()) + { + return; + } + + typedef GeometricField fieldType; + + // Get the scheduling information from the directMappedPatchBase + const directMappedPatchBase& mpp = refCast + ( + directMappedNamedFixedValueFvPatchField::patch().patch() + ); + const mapDistribute& distMap = mpp.map(); + + // Force recalculation of schedule + (void)distMap.schedule(); + + const fvMesh& nbrMesh = refCast(mpp.sampleMesh()); + + // Result of obtaining remote values + Field newValues; + + switch (mpp.mode()) + { + case directMappedPatchBase::NEARESTCELL: + { + if (mpp.sameRegion()) + { + newValues = this->internalField(); + } + else + { + newValues = nbrMesh.lookupObject + ( + fieldName_ + ).internalField(); + } + mapDistribute::distribute + ( + Pstream::defaultCommsType, + distMap.schedule(), + distMap.constructSize(), + distMap.subMap(), + distMap.constructMap(), + newValues + ); + + break; + } + case directMappedPatchBase::NEARESTPATCHFACE: + { + const label nbrPatchID = + nbrMesh.boundaryMesh().findPatchID(mpp.samplePatch()); + if (nbrPatchID < 0) + { + FatalErrorIn + ( + "void directMappedNamedFixedValueFvPatchField::" + "updateCoeffs()" + )<< "Unable to find sample patch " << mpp.samplePatch() + << " in region " << mpp.sampleRegion() + << " for patch " << this->patch().name() << nl + << abort(FatalError); + } + + const fieldType& nbrField = + nbrMesh.lookupObject(fieldName_); + newValues = nbrField.boundaryField()[nbrPatchID]; + mapDistribute::distribute + ( + Pstream::defaultCommsType, + distMap.schedule(), + distMap.constructSize(), + distMap.subMap(), + distMap.constructMap(), + newValues + ); + + break; + } + case directMappedPatchBase::NEARESTFACE: + { + Field allValues(nbrMesh.nFaces(), pTraits::zero); + + const fieldType& nbrField = + nbrMesh.lookupObject(fieldName_); + forAll(nbrField.boundaryField(), patchI) + { + const fvPatchField& pf = + nbrField.boundaryField()[patchI]; + label faceStart = pf.patch().patch().start(); + + forAll(pf, faceI) + { + allValues[faceStart++] = pf[faceI]; + } + } + + mapDistribute::distribute + ( + Pstream::defaultCommsType, + distMap.schedule(), + distMap.constructSize(), + distMap.subMap(), + distMap.constructMap(), + allValues + ); + + newValues = this->patch().patchSlice(allValues); + + break; + } + default: + { + FatalErrorIn + ( + "directMappedNamedFixedValueFvPatchField::updateCoeffs()" + )<< "Unknown sampling mode: " << mpp.mode() + << nl << abort(FatalError); + } + } + + if (setAverage_) + { + Type averagePsi = + gSum(this->patch().magSf()*newValues) + /gSum(this->patch().magSf()); + + if (mag(averagePsi)/mag(average_) > 0.5) + { + newValues *= mag(average_)/mag(averagePsi); + } + else + { + newValues += (average_ - averagePsi); + } + } + + this->operator==(newValues); + + if (debug) + { + Info<< "directMapped on field:" << fieldName_ + << " patch:" << this->patch().name() + << " avg:" << gAverage(*this) + << " min:" << gMin(*this) + << " max:" << gMax(*this) + << endl; + } + + fixedValueFvPatchField::updateCoeffs(); +} + + +template +void directMappedNamedFixedValueFvPatchField::write(Ostream& os) const +{ + fvPatchField::write(os); + os.writeKeyword("fieldName") << fieldName_ << token::END_STATEMENT << nl; + os.writeKeyword("setAverage") << setAverage_ << token::END_STATEMENT << nl; + os.writeKeyword("average") << average_ << token::END_STATEMENT << nl; + this->writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchField.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchField.H new file mode 100644 index 0000000000..711ed1ec98 --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchField.H @@ -0,0 +1,164 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 . + +Class + Foam::directMappedNamedFixedValueFvPatchField + +Description + Variant of directMappedFixedValueFvPatch where the name of the field to + map is input. + +SourceFiles + directMappedNamedFixedValueFvPatchField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef directMappedNamedFixedValueFvPatchField_H +#define directMappedNamedFixedValueFvPatchField_H + +#include "fixedValueFvPatchField.H" +#include "directMappedFvPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +/*---------------------------------------------------------------------------*\ + Class directMappedNamesFixedValueFvPatchField Declaration +\*---------------------------------------------------------------------------*/ + +template +class directMappedNamedFixedValueFvPatchField +: + public fixedValueFvPatchField +{ + // Private data + + //- Name of field to sample - defaults to field associated with this + // patch if not specified + word fieldName_; + + //- If true adjust the mapped field to maintain average value average_ + bool setAverage_; + + //- Average value the mapped field is adjusted to maintain if + // setAverage_ is set true + Type average_; + + +public: + + //- Runtime type information + TypeName("directMappedNamedFixedValue"); + + + // Constructors + + //- Construct from patch and internal field + directMappedNamedFixedValueFvPatchField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + directMappedNamedFixedValueFvPatchField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given directMappedNamedFixedValueFvPatchField + // onto a new patch + directMappedNamedFixedValueFvPatchField + ( + const directMappedNamedFixedValueFvPatchField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + directMappedNamedFixedValueFvPatchField + ( + const directMappedNamedFixedValueFvPatchField& + ); + + //- Construct and return a clone + virtual tmp > clone() const + { + return tmp > + ( + new directMappedNamedFixedValueFvPatchField(*this) + ); + } + + //- Construct as copy setting internal field reference + directMappedNamedFixedValueFvPatchField + ( + const directMappedNamedFixedValueFvPatchField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp > clone + ( + const DimensionedField& iF + ) const + { + return tmp > + ( + new directMappedNamedFixedValueFvPatchField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository +# include "directMappedNamedFixedValueFvPatchField.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFields.C b/src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFields.C new file mode 100644 index 0000000000..849cc55825 --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFields.C @@ -0,0 +1,43 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 "directMappedNamedFixedValueFvPatchFields.H" +#include "volMesh.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +makePatchFields(directMappedNamedFixedValue); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFields.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFields.H new file mode 100644 index 0000000000..2f815fb81a --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFields.H @@ -0,0 +1,49 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef directMappedNamedFixedValueFvPatchFields_H +#define directMappedNamedFixedValueFvPatchFields_H + +#include "directMappedNamedFixedValueFvPatchField.H" +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeFieldTypedefs(directMappedNamedFixedValue) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFieldsFwd.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFieldsFwd.H new file mode 100644 index 0000000000..c7d6e5c11c --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamedFixedValueFvPatchFieldsFwd.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef directMappedNamedFixedValueFvPatchFieldsFwd_H +#define directMappedNamedFixedValueFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class directMappedNamedFixedValueFvPatchField; + +makePatchTypeFieldTypedefs(directMappedNamedFixedValue) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamesFixedValueFvPatchFieldsFwd.H b/src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamesFixedValueFvPatchFieldsFwd.H new file mode 100644 index 0000000000..c7d6e5c11c --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/directMappedNamedFixedValue/directMappedNamesFixedValueFvPatchFieldsFwd.H @@ -0,0 +1,50 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 . + +\*---------------------------------------------------------------------------*/ + +#ifndef directMappedNamedFixedValueFvPatchFieldsFwd_H +#define directMappedNamedFixedValueFvPatchFieldsFwd_H + +#include "fieldTypes.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +template class directMappedNamedFixedValueFvPatchField; + +makePatchTypeFieldTypedefs(directMappedNamedFixedValue) + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C b/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C new file mode 100644 index 0000000000..c8ca479b6a --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.C @@ -0,0 +1,165 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 "htcConvFvPatchScalarField.H" +#include "RASModel.H" +#include "fvPatchFieldMapper.H" +#include "addToRunTimeSelectionTable.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +htcConvFvPatchScalarField::htcConvFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + fixedValueFvPatchScalarField(p, iF), + L_(1.0) +{} + + +htcConvFvPatchScalarField::htcConvFvPatchScalarField +( + const htcConvFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + L_(ptf.L_) +{} + + +htcConvFvPatchScalarField::htcConvFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict), + L_(readScalar(dict.lookup("L"))) +{} + + +htcConvFvPatchScalarField::htcConvFvPatchScalarField +( + const htcConvFvPatchScalarField& htcpsf +) +: + fixedValueFvPatchScalarField(htcpsf), + L_(htcpsf.L_) +{} + + +htcConvFvPatchScalarField::htcConvFvPatchScalarField +( + const htcConvFvPatchScalarField& htcpsf, + const DimensionedField& iF +) +: + fixedValueFvPatchScalarField(htcpsf, iF), + L_(htcpsf.L_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void htcConvFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + const label patchI = patch().index(); + + const RASModel& rasModel = db().lookupObject("RASProperties"); + const scalarField alphaEffw = rasModel.alphaEff()().boundaryField()[patchI]; + const scalarField& muw = rasModel.mu().boundaryField()[patchI]; + const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; + const vectorField& Uc = rasModel.U(); + const vectorField& Uw = rasModel.U().boundaryField()[patchI]; + const scalarField& Tw = rasModel.thermo().T().boundaryField()[patchI]; + const scalarField Cpw = rasModel.thermo().Cp(Tw, patchI); + + const scalarField kappaw = Cpw*alphaEffw; + const scalarField Pr = muw*Cpw/kappaw; + + scalarField& htc = *this; + forAll(htc, faceI) + { + label faceCellI = patch().faceCells()[faceI]; + + scalar Re = rhow[faceI]*mag(Uc[faceCellI] - Uw[faceI])*L_/muw[faceI]; + + if (Re < 5.0E+05) + { + htc[faceI] = 0.664*sqrt(Re)*cbrt(Pr[faceI])*kappaw[faceI]/L_; + } + else + { + htc[faceI] = 0.037*pow(Re, 0.8)*cbrt(Pr[faceI])*kappaw[faceI]/L_; + } + } +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void htcConvFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField::write(os); + os.writeKeyword("L") << L_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + htcConvFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.H b/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.H new file mode 100644 index 0000000000..4b5585e578 --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/htcConv/htcConvFvPatchScalarField.H @@ -0,0 +1,159 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 . + +Class + Foam::compressible::RASModels::htcConvFvPatchScalarField + +Description + Convective heat transfer boundary condition + +SourceFiles + htcConvFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleMutRoughWallFunctionFvPatchScalarField_H +#define compressibleMutRoughWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class htcConvFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class htcConvFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ +protected: + + // Protected data + + //- L Length scale [m] + const scalar L_; + + +public: + + //- Runtime type information + TypeName("htcConvection"); + + + // Constructors + + //- Construct from patch and internal field + htcConvFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + htcConvFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given + // htcConvFvPatchScalarField + // onto a new patch + htcConvFvPatchScalarField + ( + const htcConvFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + htcConvFvPatchScalarField + ( + const htcConvFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp clone() const + { + return tmp + ( + new htcConvFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + htcConvFvPatchScalarField + ( + const htcConvFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp clone + ( + const DimensionedField& iF + ) const + { + return tmp + ( + new htcConvFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + // I-O + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000..3a43ceaa7a --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.C @@ -0,0 +1,247 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 "alphatFilmWallFunctionFvPatchScalarField.H" +#include "RASModel.H" +#include "surfaceFilmModel.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" +#include "directMappedWallPolyPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +alphatFilmWallFunctionFvPatchScalarField:: +alphatFilmWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + fixedValueFvPatchScalarField(p, iF), + B_(5.5), + yPlusCrit_(11.05), + Cmu_(0.09), + kappa_(0.41), + Prt_(0.85) +{} + + +alphatFilmWallFunctionFvPatchScalarField:: +alphatFilmWallFunctionFvPatchScalarField +( + const alphatFilmWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + fixedValueFvPatchScalarField(ptf, p, iF, mapper), + B_(ptf.B_), + yPlusCrit_(ptf.yPlusCrit_), + Cmu_(ptf.Cmu_), + kappa_(ptf.kappa_), + Prt_(ptf.Prt_) +{} + + +alphatFilmWallFunctionFvPatchScalarField:: +alphatFilmWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + fixedValueFvPatchScalarField(p, iF, dict), + B_(dict.lookupOrDefault("B", 5.5)), + yPlusCrit_(dict.lookupOrDefault("yPlusCrit", 11.05)), + Cmu_(dict.lookupOrDefault("Cmu", 0.09)), + kappa_(dict.lookupOrDefault("kappa", 0.41)), + Prt_(dict.lookupOrDefault("Prt", 0.85)) +{} + + +alphatFilmWallFunctionFvPatchScalarField:: +alphatFilmWallFunctionFvPatchScalarField +( + const alphatFilmWallFunctionFvPatchScalarField& fwfpsf +) +: + fixedValueFvPatchScalarField(fwfpsf), + B_(fwfpsf.B_), + yPlusCrit_(fwfpsf.yPlusCrit_), + Cmu_(fwfpsf.Cmu_), + kappa_(fwfpsf.kappa_), + Prt_(fwfpsf.Prt_) +{} + + +alphatFilmWallFunctionFvPatchScalarField:: +alphatFilmWallFunctionFvPatchScalarField +( + const alphatFilmWallFunctionFvPatchScalarField& fwfpsf, + const DimensionedField& iF +) +: + fixedValueFvPatchScalarField(fwfpsf, iF), + B_(fwfpsf.B_), + yPlusCrit_(fwfpsf.yPlusCrit_), + Cmu_(fwfpsf.Cmu_), + kappa_(fwfpsf.kappa_), + Prt_(fwfpsf.Prt_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void alphatFilmWallFunctionFvPatchScalarField::updateCoeffs() +{ + if (updated()) + { + return; + } + + bool ok = + db().objectRegistry::foundObject + ("surfaceFilmProperties"); + + if (!ok) + { + // do nothing on construction - film model doesn't exist yet + return; + } + + const label patchI = patch().index(); + + // Retrieve phase change mass from surface film model + const surfaceFilmModels::surfaceFilmModel& filmModel = + db().objectRegistry::lookupObject + ("surfaceFilmProperties"); + + const directMappedWallPolyPatch& wpp = + refCast(patch().patch()); + const mapDistribute& distMap = wpp.map(); + label filmPatchI = -1; + forAll(filmModel.primaryPatchIDs(), i) + { + if (filmModel.primaryPatchIDs()[i] == patchI) + { + filmPatchI = filmModel.filmBottomPatchIDs()[i]; + break; + } + } + + scalarField mDotFilm = + filmModel.massPhaseChangeForPrimary().boundaryField()[filmPatchI]; + distMap.distribute(mDotFilm); + + // Retrieve RAS turbulence model + const RASModel& rasModel = db().lookupObject("RASProperties"); + + const scalarField& y = rasModel.y()[patchI]; + const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; + const tmp tk = rasModel.k(); + const volScalarField& k = tk(); + const scalarField& muw = rasModel.mu().boundaryField()[patchI]; + const scalarField& alphaw = rasModel.alpha().boundaryField()[patchI]; + + const scalar Cmu25 = pow(Cmu_, 0.25); + + // Populate alphat field values + scalarField& alphat = *this; + forAll(alphat, faceI) + { + label faceCellI = patch().faceCells()[faceI]; + + scalar uTau = Cmu25*sqrt(k[faceCellI]); + + scalar yPlus = y[faceI]*uTau/(muw[faceI]/rhow[faceI]); + + scalar Pr = muw[faceI]/alphaw[faceI]; + + scalar factor = 0.0; + scalar mStar = mDotFilm[faceI]/(y[faceI]*uTau); + if (yPlus > yPlusCrit_) + { + scalar expTerm = exp(min(50.0, yPlusCrit_*mStar*Pr)); + scalar yPlusRatio = yPlus/yPlusCrit_; + scalar powTerm = mStar*Prt_/kappa_; + factor = + mStar/(expTerm*(pow(yPlusRatio, powTerm)) - 1.0 + ROOTVSMALL); + } + else + { + scalar expTerm = exp(min(50.0, yPlus*mStar*Pr)); + factor = mStar/(expTerm - 1.0 + ROOTVSMALL); + } + + scalar dx = patch().deltaCoeffs()[faceI]; + + scalar alphaEff = dx*rhow[faceI]*uTau*factor; + + alphat[faceI] = max(alphaEff - alphaw[faceI], 0.0); + } +} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +void alphatFilmWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField::write(os); + os.writeKeyword("B") << B_ << token::END_STATEMENT << nl; + os.writeKeyword("yPlusCrit") << yPlusCrit_ << token::END_STATEMENT << nl; + os.writeKeyword("Cmu") << Cmu_ << token::END_STATEMENT << nl; + os.writeKeyword("kappa") << kappa_ << token::END_STATEMENT << nl; + os.writeKeyword("Prt") << Prt_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField +( + fvPatchScalarField, + alphatFilmWallFunctionFvPatchScalarField +); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.H b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000..c899e853da --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/alphatFilmWallFunction/alphatFilmWallFunctionFvPatchScalarField.H @@ -0,0 +1,172 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 . + +Class + Foam::compressible::RASModels::alphatFilmWallFunctionFvPatchScalarField + +Description + Turbulent thermal diffusivity boundary conditions for use with surface + film models. + +SourceFiles + alphatFilmWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleMutRoughWallFunctionFvPatchScalarField_H +#define compressibleMutRoughWallFunctionFvPatchScalarField_H + +#include "fixedValueFvPatchFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class alphatFilmWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class alphatFilmWallFunctionFvPatchScalarField +: + public fixedValueFvPatchScalarField +{ +protected: + + // Protected data + + //- B Coefficient (default = 5.5) + scalar B_; + + //- y+ value for laminar -> turbulent transition (default = 11.05) + scalar yPlusCrit_; + + //- Turbulent Cmu coefficient (default = 0.09) + scalar Cmu_; + + //- Von-Karman constant (default = 0.41) + scalar kappa_; + + //- Turbulent Prandtl number (default = 0.85) + scalar Prt_; + + +public: + + //- Runtime type information + TypeName("alphatFilmWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + alphatFilmWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + alphatFilmWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given + // alphatFilmWallFunctionFvPatchScalarField + // onto a new patch + alphatFilmWallFunctionFvPatchScalarField + ( + const alphatFilmWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + alphatFilmWallFunctionFvPatchScalarField + ( + const alphatFilmWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp clone() const + { + return tmp + ( + new alphatFilmWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + alphatFilmWallFunctionFvPatchScalarField + ( + const alphatFilmWallFunctionFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp clone + ( + const DimensionedField& iF + ) const + { + return tmp + ( + new alphatFilmWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Update the coefficients associated with the patch field + virtual void updateCoeffs(); + + + // I-O + + //- Write + virtual void write(Ostream&) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.C b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.C new file mode 100644 index 0000000000..f7a44c586a --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.C @@ -0,0 +1,246 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 (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 "mutFilmWallFunctionFvPatchScalarField.H" +#include "fvPatchFieldMapper.H" +#include "volFields.H" +#include "RASModel.H" +#include "addToRunTimeSelectionTable.H" +#include "surfaceFilmModel.H" +#include "directMappedWallPolyPatch.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +tmp mutFilmWallFunctionFvPatchScalarField::calcUTau +( + const scalarField& magGradU +) const +{ + tmp tuTau(new scalarField(patch().size(), 0.0)); + scalarField& uTau = tuTau(); + + bool ok = + db().objectRegistry::foundObject + ("surfaceFilmProperties"); + + if (!ok) + { + // do nothing on construction - film model doesn't exist yet + return tuTau; + } + + const label patchI = patch().index(); + + // Retrieve phase change mass from surface film model + const surfaceFilmModels::surfaceFilmModel& filmModel = + db().objectRegistry::lookupObject + ("surfaceFilmProperties"); + + const directMappedWallPolyPatch& wpp = + refCast(patch().patch()); + const mapDistribute& distMap = wpp.map(); + label filmPatchI = -1; + forAll(filmModel.primaryPatchIDs(), i) + { + if (filmModel.primaryPatchIDs()[i] == patchI) + { + filmPatchI = filmModel.filmBottomPatchIDs()[i]; + break; + } + } + + scalarField mDotFilm = + filmModel.massPhaseChangeForPrimary().boundaryField()[filmPatchI]; + distMap.distribute(mDotFilm); + + + // Retrieve RAS turbulence model + const RASModel& rasModel = db().lookupObject("RASProperties"); + const scalarField& y = rasModel.y()[patchI]; + const fvPatchScalarField& rhow = rasModel.rho().boundaryField()[patchI]; + const fvPatchScalarField& muw = rasModel.mu().boundaryField()[patchI]; + const tmp tk = rasModel.k(); + const volScalarField& k = tk(); + + const scalar Cmu25 = pow(Cmu_, 0.25); + + forAll(uTau, faceI) + { + label faceCellI = patch().faceCells()[faceI]; + + scalar ut = Cmu25*sqrt(k[faceCellI]); + + scalar yPlus = y[faceI]*ut/(muw[faceI]/rhow[faceI]); + + scalar mStar = mDotFilm[faceI]/(y[faceI]*ut); + + scalar factor = 0.0; + if (yPlus > yPlusCrit_) + { + scalar expTerm = exp(min(50.0, B_*mStar)); + scalar powTerm = pow(yPlus, mStar/kappa_); + factor = mStar/(expTerm*powTerm - 1.0 + ROOTVSMALL); + } + else + { + scalar expTerm = exp(min(50.0, mStar)); + factor = mStar/(expTerm*yPlus - 1.0 + ROOTVSMALL); + } + + uTau[faceI] = sqrt(max(0, magGradU[faceI]*ut*factor)); + } + + return tuTau; +} + + +tmp mutFilmWallFunctionFvPatchScalarField::calcMut() const +{ + const label patchI = patch().index(); + + const RASModel& rasModel = db().lookupObject("RASProperties"); + const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; + const scalarField magGradU = mag(Uw.snGrad()); + const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; + const scalarField& muw = rasModel.mu().boundaryField()[patchI]; + + return max + ( + scalar(0), + rhow*sqr(calcUTau(magGradU))/(magGradU + ROOTVSMALL) - muw + ); +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +mutFilmWallFunctionFvPatchScalarField::mutFilmWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF +) +: + mutkWallFunctionFvPatchScalarField(p, iF), + B_(5.5), + yPlusCrit_(11.05) +{} + + +mutFilmWallFunctionFvPatchScalarField::mutFilmWallFunctionFvPatchScalarField +( + const mutFilmWallFunctionFvPatchScalarField& ptf, + const fvPatch& p, + const DimensionedField& iF, + const fvPatchFieldMapper& mapper +) +: + mutkWallFunctionFvPatchScalarField(ptf, p, iF, mapper), + B_(5.5), + yPlusCrit_(11.05) +{} + + +mutFilmWallFunctionFvPatchScalarField::mutFilmWallFunctionFvPatchScalarField +( + const fvPatch& p, + const DimensionedField& iF, + const dictionary& dict +) +: + mutkWallFunctionFvPatchScalarField(p, iF, dict), + B_(dict.lookupOrDefault("B", 5.5)), + yPlusCrit_(dict.lookupOrDefault("yPlusCrit", 11.05)) +{} + + +mutFilmWallFunctionFvPatchScalarField::mutFilmWallFunctionFvPatchScalarField +( + const mutFilmWallFunctionFvPatchScalarField& wfpsf +) +: + mutkWallFunctionFvPatchScalarField(wfpsf), + B_(wfpsf.B_), + yPlusCrit_(wfpsf.yPlusCrit_) +{} + + +mutFilmWallFunctionFvPatchScalarField::mutFilmWallFunctionFvPatchScalarField +( + const mutFilmWallFunctionFvPatchScalarField& wfpsf, + const DimensionedField& iF +) +: + mutkWallFunctionFvPatchScalarField(wfpsf, iF), + B_(wfpsf.B_), + yPlusCrit_(wfpsf.yPlusCrit_) +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +tmp mutFilmWallFunctionFvPatchScalarField::yPlus() const +{ + const label patchI = patch().index(); + + const RASModel& rasModel = db().lookupObject("RASProperties"); + const scalarField& y = rasModel.y()[patchI]; + const fvPatchVectorField& Uw = rasModel.U().boundaryField()[patchI]; + const scalarField& rhow = rasModel.rho().boundaryField()[patchI]; + const scalarField& muw = rasModel.mu().boundaryField()[patchI]; + + return y*calcUTau(mag(Uw.snGrad()))/(muw/rhow); +} + + +void mutFilmWallFunctionFvPatchScalarField::write(Ostream& os) const +{ + fvPatchField::write(os); + writeLocalEntries(os); + os.writeKeyword("B") << B_ << token::END_STATEMENT << nl; + os.writeKeyword("yPlusCrit") << yPlusCrit_ << token::END_STATEMENT << nl; + writeEntry("value", os); +} + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +makePatchTypeField(fvPatchScalarField, mutFilmWallFunctionFvPatchScalarField); + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.H b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.H new file mode 100644 index 0000000000..e6a40f5f78 --- /dev/null +++ b/src/surfaceFilmModels/derivedFvPatchFields/wallFunctions/mutFilmWallFunction/mutFilmWallFunctionFvPatchScalarField.H @@ -0,0 +1,172 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 (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 . + +Class + Foam::compressible::RASModels:: + mutFilmWallFunctionFvPatchScalarField + +Description + Wall function boundary condition for use with surface film models. + +SourceFiles + mutFilmWallFunctionFvPatchScalarField.C + +\*---------------------------------------------------------------------------*/ + +#ifndef compressibleMutSpalartAllmarasWallFunctionFvPatchScalarField_H +#define compressibleMutSpalartAllmarasWallFunctionFvPatchScalarField_H + +#include "mutkWallFunctionFvPatchScalarField.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace compressible +{ +namespace RASModels +{ + +/*---------------------------------------------------------------------------*\ + Class mutFilmWallFunctionFvPatchScalarField Declaration +\*---------------------------------------------------------------------------*/ + +class mutFilmWallFunctionFvPatchScalarField +: + public mutkWallFunctionFvPatchScalarField +{ +protected: + + // Protected data + + //- B Coefficient (default = 5.5) + scalar B_; + + //- y+ value for laminar -> turbulent transition (default = 11.05) + scalar yPlusCrit_; + + + // Protected member functions + + //- Calculate the turbulence viscosity + virtual tmp calcMut() const; + + //- Calculate the friction velocity + virtual tmp calcUTau(const scalarField& magGradU) const; + + +public: + + //- Runtime type information + TypeName("mutFilmWallFunction"); + + + // Constructors + + //- Construct from patch and internal field + mutFilmWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField& + ); + + //- Construct from patch, internal field and dictionary + mutFilmWallFunctionFvPatchScalarField + ( + const fvPatch&, + const DimensionedField&, + const dictionary& + ); + + //- Construct by mapping given + // mutFilmWallFunctionFvPatchScalarField + // onto a new patch + mutFilmWallFunctionFvPatchScalarField + ( + const mutFilmWallFunctionFvPatchScalarField&, + const fvPatch&, + const DimensionedField&, + const fvPatchFieldMapper& + ); + + //- Construct as copy + mutFilmWallFunctionFvPatchScalarField + ( + const mutFilmWallFunctionFvPatchScalarField& + ); + + //- Construct and return a clone + virtual tmp clone() const + { + return tmp + ( + new mutFilmWallFunctionFvPatchScalarField(*this) + ); + } + + //- Construct as copy setting internal field reference + mutFilmWallFunctionFvPatchScalarField + ( + const mutFilmWallFunctionFvPatchScalarField&, + const DimensionedField& + ); + + //- Construct and return a clone setting internal field reference + virtual tmp clone + ( + const DimensionedField& iF + ) const + { + return tmp + ( + new mutFilmWallFunctionFvPatchScalarField(*this, iF) + ); + } + + + // Member functions + + // Evaluation functions + + //- Calculate and return the yPlus at the boundary + virtual tmp yPlus() const; + + + // I-O + + //- Write + virtual void write(Ostream& os) const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace RASModels +} // End namespace compressible +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.C b/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.C new file mode 100644 index 0000000000..a1993a7e33 --- /dev/null +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.C @@ -0,0 +1,109 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\/ 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 "cloudInjection.H" +#include "addToRunTimeSelectionTable.H" +#include "fvMesh.H" +#include "Time.H" +#include "mathematicalConstants.H" +#include "Random.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace surfaceFilmModels + { + defineTypeNameAndDebug(cloudInjection, 0); + addToRunTimeSelectionTable(injectionModel, cloudInjection, dictionary); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::cloudInjection::cloudInjection +( + const surfaceFilmModel& owner, + const dictionary& dict +) +: + injectionModel(type(), owner, dict), + particlesPerParcel_(readScalar(coeffs_.lookup("particlesPerParcel"))), + rndGen_(label(0)), + parcelPDF_(pdfs::pdf::New(coeffs_.subDict("parcelPDF"), rndGen_)), + diameter_(owner.film().nCells(), 0.0) +{ + forAll(diameter_, faceI) + { + diameter_[faceI] = parcelPDF_->sample(); + } +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::cloudInjection::~cloudInjection() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void Foam::surfaceFilmModels::cloudInjection::correct +( + scalarField& massToInject, + scalarField& diameterToInject +) +{ + const scalar pi = constant::mathematical::pi; + const scalarField& rhoFilm = owner().rho(); + + // Collect the data to be transferred + forAll(massToInject, cellI) + { + scalar rho = rhoFilm[cellI]; + scalar diam = diameter_[cellI]; + scalar minMass = particlesPerParcel_*rho*pi/6*pow3(diam); + + if (massToInject[cellI] > minMass) + { + // All mass can be injected - set particle diameter + diameterToInject[cellI] = diameter_[cellI]; + + // Retrieve new particle diameter sample + diameter_[cellI] = parcelPDF_->sample(); + } + else + { + // Mass below minimum threshold - cannot be injected + massToInject[cellI] = 0.0; + diameterToInject[cellI] = -1.0; + } + } +} + + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.H b/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.H new file mode 100644 index 0000000000..01c9f5eedb --- /dev/null +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/cloudInjection/cloudInjection.H @@ -0,0 +1,122 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\/ 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 . + +Class + Foam::cloudInjection + +Description + Cloud injection model + +SourceFiles + cloudInjection.C + +\*---------------------------------------------------------------------------*/ + +#ifndef cloudInjection_H +#define cloudInjection_H + +#include "injectionModel.H" +#include "pdf.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace surfaceFilmModels +{ + +/*---------------------------------------------------------------------------*\ + Class cloudInjection Declaration +\*---------------------------------------------------------------------------*/ + +class cloudInjection +: + public injectionModel +{ +private: + + // Private member functions + + //- Disallow default bitwise copy construct + cloudInjection(const cloudInjection&); + + //- Disallow default bitwise assignment + void operator=(const cloudInjection&); + + +protected: + + // Protected data + + //- Number of particles per parcel + scalar particlesPerParcel_; + + //- Random number generator + Random rndGen_; + + //- Parcel size PDF model + const autoPtr parcelPDF_; + + //- Diameters of particles to inject into the cloud + scalarList diameter_; + + +public: + + //- Runtime type information + TypeName("cloudInjection"); + + + // Constructors + + //- Construct from surface film model + cloudInjection(const surfaceFilmModel& owner, const dictionary& dict); + + + //- Destructor + virtual ~cloudInjection(); + + + // Member Functions + + // Evolution + + //- Correct + virtual void correct + ( + scalarField& massToInject, + scalarField& diameterToInject + ); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace surfaceFilmModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.C b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.C index 96d59420ca..fe3e0d9e77 100644 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.C +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.C @@ -41,8 +41,7 @@ namespace Foam Foam::surfaceFilmModels::injectionModel::injectionModel ( - const surfaceFilmModel& owner, - const dictionary& dict + const surfaceFilmModel& owner ) : owner_(owner), diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.H b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.H index bc140539bf..a05d028ffd 100644 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.H +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModel.H @@ -97,7 +97,7 @@ public: // Constructors //- Construct null - injectionModel(const surfaceFilmModel& owner, const dictionary& dict); + injectionModel(const surfaceFilmModel& owner); //- Construct from type name, dictionary and surface film model injectionModel diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C index 07bfb64cdf..7bddebcc8e 100644 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/injectionModel/injectionModelNew.C @@ -34,7 +34,7 @@ Foam::surfaceFilmModels::injectionModel::New const dictionary& dict ) { - const word modelType(dict.lookup("injectionModel")); + word modelType(dict.lookup("injectionModel")); Info<< " Selecting injectionModel " << modelType << endl; diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/noInjection/noInjection.C b/src/surfaceFilmModels/submodels/kinematic/injectionModel/noInjection/noInjection.C index 39d2c34706..f696f1a1bc 100644 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/noInjection/noInjection.C +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/noInjection/noInjection.C @@ -43,10 +43,10 @@ namespace Foam Foam::surfaceFilmModels::noInjection::noInjection ( const surfaceFilmModel& owner, - const dictionary& dict + const dictionary& ) : - injectionModel(owner, dict) + injectionModel(owner) {} diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.C b/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.C index 58fbd9fe5a..97d9bb00aa 100644 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.C +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.C @@ -43,10 +43,10 @@ namespace Foam Foam::surfaceFilmModels::removeInjection::removeInjection ( const surfaceFilmModel& owner, - const dictionary& dict + const dictionary& ) : - injectionModel(owner, dict) + injectionModel(owner) {} diff --git a/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.H b/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.H index 4fc4a63fc4..9c651560f8 100644 --- a/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.H +++ b/src/surfaceFilmModels/submodels/kinematic/injectionModel/removeInjection/removeInjection.H @@ -66,7 +66,7 @@ private: public: //- Runtime type information - TypeName("remove"); + TypeName("removeInjection"); // Constructors diff --git a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/constantHeatTransfer/constantHeatTransfer.C b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/constantHeatTransfer/constantHeatTransfer.C new file mode 100644 index 0000000000..682971f3a6 --- /dev/null +++ b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/constantHeatTransfer/constantHeatTransfer.C @@ -0,0 +1,105 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\/ 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 "constantHeatTransfer.H" +#include "volFields.H" +#include "addToRunTimeSelectionTable.H" +#include "zeroGradientFvPatchFields.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace surfaceFilmModels + { + defineTypeNameAndDebug(constantHeatTransfer, 0); + addToRunTimeSelectionTable + ( + heatTransferModel, + constantHeatTransfer, + dictionary + ); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::constantHeatTransfer::constantHeatTransfer +( + const surfaceFilmModel& owner, + const dictionary& dict +) +: + heatTransferModel(typeName, owner, dict), + c0_(readScalar(coeffs_.lookup("c0"))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::constantHeatTransfer::~constantHeatTransfer() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void Foam::surfaceFilmModels::constantHeatTransfer::correct() +{ + // do nothing +} + + +Foam::tmp +Foam::surfaceFilmModels::constantHeatTransfer::h() const +{ + return tmp + ( + new volScalarField + ( + IOobject + ( + "htc", + owner_.time().timeName(), + owner_.film(), + IOobject::NO_READ, + IOobject::NO_WRITE, + false + ), + owner_.film(), + dimensionedScalar + ( + "c0", + dimEnergy/dimTime/sqr(dimLength)/dimTemperature, + c0_ + ), + zeroGradientFvPatchScalarField::typeName + ) + ); +} + + + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/constantHeatTransfer/constantHeatTransfer.H b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/constantHeatTransfer/constantHeatTransfer.H new file mode 100644 index 0000000000..537e70fae2 --- /dev/null +++ b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/constantHeatTransfer/constantHeatTransfer.H @@ -0,0 +1,114 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. + \\/ 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 . + +Class + Foam::constantHeatTransfer + +Description + Constant heat transfer model + +SourceFiles + constantHeatTransfer.C + +\*---------------------------------------------------------------------------*/ + +#ifndef constantHeatTransfer_H +#define constantHeatTransfer_H + +#include "heatTransferModel.H" +#include "volFieldsFwd.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace surfaceFilmModels +{ + +/*---------------------------------------------------------------------------*\ + Class constantHeatTransfer Declaration +\*---------------------------------------------------------------------------*/ + +class constantHeatTransfer +: + public heatTransferModel +{ +private: + + // Private data + + //- Constant heat transfer coefficient [W/m2/K] + scalar c0_; + + + // Private member functions + + //- Disallow default bitwise copy construct + constantHeatTransfer(const constantHeatTransfer&); + + //- Disallow default bitwise assignment + void operator=(const constantHeatTransfer&); + + +public: + + //- Runtime type information + TypeName("constant"); + + + // Constructors + + //- Construct from surface film model and dictionary + constantHeatTransfer + ( + const surfaceFilmModel& owner, + const dictionary& dict + ); + + + //- Destructor + virtual ~constantHeatTransfer(); + + + // Member Functions + + // Evolution + + //- Correct + virtual void correct(); + + //- Return the heat transfer coefficient [W/m2/K] + virtual tmp h() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace surfaceFilmModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModel.C b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModel.C new file mode 100644 index 0000000000..b7ee185225 --- /dev/null +++ b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModel.C @@ -0,0 +1,69 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 "heatTransferModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace surfaceFilmModels + { + defineTypeNameAndDebug(heatTransferModel, 0); + defineRunTimeSelectionTable(heatTransferModel, dictionary); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::heatTransferModel::heatTransferModel +( + const surfaceFilmModel& owner +) +: + owner_(owner) +{} + + +Foam::surfaceFilmModels::heatTransferModel::heatTransferModel +( + const word& type, + const surfaceFilmModel& owner, + const dictionary& dict +) +: + owner_(owner), + coeffs_(dict.subDict(type + "Coeffs")) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::heatTransferModel::~heatTransferModel() +{} + + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModel.H b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModel.H new file mode 100644 index 0000000000..25caf051d9 --- /dev/null +++ b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModel.H @@ -0,0 +1,159 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 . + +Class + Foam::heatTransferModel + +Description + Base class for heat transfer models + +SourceFiles + heatTransferModelI.H + heatTransferModel.C + +\*---------------------------------------------------------------------------*/ + +#ifndef heatTransferModel_H +#define heatTransferModel_H + +#include "surfaceFilmModel.H" +#include "runTimeSelectionTables.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace surfaceFilmModels +{ + +/*---------------------------------------------------------------------------*\ + Class heatTransferModel Declaration +\*---------------------------------------------------------------------------*/ + +class heatTransferModel +{ +private: + + // Private Member Functions + + //- Disallow default bitwise copy construct + heatTransferModel(const heatTransferModel&); + + //- Disallow default bitwise assignment + void operator=(const heatTransferModel&); + + +protected: + + // Protected data + + //- Reference to the owner surface film model + const surfaceFilmModel& owner_; + + //- Model coefficients dictionary + dictionary coeffs_; + + +public: + + //- Runtime type information + TypeName("heatTransferModel"); + + + // Declare runtime constructor selection table + + declareRunTimeSelectionTable + ( + autoPtr, + heatTransferModel, + dictionary, + ( + const surfaceFilmModel& owner, + const dictionary& dict + ), + (owner, dict) + ); + + // Constructors + + //- Construct null + heatTransferModel(const surfaceFilmModel& owner); + + //- Construct from type name, dictionary and surface film model + heatTransferModel + ( + const word& type, + const surfaceFilmModel& owner, + const dictionary& dict + ); + + + // Selectors + + //- Return a reference to the selected phase change model + static autoPtr New + ( + const surfaceFilmModel& owner, + const dictionary& dict + ); + + + //- Destructor + virtual ~heatTransferModel(); + + + // Member Functions + + // Access + + //- Return the reference to the owner surface film model + inline const surfaceFilmModel& owner() const; + + //- Return the model coefficients dictionary + inline const dictionary& coeffs() const; + + + // Evolution + + //- Correct + virtual void correct() = 0; + + //- Return the heat transfer coefficient [W/m2/K] + virtual tmp h() const = 0; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace surfaceFilmModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#include "heatTransferModelI.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelI.H b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelI.H new file mode 100644 index 0000000000..c9a99ffe29 --- /dev/null +++ b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelI.H @@ -0,0 +1,44 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 "heatTransferModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +inline const Foam::surfaceFilmModels::surfaceFilmModel& +Foam::surfaceFilmModels::heatTransferModel::owner() const +{ + return owner_; +} + + +inline const Foam::dictionary& +Foam::surfaceFilmModels::heatTransferModel::coeffs() const +{ + return coeffs_; +} + + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C new file mode 100644 index 0000000000..e16c40afaf --- /dev/null +++ b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/heatTransferModel/heatTransferModelNew.C @@ -0,0 +1,59 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 "heatTransferModel.H" + +// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // + +Foam::autoPtr +Foam::surfaceFilmModels::heatTransferModel::New +( + const surfaceFilmModel& model, + const dictionary& dict +) +{ + word modelType(dict.lookup("heatTransferModel")); + + Info<< " Selecting heatTransferModel " << modelType << endl; + + dictionaryConstructorTable::iterator cstrIter = + dictionaryConstructorTablePtr_->find(modelType); + + if (cstrIter == dictionaryConstructorTablePtr_->end()) + { + FatalErrorIn + ( + "heatTransferModel::New(const surfaceFilmModel&, const dictionary&)" + ) << "Unknown heatTransferModel type " << modelType << nl << nl + << "Valid heatTransferModel types are:" << nl + << dictionaryConstructorTablePtr_->sortedToc() + << exit(FatalError); + } + + return autoPtr(cstrIter()(model, dict)); +} + + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveHeatTransfer.C b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveHeatTransfer.C new file mode 100644 index 0000000000..cfe6d577fe --- /dev/null +++ b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveHeatTransfer.C @@ -0,0 +1,121 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 "mappedConvectiveHeatTransfer.H" +#include "zeroGradientFvPatchFields.H" +#include "addToRunTimeSelectionTable.H" +#include "kinematicSingleLayer.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace surfaceFilmModels + { + defineTypeNameAndDebug(mappedConvectiveHeatTransfer, 0); + addToRunTimeSelectionTable + ( + heatTransferModel, + mappedConvectiveHeatTransfer, + dictionary + ); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::mappedConvectiveHeatTransfer:: +mappedConvectiveHeatTransfer +( + const surfaceFilmModel& owner, + const dictionary& dict +) +: +// heatTransferModel(typeName, owner, dict), + heatTransferModel(owner), + htcConvPrimary_ + ( + IOobject + ( + "htcConv", + owner.time().timeName(), + owner.mesh(), + IOobject::MUST_READ, + IOobject::AUTO_WRITE + ), + owner.mesh() + ), + htcConvFilm_ + ( + IOobject + ( + htcConvPrimary_.name(), // must have same name as above for mapping + owner.time().timeName(), + owner.film(), + IOobject::NO_READ, + IOobject::NO_WRITE + ), + owner.film(), + dimensionedScalar("zero", dimMass/pow3(dimTime)/dimTemperature, 0.0), + refCast(owner).pSp().boundaryField().types() + ) +{ + // Update the primary-side convective heat transfer coefficient + htcConvPrimary_.correctBoundaryConditions(); + + // Pull the data from the primary region via direct mapped BCs + htcConvFilm_.correctBoundaryConditions(); +} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::mappedConvectiveHeatTransfer:: +~mappedConvectiveHeatTransfer() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void Foam::surfaceFilmModels::mappedConvectiveHeatTransfer::correct() +{ + // Update the primary-side convective heat transfer coefficient + htcConvPrimary_.correctBoundaryConditions(); + + // Pull the data from the primary region via direct mapped BCs + htcConvFilm_.correctBoundaryConditions(); +} + + +Foam::tmp +Foam::surfaceFilmModels::mappedConvectiveHeatTransfer::h() const +{ + return htcConvFilm_; +} + + + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveHeatTransfer.H b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveHeatTransfer.H new file mode 100644 index 0000000000..8f02cb61ba --- /dev/null +++ b/src/surfaceFilmModels/submodels/thermo/heatTransferModel/mappedConvectiveHeatTransfer/mappedConvectiveHeatTransfer.H @@ -0,0 +1,120 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 . + +Class + Foam::mappedConvectiveHeatTransfer + +Description + Convective heat transfer model based on a re-working of a Nusselt number + correlation + +SourceFiles + mappedConvectiveHeatTransfer.C + +\*---------------------------------------------------------------------------*/ + +#ifndef mappedConvectiveHeatTransfer_H +#define mappedConvectiveHeatTransfer_H + +#include "heatTransferModel.H" +#include "volFields.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace surfaceFilmModels +{ + +/*---------------------------------------------------------------------------*\ + Class mappedConvectiveHeatTransfer Declaration +\*---------------------------------------------------------------------------*/ + +class mappedConvectiveHeatTransfer +: + public heatTransferModel +{ +private: + + // Private data + + //- Heat transfer coefficient - primary region [W/m2/K] + volScalarField htcConvPrimary_; + + //- Heat transfer coefficient - film region [W/m2/K] + // Assumes that the primary regtion to film region boundaries are + // described as directMappedPushed types + volScalarField htcConvFilm_; + + + // Private member functions + + //- Disallow default bitwise copy construct + mappedConvectiveHeatTransfer(const mappedConvectiveHeatTransfer&); + + //- Disallow default bitwise assignment + void operator=(const mappedConvectiveHeatTransfer&); + + +public: + + //- Runtime type information + TypeName("mappedConvectiveHeatTransfer"); + + + // Constructors + + //- Construct from surface film model and dictionary + mappedConvectiveHeatTransfer + ( + const surfaceFilmModel& owner, + const dictionary& dict + ); + + + //- Destructor + virtual ~mappedConvectiveHeatTransfer(); + + + // Member Functions + + // Evolution + + //- Correct + virtual void correct(); + + //- Return the heat transfer coefficient [W/m2/K] + virtual tmp h() const; +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace surfaceFilmModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.C b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.C index 551bfb2a44..67094e226d 100644 --- a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.C +++ b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.C @@ -43,10 +43,10 @@ namespace Foam Foam::surfaceFilmModels::noPhaseChange::noPhaseChange ( const surfaceFilmModel& owner, - const dictionary& dict + const dictionary& ) : - phaseChangeModel(owner, dict) + phaseChangeModel(owner) {} @@ -58,7 +58,11 @@ Foam::surfaceFilmModels::noPhaseChange::~noPhaseChange() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -void Foam::surfaceFilmModels::noPhaseChange::correct() +void Foam::surfaceFilmModels::noPhaseChange::correct +( + const scalar, + scalarField& +) { // do nothing } diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.H b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.H index 487e3c2b3c..22a2a17e47 100644 --- a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.H +++ b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/noPhaseChange/noPhaseChange.H @@ -84,7 +84,7 @@ public: // Evolution //- Correct - virtual void correct(); + virtual void correct(const scalar dt, scalarField& dMass); }; diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.C b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.C index e2a0b93a75..7e7e310d61 100644 --- a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.C +++ b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.C @@ -41,8 +41,7 @@ namespace Foam Foam::surfaceFilmModels::phaseChangeModel::phaseChangeModel ( - const surfaceFilmModel& owner, - const dictionary& dict + const surfaceFilmModel& owner ) : owner_(owner), @@ -59,17 +58,7 @@ Foam::surfaceFilmModels::phaseChangeModel::phaseChangeModel : owner_(owner), coeffs_(dict.subDict(type + "Coeffs")) -{ - WarningIn - ( - "phaseChangeModel::phaseChangeModel" - "(" - "const word&, " - "const surfaceFilmModel&, " - "const dictionary&" - ")" - ) << "Phase change models not implemented!" << endl; -} +{} // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.H b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.H index 87a08b1016..8421520d98 100644 --- a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.H +++ b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModel.H @@ -25,6 +25,7 @@ Class Foam::phaseChangeModel Description + Phase change model for surface film modelling. SourceFiles phaseChangeModelI.H @@ -37,6 +38,7 @@ SourceFiles #include "surfaceFilmModel.H" #include "runTimeSelectionTables.H" +#include "scalarField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -96,7 +98,7 @@ public: // Constructors //- Construct null - phaseChangeModel(const surfaceFilmModel& owner, const dictionary& dict); + phaseChangeModel(const surfaceFilmModel& owner); //- Construct from type name, dictionary and surface film model phaseChangeModel @@ -134,8 +136,8 @@ public: // Evolution - //- Correct // TODO - virtual void correct() = 0; + //- Correct + virtual void correct(const scalar dt, scalarField& dMass) = 0; }; diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C index 1ad7bd0b71..7cc04c0027 100644 --- a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C +++ b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C @@ -34,7 +34,7 @@ Foam::surfaceFilmModels::phaseChangeModel::New const dictionary& dict ) { - const word modelType(dict.lookup("phaseChangeModel")); + word modelType(dict.lookup("phaseChangeModel")); Info<< " Selecting phaseChangeModel " << modelType << endl; diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C new file mode 100644 index 0000000000..9011d02fca --- /dev/null +++ b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C @@ -0,0 +1,185 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 "standardPhaseChange.H" +#include "addToRunTimeSelectionTable.H" +#include "thermoSingleLayer.H" +#include "specie.H" +#include "heatTransferModel.H" + +// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // + +namespace Foam +{ + namespace surfaceFilmModels + { + defineTypeNameAndDebug(standardPhaseChange, 0); + addToRunTimeSelectionTable + ( + phaseChangeModel, + standardPhaseChange, + dictionary + ); + } +} + + +// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // + +Foam::scalar Foam::surfaceFilmModels::standardPhaseChange::Sh +( + const scalar Re, + const scalar Sc +) const +{ + if (Re < 5.0E+05) + { + return 0.664*sqrt(Re)*cbrt(Sc); + } + else + { + return 0.037*pow(Re, 0.8)*cbrt(Sc); + } +} + + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::standardPhaseChange::standardPhaseChange +( + const surfaceFilmModel& owner, + const dictionary& dict +) +: + phaseChangeModel(typeName, owner, dict), + deltaMin_(readScalar(coeffs_.lookup("deltaMin"))), + L_(readScalar(coeffs_.lookup("L"))) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +Foam::surfaceFilmModels::standardPhaseChange::~standardPhaseChange() +{} + + +// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // + +void Foam::surfaceFilmModels::standardPhaseChange::correct +( + const scalar dt, + scalarField& dMass +) +{ + const thermoSingleLayer& film = refCast(owner_); + + // set local thermo properties + const SLGThermo& thermo = film.thermo(); + const label liqId = film.liquidId(); + const liquid& liq = thermo.liquids().properties()[liqId]; + const label vapId = thermo.carrierId(thermo.liquids().components()[liqId]); + + // retrieve fields from film model + const scalarField& delta = film.delta(); + const scalarField& YInf = film.YPrimary()[vapId]; + const scalarField& pInf = film.pPrimary(); + const scalarField& T = film.T(); + const scalarField& Ts = film.Ts(); + const scalarField& Tw = film.Tw(); + const scalarField& TInf = film.TPrimary(); + const scalarField& rho = film.rho(); + const scalarField& mu = film.mu(); + const scalarField& hs = film.hs(); + const scalarField& magSf = film.magSf(); + const scalarField hInf = film.htcs().h(); + const scalarField hFilm = film.htcw().h(); + const vectorField dU = film.UPrimary() - film.Us(); + + // Reynolds number + const scalarField Re = rho*mag(dU)*L_/mu; + + // molecular weight of vapour + const scalar Wvap = thermo.carrier().W(vapId); + + // molecular weight of liquid + const scalar Wliq = liq.W(); + + forAll(dMass, cellI) + { + if (delta[cellI] > deltaMin_) + { + // cell pressure + const scalar pc = pInf[cellI]; + + // saturation pressure + const scalar pSat = liq.pv(pc, Ts[cellI]); + + // calculate mass transfer + if (pSat > pc) + { + // boiling + const scalar qDotInf = hInf[cellI]*(TInf[cellI] - T[cellI]); + const scalar qDotFilm = hFilm[cellI]*(T[cellI] - Tw[cellI]); + dMass[cellI] += + max + ( + 0.0, + dt*magSf[cellI]/hs[cellI]*(qDotInf - qDotFilm) + ); + } + else + { + // vapour mass fraction at interface + const scalar Ys = Wliq*pSat/(Wliq*pSat + Wvap*(pc - pSat)); + + // bulk gas average density + const scalar rhoAve = pc/(specie::RR*Ts[cellI]); + + // vapour diffusivity [m2/s] + const scalar Dab = liq.D(pc, Ts[cellI]); + + // Schmidt number + const scalar Sc = mu[cellI]/(rho[cellI]*(Dab + ROOTVSMALL)); + + // Sherwood number + const scalar Sh = this->Sh(Re[cellI], Sc); + + // mass transfer coefficient [m/s] + const scalar hm = Sh*Dab/L_; + + // add mass contribution to source + dMass[cellI] = + max + ( + 0.0, + dt*magSf[cellI]*rhoAve*hm*(Ys - YInf[cellI])/(1.0 - Ys) + ); + } + } + } +} + + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.H b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.H new file mode 100644 index 0000000000..dd16488e03 --- /dev/null +++ b/src/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.H @@ -0,0 +1,121 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2010-2010 OpenCFD Ltd. + \\/ 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 . + +Class + Foam::standardPhaseChange + +Description + + +SourceFiles + standardPhaseChange.C + +\*---------------------------------------------------------------------------*/ + +#ifndef standardPhaseChange_H +#define standardPhaseChange_H + +#include "phaseChangeModel.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +namespace surfaceFilmModels +{ + +/*---------------------------------------------------------------------------*\ + Class standardPhaseChange Declaration +\*---------------------------------------------------------------------------*/ + +class standardPhaseChange +: + public phaseChangeModel +{ +private: + + // Private member functions + + //- Disallow default bitwise copy construct + standardPhaseChange(const standardPhaseChange&); + + //- Disallow default bitwise assignment + void operator=(const standardPhaseChange&); + + +protected: + + // Protected data + + //- Minimum film height for model to be active + const scalar deltaMin_; + + //- Length scalae / [m] + const scalar L_; + + + // Protected member functions + + //- Return Sherwood number as a function of Reynolds and Schmidt numbers + scalar Sh(const scalar Re, const scalar Sc) const; + + +public: + + //- Runtime type information + TypeName("standardPhaseChange"); + + + // Constructors + + //- Construct from surface film model + standardPhaseChange + ( + const surfaceFilmModel& owner, + const dictionary& dict + ); + + + //- Destructor + virtual ~standardPhaseChange(); + + + // Member Functions + + // Evolution + + //- Correct + virtual void correct(const scalar dt, scalarField& dMass); +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace surfaceFilmModels +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C b/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C index 36f2899353..cdfc81d774 100644 --- a/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C +++ b/src/surfaceFilmModels/surfaceFilmModel/kinematicSingleLayer/kinematicSingleLayer.C @@ -1,1062 +1,1302 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | - \\ / A nd | Copyright (C) 2009-2010 OpenCFD Ltd. - \\/ 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 "kinematicSingleLayer.H" -#include "fvm.H" -#include "fvcDiv.H" -#include "fvcLaplacian.H" -#include "fvcSnGrad.H" -#include "fvcReconstruct.H" -#include "fvcVolumeIntegrate.H" -#include "addToRunTimeSelectionTable.H" -#include "directMappedWallPolyPatch.H" - -// Sub-models -#include "injectionModel.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - namespace surfaceFilmModels - { - defineTypeNameAndDebug(kinematicSingleLayer, 0); - addToRunTimeSelectionTable - ( - surfaceFilmModel, - kinematicSingleLayer, - mesh - ); - } -} - - -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -bool Foam::surfaceFilmModels::kinematicSingleLayer::read() -{ - if (surfaceFilmModel::read()) - { - const dictionary& solution = filmRegion_.solutionDict().subDict("PISO"); - solution.lookup("momentumPredictor") >> momentumPredictor_; - solution.lookup("nOuterCorr") >> nOuterCorr_; - solution.lookup("nCorr") >> nCorr_; - solution.lookup("nNonOrthCorr") >> nNonOrthCorr_; - - coeffs_.lookup("Cf") >> Cf_; - coeffs_.lookup("deltaStable") >> deltaStable_; - - return true; - } - else - { - return false; - } -} - - -void Foam::surfaceFilmModels::kinematicSingleLayer::initialise() -{ - if (debug) - { - Pout<< "kinematicSingleLayer::initialise()" << endl; - } - - label nBoundaryFaces = 0; - DynamicList