From 5c8dc9c2f1030fec41c4fc8c707d4a6d1dfe825e Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Wed, 12 May 2021 14:17:45 +0100 Subject: [PATCH] lagrangian: Simplified and rationalised SLGThermo pending a more general and extensible replacement The reduced SLGThermo has been renamed parcelThermo to better represent the purpose. parcelThermo is not created and stored in the cloud that requires it rather than requiring it to be created in the solver createFields and passed to the cloud on construction. --- .../combustion/fireFoam/createClouds.H | 2 +- .../combustion/fireFoam/createFields.H | 2 - .../solvers/combustion/fireFoam/fireFoam.C | 1 - .../buoyantReactingParticleFoam.C | 1 - .../createFields.H | 2 - .../reactingParticleFoam/createClouds.H | 2 +- .../reactingParticleFoam/createFields.H | 2 - .../engineFoam/engineFoam.C | 1 - .../reactingParticleFoam.C | 1 - .../simpleReactingParticleFoam/createClouds.H | 2 +- .../simpleReactingParticleFoam/createFields.H | 2 - .../simpleReactingParticleFoam.C | 1 - src/lagrangian/parcel/Make/files | 2 +- .../Templates/CollidingCloud/CollidingCloud.C | 6 +- .../Templates/CollidingCloud/CollidingCloud.H | 6 +- .../clouds/Templates/MPPICCloud/MPPICCloud.C | 6 +- .../clouds/Templates/MPPICCloud/MPPICCloud.H | 6 +- .../Templates/MomentumCloud/MomentumCloud.C | 6 +- .../Templates/MomentumCloud/MomentumCloud.H | 4 +- .../Templates/ReactingCloud/ReactingCloud.C | 15 +-- .../Templates/ReactingCloud/ReactingCloud.H | 4 +- .../ReactingMultiphaseCloud.C | 6 +- .../ReactingMultiphaseCloud.H | 6 +- .../clouds/Templates/SprayCloud/SprayCloud.C | 7 +- .../clouds/Templates/SprayCloud/SprayCloud.H | 6 +- .../Templates/ThermoCloud/ThermoCloud.C | 18 +-- .../Templates/ThermoCloud/ThermoCloud.H | 14 ++- .../Templates/ThermoCloud/ThermoCloudI.H | 12 +- .../parcel/parcelCloud/ParcelCloudBase.H | 4 +- .../parcel/parcelCloud/parcelCloud.H | 10 +- .../parcel/parcelCloud/parcelCloudNew.C | 6 +- .../parcel/parcelCloudList/parcelCloudList.C | 4 +- .../parcel/parcelCloudList/parcelCloudList.H | 2 +- .../parcelThermo.C} | 118 ++---------------- .../parcelThermo.H} | 107 ++++------------ .../ReactingMultiphaseParcel.H | 4 +- .../Templates/ReactingParcel/ReactingParcel.C | 18 +-- .../Templates/ReactingParcel/ReactingParcel.H | 4 +- .../Templates/ThermoParcel/ThermoParcel.H | 2 +- .../ThermoParcel/ThermoParcelTrackingDataI.H | 6 +- .../SurfaceFilmModel/SurfaceFilmModel.H | 16 +-- .../CompositionModel/CompositionModel.C | 46 +++++-- .../CompositionModel/CompositionModel.H | 22 ++-- .../LiquidEvaporation/LiquidEvaporation.C | 6 +- .../LiquidEvaporationBoil.C | 18 +-- .../COxidationDiffusionLimitedRate.C | 13 +- .../COxidationHurtMitchell.C | 13 +- .../COxidationIntrinsicRate.C | 13 +- .../COxidationKineticDiffusionLimitedRate.C | 13 +- .../COxidationMurphyShaddix.C | 13 +- .../ORourkeCollision/ORourkeCollision.C | 6 +- .../ThermoSurfaceFilm/ThermoSurfaceFilm.C | 12 +- .../ThermoSurfaceFilm/ThermoSurfaceFilm.H | 7 +- 53 files changed, 260 insertions(+), 366 deletions(-) rename src/lagrangian/parcel/{SLGThermo/SLGThermo.C => parcelThermo/parcelThermo.C} (59%) rename src/lagrangian/parcel/{SLGThermo/SLGThermo.H => parcelThermo/parcelThermo.H} (50%) diff --git a/applications/solvers/combustion/fireFoam/createClouds.H b/applications/solvers/combustion/fireFoam/createClouds.H index 8ea23b2181..702f1a4651 100644 --- a/applications/solvers/combustion/fireFoam/createClouds.H +++ b/applications/solvers/combustion/fireFoam/createClouds.H @@ -1,2 +1,2 @@ Info<< "\nConstructing clouds" << endl; -parcelCloudList parcels(rho, U, g, slgThermo); +parcelCloudList parcels(rho, U, g, thermo); diff --git a/applications/solvers/combustion/fireFoam/createFields.H b/applications/solvers/combustion/fireFoam/createFields.H index d615250c18..954848f3fb 100644 --- a/applications/solvers/combustion/fireFoam/createFields.H +++ b/applications/solvers/combustion/fireFoam/createFields.H @@ -3,8 +3,6 @@ autoPtr pThermo(fluidReactionThermo::New(mesh)); fluidReactionThermo& thermo = pThermo(); thermo.validate(args.executable(), "h", "e"); -SLGThermo slgThermo(mesh, thermo); - basicSpecieMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); diff --git a/applications/solvers/combustion/fireFoam/fireFoam.C b/applications/solvers/combustion/fireFoam/fireFoam.C index 215bfa3055..9770d21c2f 100644 --- a/applications/solvers/combustion/fireFoam/fireFoam.C +++ b/applications/solvers/combustion/fireFoam/fireFoam.C @@ -35,7 +35,6 @@ Description #include "fluidReactionThermophysicalTransportModel.H" #include "parcelCloudList.H" #include "surfaceFilmModel.H" -#include "SLGThermo.H" #include "fluidReactionThermo.H" #include "combustionModel.H" #include "pimpleControl.H" diff --git a/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/buoyantReactingParticleFoam.C b/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/buoyantReactingParticleFoam.C index cce0d1029d..ad6f3b646d 100644 --- a/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/buoyantReactingParticleFoam.C +++ b/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/buoyantReactingParticleFoam.C @@ -37,7 +37,6 @@ Description #include "parcelCloudList.H" #include "surfaceFilmModel.H" #include "combustionModel.H" -#include "SLGThermo.H" #include "fvModels.H" #include "fvConstraints.H" #include "pimpleControl.H" diff --git a/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/createFields.H b/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/createFields.H index 487eb1ae4a..fcd3e601b8 100644 --- a/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParticleFoam/buoyantReactingParticleFoam/createFields.H @@ -5,8 +5,6 @@ autoPtr pThermo(fluidReactionThermo::New(mesh)); fluidReactionThermo& thermo = pThermo(); thermo.validate(args.executable(), "h", "e"); -SLGThermo slgThermo(mesh, thermo); - basicSpecieMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); diff --git a/applications/solvers/lagrangian/reactingParticleFoam/createClouds.H b/applications/solvers/lagrangian/reactingParticleFoam/createClouds.H index afdbf46543..5376aaf445 100644 --- a/applications/solvers/lagrangian/reactingParticleFoam/createClouds.H +++ b/applications/solvers/lagrangian/reactingParticleFoam/createClouds.H @@ -1,2 +1,2 @@ Info<< "\nConstructing clouds" << endl; -parcelCloudList clouds(rho, U, g, slgThermo); +parcelCloudList clouds(rho, U, g, thermo); diff --git a/applications/solvers/lagrangian/reactingParticleFoam/createFields.H b/applications/solvers/lagrangian/reactingParticleFoam/createFields.H index 6d77cf9a7e..f92845bf10 100644 --- a/applications/solvers/lagrangian/reactingParticleFoam/createFields.H +++ b/applications/solvers/lagrangian/reactingParticleFoam/createFields.H @@ -5,8 +5,6 @@ autoPtr pThermo(fluidReactionThermo::New(mesh)); fluidReactionThermo& thermo = pThermo(); thermo.validate(args.executable(), "h", "e"); -SLGThermo slgThermo(mesh, thermo); - basicSpecieMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); diff --git a/applications/solvers/lagrangian/reactingParticleFoam/engineFoam/engineFoam.C b/applications/solvers/lagrangian/reactingParticleFoam/engineFoam/engineFoam.C index 1a95a0f692..0be3ce9f88 100644 --- a/applications/solvers/lagrangian/reactingParticleFoam/engineFoam/engineFoam.C +++ b/applications/solvers/lagrangian/reactingParticleFoam/engineFoam/engineFoam.C @@ -37,7 +37,6 @@ Description #include "parcelCloudList.H" #include "surfaceFilmModel.H" #include "combustionModel.H" -#include "SLGThermo.H" #include "fvModels.H" #include "fvConstraints.H" #include "pimpleControl.H" diff --git a/applications/solvers/lagrangian/reactingParticleFoam/reactingParticleFoam.C b/applications/solvers/lagrangian/reactingParticleFoam/reactingParticleFoam.C index 0ee97a2f1b..cec2704ff9 100644 --- a/applications/solvers/lagrangian/reactingParticleFoam/reactingParticleFoam.C +++ b/applications/solvers/lagrangian/reactingParticleFoam/reactingParticleFoam.C @@ -37,7 +37,6 @@ Description #include "parcelCloudList.H" #include "surfaceFilmModel.H" #include "combustionModel.H" -#include "SLGThermo.H" #include "fvModels.H" #include "fvConstraints.H" #include "pimpleControl.H" diff --git a/applications/solvers/lagrangian/simpleReactingParticleFoam/createClouds.H b/applications/solvers/lagrangian/simpleReactingParticleFoam/createClouds.H index afdbf46543..5376aaf445 100644 --- a/applications/solvers/lagrangian/simpleReactingParticleFoam/createClouds.H +++ b/applications/solvers/lagrangian/simpleReactingParticleFoam/createClouds.H @@ -1,2 +1,2 @@ Info<< "\nConstructing clouds" << endl; -parcelCloudList clouds(rho, U, g, slgThermo); +parcelCloudList clouds(rho, U, g, thermo); diff --git a/applications/solvers/lagrangian/simpleReactingParticleFoam/createFields.H b/applications/solvers/lagrangian/simpleReactingParticleFoam/createFields.H index 6ef519f19e..ba6461ab38 100644 --- a/applications/solvers/lagrangian/simpleReactingParticleFoam/createFields.H +++ b/applications/solvers/lagrangian/simpleReactingParticleFoam/createFields.H @@ -5,8 +5,6 @@ autoPtr pThermo(fluidReactionThermo::New(mesh)); fluidReactionThermo& thermo = pThermo(); thermo.validate(args.executable(), "h", "e"); -SLGThermo slgThermo(mesh, thermo); - basicSpecieMixture& composition = thermo.composition(); PtrList& Y = composition.Y(); diff --git a/applications/solvers/lagrangian/simpleReactingParticleFoam/simpleReactingParticleFoam.C b/applications/solvers/lagrangian/simpleReactingParticleFoam/simpleReactingParticleFoam.C index 74e7299336..ecda0d7e6f 100644 --- a/applications/solvers/lagrangian/simpleReactingParticleFoam/simpleReactingParticleFoam.C +++ b/applications/solvers/lagrangian/simpleReactingParticleFoam/simpleReactingParticleFoam.C @@ -39,7 +39,6 @@ Description #include "IOporosityModelList.H" #include "fvModels.H" #include "fvConstraints.H" -#include "SLGThermo.H" #include "simpleControl.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/parcel/Make/files b/src/lagrangian/parcel/Make/files index 776de27fa1..097de52c9f 100644 --- a/src/lagrangian/parcel/Make/files +++ b/src/lagrangian/parcel/Make/files @@ -7,7 +7,7 @@ BASECLOUDS=$(CLOUDS)/baseClasses DERIVEDCLOUDS=$(CLOUDS)/derived # Thermo -SLGThermo/SLGThermo.C +parcelThermo/parcelThermo.C # parcel cloud parcelCloud/parcelCloudBase.C diff --git a/src/lagrangian/parcel/clouds/Templates/CollidingCloud/CollidingCloud.C b/src/lagrangian/parcel/clouds/Templates/CollidingCloud/CollidingCloud.C index f82e77e244..cdcf95e25f 100644 --- a/src/lagrangian/parcel/clouds/Templates/CollidingCloud/CollidingCloud.C +++ b/src/lagrangian/parcel/clouds/Templates/CollidingCloud/CollidingCloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -127,11 +127,11 @@ Foam::CollidingCloud::CollidingCloud const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo, + const fluidThermo& carrierThermo, const bool readFields ) : - CollidingCloud(cloudName, rho, U, thermo.thermo().mu(), g, readFields) + CollidingCloud(cloudName, rho, U, carrierThermo.mu(), g, readFields) {} diff --git a/src/lagrangian/parcel/clouds/Templates/CollidingCloud/CollidingCloud.H b/src/lagrangian/parcel/clouds/Templates/CollidingCloud/CollidingCloud.H index 857c4ae20e..a88ddbdd40 100644 --- a/src/lagrangian/parcel/clouds/Templates/CollidingCloud/CollidingCloud.H +++ b/src/lagrangian/parcel/clouds/Templates/CollidingCloud/CollidingCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,7 +40,7 @@ SourceFiles #include "fvMatricesFwd.H" #include "dimensionedTypes.H" #include "fvMesh.H" -#include "SLGThermo.H" +#include "fluidThermo.H" #include "Cloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -151,7 +151,7 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo, + const fluidThermo& carrierThermo, const bool readFields = true ); diff --git a/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.C b/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.C index d434e75836..3d8173f4b5 100644 --- a/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.C +++ b/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -104,11 +104,11 @@ Foam::MPPICCloud::MPPICCloud const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo, + const fluidThermo& carrierThermo, const bool readFields ) : - MPPICCloud(cloudName, rho, U, thermo.thermo().mu(), g, readFields) + MPPICCloud(cloudName, rho, U, carrierThermo.mu(), g, readFields) {} diff --git a/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.H b/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.H index c0052cdcae..b4e9a1ccd0 100644 --- a/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.H +++ b/src/lagrangian/parcel/clouds/Templates/MPPICCloud/MPPICCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,7 +40,7 @@ SourceFiles #include "fvMatricesFwd.H" #include "dimensionedTypes.H" #include "fvMesh.H" -#include "SLGThermo.H" +#include "fluidThermo.H" #include "Cloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -146,7 +146,7 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo, + const fluidThermo& carrierThermo, const bool readFields = true ); diff --git a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.C b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.C index a202ac0fe8..b2449f62e4 100644 --- a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.C +++ b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -409,11 +409,11 @@ Foam::MomentumCloud::MomentumCloud const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo, + const fluidThermo& carrierThermo, const bool readFields ) : - MomentumCloud(cloudName, rho, U, thermo.thermo().mu(), g, readFields) + MomentumCloud(cloudName, rho, U, carrierThermo.mu(), g, readFields) {} diff --git a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.H b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.H index 50e0978e42..89fcf83045 100644 --- a/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.H +++ b/src/lagrangian/parcel/clouds/Templates/MomentumCloud/MomentumCloud.H @@ -60,7 +60,7 @@ SourceFiles #include "volFields.H" #include "fvMatrices.H" #include "cloudSolution.H" -#include "SLGThermo.H" +#include "fluidThermo.H" #include "ParticleForceList.H" #include "CloudFunctionObjectList.H" @@ -290,7 +290,7 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo, + const fluidThermo& carrierThermo, const bool readFields = true ); diff --git a/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloud.C b/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloud.C index 713abb2159..495dbd8610 100644 --- a/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloud.C +++ b/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -91,19 +91,20 @@ Foam::ReactingCloud::ReactingCloud const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo, + const fluidThermo& carrierThermo, const bool readFields ) : - CloudType(cloudName, rho, U, g, thermo, false), + CloudType(cloudName, rho, U, g, carrierThermo, false), cloudCopyPtr_(nullptr), constProps_(this->particleProperties()), compositionModel_(nullptr), - phaseChangeModel_(nullptr), - rhoTrans_(this->thermo().carrier().species().size()) + phaseChangeModel_(nullptr) { setModels(); + rhoTrans_.setSize(compositionModel_->carrier().species().size()); + if (readFields) { parcelType::readFields(*this, this->composition()); @@ -113,7 +114,7 @@ Foam::ReactingCloud::ReactingCloud // Set storage for mass source fields and initialise to zero forAll(rhoTrans_, i) { - const word& specieName = this->thermo().carrier().species()[i]; + const word& specieName = compositionModel_->carrier().species()[i]; rhoTrans_.set ( i, @@ -156,7 +157,7 @@ Foam::ReactingCloud::ReactingCloud { forAll(c.rhoTrans_, i) { - const word& specieName = this->thermo().carrier().species()[i]; + const word& specieName = compositionModel_->carrier().species()[i]; rhoTrans_.set ( i, diff --git a/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloud.H b/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloud.H index d1fdf420a1..42268f4082 100644 --- a/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloud.H +++ b/src/lagrangian/parcel/clouds/Templates/ReactingCloud/ReactingCloud.H @@ -44,7 +44,7 @@ SourceFiles #include "fvMatricesFwd.H" #include "dimensionedTypes.H" #include "fvMesh.H" -#include "SLGThermo.H" +#include "fluidThermo.H" #include "Cloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -162,7 +162,7 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo, + const fluidThermo& carrierThermo, const bool readFields = true ); diff --git a/src/lagrangian/parcel/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C b/src/lagrangian/parcel/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C index 7ead2306b3..90b4f3f60d 100644 --- a/src/lagrangian/parcel/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C +++ b/src/lagrangian/parcel/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -78,11 +78,11 @@ Foam::ReactingMultiphaseCloud::ReactingMultiphaseCloud const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo, + const fluidThermo& carrierThermo, const bool readFields ) : - CloudType(cloudName, rho, U, g, thermo, false), + CloudType(cloudName, rho, U, g, carrierThermo, false), cloudCopyPtr_(nullptr), constProps_(this->particleProperties()), devolatilisationModel_(nullptr), diff --git a/src/lagrangian/parcel/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H b/src/lagrangian/parcel/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H index 75480e1c03..64332c4a2f 100644 --- a/src/lagrangian/parcel/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H +++ b/src/lagrangian/parcel/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,7 +45,7 @@ SourceFiles #include "fvMatricesFwd.H" #include "dimensionedTypes.H" #include "fvMesh.H" -#include "SLGThermo.H" +#include "fluidThermo.H" #include "Cloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -161,7 +161,7 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo, + const fluidThermo& carrierThermo, const bool readFields = true ); diff --git a/src/lagrangian/parcel/clouds/Templates/SprayCloud/SprayCloud.C b/src/lagrangian/parcel/clouds/Templates/SprayCloud/SprayCloud.C index 0ff3125f2d..dc6a446610 100644 --- a/src/lagrangian/parcel/clouds/Templates/SprayCloud/SprayCloud.C +++ b/src/lagrangian/parcel/clouds/Templates/SprayCloud/SprayCloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -26,6 +26,7 @@ License #include "SprayCloud.H" #include "AtomizationModel.H" #include "BreakupModel.H" +#include "parcelThermo.H" // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // @@ -74,11 +75,11 @@ Foam::SprayCloud::SprayCloud const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo, + const fluidThermo& carrierThermo, bool readFields ) : - CloudType(cloudName, rho, U, g, thermo, false), + CloudType(cloudName, rho, U, g, carrierThermo, false), cloudCopyPtr_(nullptr), averageParcelMass_(0.0), atomizationModel_(nullptr), diff --git a/src/lagrangian/parcel/clouds/Templates/SprayCloud/SprayCloud.H b/src/lagrangian/parcel/clouds/Templates/SprayCloud/SprayCloud.H index 33956601b4..a35ea319f8 100644 --- a/src/lagrangian/parcel/clouds/Templates/SprayCloud/SprayCloud.H +++ b/src/lagrangian/parcel/clouds/Templates/SprayCloud/SprayCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,7 +40,7 @@ Description #include "fvMatricesFwd.H" #include "dimensionedTypes.H" #include "fvMesh.H" -#include "SLGThermo.H" +#include "fluidThermo.H" #include "Cloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -136,7 +136,7 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo, + const fluidThermo& carrierThermo, bool readFields = true ); diff --git a/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloud.C b/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloud.C index f2b96c40fb..92d1f87c88 100644 --- a/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloud.C +++ b/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloud.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -25,7 +25,6 @@ License #include "ThermoCloud.H" #include "integrationScheme.H" - #include "HeatTransferModel.H" // * * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * // @@ -133,16 +132,17 @@ Foam::ThermoCloud::ThermoCloud const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo, + const fluidThermo& carrierThermo, const bool readFields ) : - CloudType(cloudName, rho, U, g, thermo, false), + CloudType(cloudName, rho, U, g, carrierThermo, false), cloudCopyPtr_(nullptr), constProps_(this->particleProperties()), - thermo_(thermo), - T_(thermo.thermo().T()), - p_(thermo.thermo().p()), + carrierThermo_(carrierThermo), + thermo_(carrierThermo_), + T_(carrierThermo.T()), + p_(carrierThermo.p()), heatTransferModel_(nullptr), TIntegrator_(nullptr), radiation_(false), @@ -207,6 +207,7 @@ Foam::ThermoCloud::ThermoCloud CloudType(c, name), cloudCopyPtr_(nullptr), constProps_(c.constProps_), + carrierThermo_(c.carrierThermo_), thermo_(c.thermo_), T_(c.T()), p_(c.p()), @@ -316,6 +317,7 @@ Foam::ThermoCloud::ThermoCloud CloudType(mesh, name, c), cloudCopyPtr_(nullptr), constProps_(), + carrierThermo_(c.carrierThermo_), thermo_(c.thermo()), T_(c.T()), p_(c.p()), @@ -444,7 +446,7 @@ void Foam::ThermoCloud::preEvolve() { CloudType::preEvolve(); - this->pAmbient() = thermo_.thermo().p().average().value(); + this->pAmbient() = carrierThermo_.p().average().value(); } diff --git a/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloud.H b/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloud.H index 8693c1992f..d5e0feb822 100644 --- a/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloud.H +++ b/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloud.H @@ -43,7 +43,7 @@ SourceFiles #include "fvMatricesFwd.H" #include "dimensionedTypes.H" #include "fvMesh.H" -#include "SLGThermo.H" +#include "parcelThermo.H" #include "Cloud.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -108,8 +108,11 @@ protected: // References to the carrier gas fields + //- Thermophysical properties of the carrier fluid + const fluidThermo& carrierThermo_; + //- SLG thermodynamics package - const SLGThermo& thermo_; + const parcelThermo thermo_; //- Temperature [K] const volScalarField& T_; @@ -180,7 +183,7 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo, + const fluidThermo& carrierThermo, const bool readFields = true ); @@ -235,8 +238,11 @@ public: //- Return access to the constant properties inline typename parcelType::constantProperties& constProps(); + //- Return const access to carrier thermo package + inline const fluidThermo& carrierThermo() const; + //- Return const access to thermo package - inline const SLGThermo& thermo() const; + inline const parcelThermo& thermo() const; //- Return const access to the carrier temperature field inline const volScalarField& T() const; diff --git a/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloudI.H b/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloudI.H index eafae99de3..0fc1c5f54f 100644 --- a/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloudI.H +++ b/src/lagrangian/parcel/clouds/Templates/ThermoCloud/ThermoCloudI.H @@ -55,7 +55,15 @@ Foam::ThermoCloud::constProps() template -inline const Foam::SLGThermo& Foam::ThermoCloud::thermo() const +inline const Foam::fluidThermo& +Foam::ThermoCloud::carrierThermo() const +{ + return carrierThermo_; +} + + +template +inline const Foam::parcelThermo& Foam::ThermoCloud::thermo() const { return thermo_; } @@ -236,7 +244,7 @@ Foam::ThermoCloud::Sh(const volScalarField& hs) const { if (this->solution().semiImplicit("h")) { - const volScalarField Cp(thermo_.thermo().Cp()); + const volScalarField Cp(carrierThermo_.Cp()); const volScalarField::Internal Vdt(this->mesh().V()*this->db().time().deltaT()); diff --git a/src/lagrangian/parcel/parcelCloud/ParcelCloudBase.H b/src/lagrangian/parcel/parcelCloud/ParcelCloudBase.H index 255179b3f4..d69103678e 100644 --- a/src/lagrangian/parcel/parcelCloud/ParcelCloudBase.H +++ b/src/lagrangian/parcel/parcelCloud/ParcelCloudBase.H @@ -43,7 +43,7 @@ Description namespace Foam { -class SLGThermo; +class fluidThermo; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -87,7 +87,7 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo, + const fluidThermo& carrierThermo, const bool readFields = true ) : diff --git a/src/lagrangian/parcel/parcelCloud/parcelCloud.H b/src/lagrangian/parcel/parcelCloud/parcelCloud.H index 0885ce9156..6ea60b3f49 100644 --- a/src/lagrangian/parcel/parcelCloud/parcelCloud.H +++ b/src/lagrangian/parcel/parcelCloud/parcelCloud.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -48,7 +48,7 @@ SourceFiles namespace Foam { -class SLGThermo; +class fluidThermo; // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -89,9 +89,9 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo + const fluidThermo& carrierThermo ), - (name, rho, U, g, thermo) + (name, rho, U, g, carrierThermo) ); @@ -123,7 +123,7 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo + const fluidThermo& carrierThermo ); diff --git a/src/lagrangian/parcel/parcelCloud/parcelCloudNew.C b/src/lagrangian/parcel/parcelCloud/parcelCloudNew.C index df22a6f54a..dd45c79ce9 100644 --- a/src/lagrangian/parcel/parcelCloud/parcelCloudNew.C +++ b/src/lagrangian/parcel/parcelCloud/parcelCloudNew.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2020-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -74,7 +74,7 @@ Foam::autoPtr Foam::parcelCloud::New const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo + const fluidThermo& carrierThermo ) { IOdictionary dict @@ -105,7 +105,7 @@ Foam::autoPtr Foam::parcelCloud::New << exit(FatalError); } - return cstrIter()(name, rho, U, g, thermo); + return cstrIter()(name, rho, U, g, carrierThermo); } diff --git a/src/lagrangian/parcel/parcelCloudList/parcelCloudList.C b/src/lagrangian/parcel/parcelCloudList/parcelCloudList.C index c4f67b03df..7b675c7d31 100644 --- a/src/lagrangian/parcel/parcelCloudList/parcelCloudList.C +++ b/src/lagrangian/parcel/parcelCloudList/parcelCloudList.C @@ -109,13 +109,13 @@ Foam::parcelCloudList::parcelCloudList const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo + const fluidThermo& carrierThermo ) : PtrList(), mesh_(rho.mesh()) { - initialise(rho, U, g, thermo); + initialise(rho, U, g, carrierThermo); } diff --git a/src/lagrangian/parcel/parcelCloudList/parcelCloudList.H b/src/lagrangian/parcel/parcelCloudList/parcelCloudList.H index 5668f0ad37..05b0d98310 100644 --- a/src/lagrangian/parcel/parcelCloudList/parcelCloudList.H +++ b/src/lagrangian/parcel/parcelCloudList/parcelCloudList.H @@ -90,7 +90,7 @@ public: const volScalarField& rho, const volVectorField& U, const dimensionedVector& g, - const SLGThermo& thermo + const fluidThermo& carrierThermo ); //- Disallow default bitwise copy construction diff --git a/src/lagrangian/parcel/SLGThermo/SLGThermo.C b/src/lagrangian/parcel/parcelThermo/parcelThermo.C similarity index 59% rename from src/lagrangian/parcel/SLGThermo/SLGThermo.C rename to src/lagrangian/parcel/parcelThermo/parcelThermo.C index 4a92e55b58..de5c655c51 100644 --- a/src/lagrangian/parcel/SLGThermo/SLGThermo.C +++ b/src/lagrangian/parcel/parcelThermo/parcelThermo.C @@ -23,55 +23,22 @@ License \*---------------------------------------------------------------------------*/ -#include "SLGThermo.H" - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -namespace Foam -{ - defineTypeNameAndDebug(SLGThermo, 0); -} - +#include "parcelThermo.H" // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -Foam::SLGThermo::SLGThermo(const fvMesh& mesh, const fluidThermo& thermo) +Foam::parcelThermo::parcelThermo(const fluidThermo& carrierThermo) : - regIOobject - ( - IOobject - ( - SLGThermo::typeName, - mesh.polyMesh::instance(), - mesh - ) - ), - thermo_(thermo), - carrier_(nullptr), liquids_(nullptr), solids_(nullptr) { Info<< "Creating component thermo properties:" << endl; - if (isA(thermo)) - { - const basicSpecieMixture& mcThermo = - refCast(thermo); - carrier_ = &mcThermo; - - Info<< " multi-component carrier - " << mcThermo.species().size() - << " species" << endl; - } - else - { - Info<< " single component carrier" << endl; - } - - if (thermo.properties().found("liquids")) + if (carrierThermo.properties().found("liquids")) { liquids_ = liquidMixtureProperties::New ( - thermo.properties().subDict("liquids") + carrierThermo.properties().subDict("liquids") ); Info<< " liquids - " << liquids_->components().size() << " components" << endl; @@ -81,11 +48,11 @@ Foam::SLGThermo::SLGThermo(const fvMesh& mesh, const fluidThermo& thermo) Info<< " no liquid components" << endl; } - if (thermo.properties().found("solids")) + if (carrierThermo.properties().found("solids")) { solids_ = solidMixtureProperties::New ( - thermo.properties().subDict("solids") + carrierThermo.properties().subDict("solids") ); Info<< " solids - " << solids_->components().size() << " components" << endl; @@ -99,32 +66,13 @@ Foam::SLGThermo::SLGThermo(const fvMesh& mesh, const fluidThermo& thermo) // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -Foam::SLGThermo::~SLGThermo() +Foam::parcelThermo::~parcelThermo() {} // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // -const Foam::fluidThermo& Foam::SLGThermo::thermo() const -{ - return thermo_; -} - - -const Foam::basicSpecieMixture& Foam::SLGThermo::carrier() const -{ - if (carrier_ == nullptr) - { - FatalErrorInFunction - << "carrier requested, but object is not allocated" - << abort(FatalError); - } - - return *carrier_; -} - - -const Foam::liquidMixtureProperties& Foam::SLGThermo::liquids() const +const Foam::liquidMixtureProperties& Foam::parcelThermo::liquids() const { if (!liquids_.valid()) { @@ -137,7 +85,7 @@ const Foam::liquidMixtureProperties& Foam::SLGThermo::liquids() const } -const Foam::solidMixtureProperties& Foam::SLGThermo::solids() const +const Foam::solidMixtureProperties& Foam::parcelThermo::solids() const { if (!solids_.valid()) { @@ -150,33 +98,7 @@ const Foam::solidMixtureProperties& Foam::SLGThermo::solids() const } -Foam::label Foam::SLGThermo::carrierId -( - const word& cmptName, - bool allowNotfound -) const -{ - forAll(carrier().species(), i) - { - if (cmptName == carrier_->species()[i]) - { - return i; - } - } - - if (!allowNotfound) - { - FatalErrorInFunction - << "Unknown carrier component " << cmptName - << ". Valid carrier components are:" << nl - << carrier_->species() << exit(FatalError); - } - - return -1; -} - - -Foam::label Foam::SLGThermo::liquidId +Foam::label Foam::parcelThermo::liquidId ( const word& cmptName, bool allowNotfound @@ -201,7 +123,7 @@ Foam::label Foam::SLGThermo::liquidId } -Foam::label Foam::SLGThermo::solidId +Foam::label Foam::parcelThermo::solidId ( const word& cmptName, bool allowNotfound @@ -226,22 +148,4 @@ Foam::label Foam::SLGThermo::solidId } -bool Foam::SLGThermo::hasMultiComponentCarrier() const -{ - return (carrier_ != nullptr); -} - - -bool Foam::SLGThermo::hasLiquids() const -{ - return liquids_.valid(); -} - - -bool Foam::SLGThermo::hasSolids() const -{ - return solids_.valid(); -} - - // ************************************************************************* // diff --git a/src/lagrangian/parcel/SLGThermo/SLGThermo.H b/src/lagrangian/parcel/parcelThermo/parcelThermo.H similarity index 50% rename from src/lagrangian/parcel/SLGThermo/SLGThermo.H rename to src/lagrangian/parcel/parcelThermo/parcelThermo.H index 2ada95600b..6459d5d17a 100644 --- a/src/lagrangian/parcel/SLGThermo/SLGThermo.H +++ b/src/lagrangian/parcel/parcelThermo/parcelThermo.H @@ -22,32 +22,28 @@ License along with OpenFOAM. If not, see . Class - Foam::SLGThermo + Foam::parcelThermo 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 nullptr. - Similarly, if no liquids or solids are specified, their respective - pointers will also be nullptr. + If no liquids or solids are specified, their respective pointers will also + be nullptr. Registered to the mesh so that it can be looked-up SourceFiles - SLGThermo.C + parcelThermo.C \*---------------------------------------------------------------------------*/ -#ifndef SLGThermo_H -#define SLGThermo_H +#ifndef parcelThermo_H +#define parcelThermo_H -#include "regIOobject.H" #include "fluidThermo.H" -#include "basicSpecieMixture.H" #include "liquidMixtureProperties.H" #include "solidMixtureProperties.H" @@ -57,21 +53,13 @@ namespace Foam { /*---------------------------------------------------------------------------*\ - Class SLGThermo Declaration + Class parcelThermo Declaration \*---------------------------------------------------------------------------*/ -class SLGThermo -: - public regIOobject +class parcelThermo { // Private Data - //- Thermo package - const fluidThermo& thermo_; - - //- Reference to the multi-component carrier phase thermo - const basicSpecieMixture* carrier_; - //- Additional liquid properties data autoPtr liquids_; @@ -81,78 +69,37 @@ class SLGThermo public: - //- Runtime type information - TypeName("SLGThermo"); - // Constructors - //- Construct from mesh - SLGThermo(const fvMesh& mesh, const fluidThermo& thermo); + //- Construct from carrier thermo + parcelThermo(const fluidThermo& carrierThermo); //- Destructor - virtual ~SLGThermo(); + virtual ~parcelThermo(); // Member Functions - // Access + //- Return reference to the global (additional) liquids + const liquidMixtureProperties& liquids() const; - //- Return reference to the thermo database - const fluidThermo& thermo() const; + //- Return reference to the global (additional) solids + const solidMixtureProperties& solids() const; - //- Return reference to the gaseous components - const basicSpecieMixture& carrier() const; + //- Index of liquid component + label liquidId + ( + const word& cmptName, + bool allowNotFound = false + ) const; - //- Return reference to the global (additional) liquids - const liquidMixtureProperties& liquids() const; - - //- Return reference to the global (additional) solids - const solidMixtureProperties& 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; - - - // IO - - bool writeData(Foam::Ostream&) const - { - return true; - } + //- Index of solid component + label solidId + ( + const word& cmptName, + bool allowNotFound = false + ) const; }; diff --git a/src/lagrangian/parcel/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H b/src/lagrangian/parcel/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H index ee2e785bec..ccc3147f0a 100644 --- a/src/lagrangian/parcel/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H +++ b/src/lagrangian/parcel/parcels/Templates/ReactingMultiphaseParcel/ReactingMultiphaseParcel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,7 +39,7 @@ SourceFiles #define ReactingMultiphaseParcel_H #include "particle.H" -#include "SLGThermo.H" +#include "fluidThermo.H" #include "demandDrivenEntry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/parcel/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/parcel/parcels/Templates/ReactingParcel/ReactingParcel.C index 88008a20d3..c10984170e 100644 --- a/src/lagrangian/parcel/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/parcel/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -302,14 +302,14 @@ void Foam::ReactingParcel::correctSurfaceValues return; } - const SLGThermo& thermo = cloud.thermo(); + const basicSpecieMixture& carrier = cloud.composition().carrier(); // Far field carrier molar fractions - scalarField Xinf(thermo.carrier().species().size()); + scalarField Xinf(carrier.species().size()); forAll(Xinf, i) { - Xinf[i] = thermo.carrier().Y(i)[this->cell()]/thermo.carrier().Wi(i); + Xinf[i] = carrier.Y(i)[this->cell()]/carrier.Wi(i); } Xinf /= sum(Xinf); @@ -331,7 +331,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]*thermo.carrier().Wi(i); + Ys[i] = Xs[i]*carrier.Wi(i); } Xs /= sum(Xs); Ys /= sum(Ys); @@ -346,14 +346,14 @@ void Foam::ReactingParcel::correctSurfaceValues forAll(Ys, i) { - const scalar W = thermo.carrier().Wi(i); + const scalar W = carrier.Wi(i); const scalar sqrtW = sqrt(W); const scalar cbrtW = cbrt(W); rhos += Xs[i]*W; - mus += Ys[i]*sqrtW*thermo.carrier().mu(i, td.pc(), T); - kappas += Ys[i]*cbrtW*thermo.carrier().kappa(i, td.pc(), T); - Cps += Xs[i]*thermo.carrier().Cp(i, td.pc(), T); + mus += Ys[i]*sqrtW*carrier.mu(i, td.pc(), T); + kappas += Ys[i]*cbrtW*carrier.kappa(i, td.pc(), T); + Cps += Xs[i]*carrier.Cp(i, td.pc(), T); sumYiSqrtW += Ys[i]*sqrtW; sumYiCbrtW += Ys[i]*cbrtW; diff --git a/src/lagrangian/parcel/parcels/Templates/ReactingParcel/ReactingParcel.H b/src/lagrangian/parcel/parcels/Templates/ReactingParcel/ReactingParcel.H index 637ef6bb3a..45d8c65bcd 100644 --- a/src/lagrangian/parcel/parcels/Templates/ReactingParcel/ReactingParcel.H +++ b/src/lagrangian/parcel/parcels/Templates/ReactingParcel/ReactingParcel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -40,7 +40,7 @@ SourceFiles #include "particle.H" #include "interpolation.H" -#include "SLGThermo.H" +#include "fluidThermo.H" #include "demandDrivenEntry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/parcel/parcels/Templates/ThermoParcel/ThermoParcel.H b/src/lagrangian/parcel/parcels/Templates/ThermoParcel/ThermoParcel.H index 69d08803a6..9a66d1840b 100644 --- a/src/lagrangian/parcel/parcels/Templates/ThermoParcel/ThermoParcel.H +++ b/src/lagrangian/parcel/parcels/Templates/ThermoParcel/ThermoParcel.H @@ -40,7 +40,7 @@ SourceFiles #include "particle.H" #include "interpolation.H" -#include "SLGThermo.H" +#include "fluidThermo.H" #include "demandDrivenEntry.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // diff --git a/src/lagrangian/parcel/parcels/Templates/ThermoParcel/ThermoParcelTrackingDataI.H b/src/lagrangian/parcel/parcels/Templates/ThermoParcel/ThermoParcelTrackingDataI.H index 76668961b6..7120122666 100644 --- a/src/lagrangian/parcel/parcels/Templates/ThermoParcel/ThermoParcelTrackingDataI.H +++ b/src/lagrangian/parcel/parcels/Templates/ThermoParcel/ThermoParcelTrackingDataI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -31,8 +31,8 @@ inline Foam::ThermoParcel::trackingData::trackingData ) : ParcelType::trackingData(cloud), - Cp_(cloud.thermo().thermo().Cp()), - kappa_(cloud.thermo().thermo().kappa()), + Cp_(cloud.carrierThermo().Cp()), + kappa_(cloud.carrierThermo().kappa()), TInterp_ ( interpolation::New diff --git a/src/lagrangian/parcel/submodels/Momentum/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H b/src/lagrangian/parcel/submodels/Momentum/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H index da969b82ba..4e6308fbf5 100644 --- a/src/lagrangian/parcel/submodels/Momentum/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H +++ b/src/lagrangian/parcel/submodels/Momentum/SurfaceFilmModel/SurfaceFilmModel/SurfaceFilmModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -231,17 +231,17 @@ public: #define makeSurfaceFilmModel(CloudType) \ \ - typedef Foam::CloudType::momentumCloudType momentumCloudType; \ + typedef Foam::CloudType::momentumCloudType momentumCloudType; \ defineNamedTemplateTypeNameAndDebug \ ( \ - Foam::SurfaceFilmModel, \ + Foam::SurfaceFilmModel, \ 0 \ ); \ namespace Foam \ { \ defineTemplateRunTimeSelectionTable \ ( \ - SurfaceFilmModel, \ + SurfaceFilmModel, \ dictionary \ ); \ } @@ -249,11 +249,11 @@ public: #define makeSurfaceFilmModelType(SS, CloudType) \ \ - typedef Foam::CloudType::momentumCloudType momentumCloudType; \ - defineNamedTemplateTypeNameAndDebug(Foam::SS, 0); \ + typedef Foam::CloudType::momentumCloudType momentumCloudType; \ + defineNamedTemplateTypeNameAndDebug(Foam::SS, 0); \ \ - Foam::SurfaceFilmModel:: \ - adddictionaryConstructorToTable> \ + Foam::SurfaceFilmModel:: \ + adddictionaryConstructorToTable> \ add##SS##CloudType##momentumCloudType##ConstructorToTable_; diff --git a/src/lagrangian/parcel/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C b/src/lagrangian/parcel/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C index 0b8ee5cbdf..963e3333a3 100644 --- a/src/lagrangian/parcel/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C +++ b/src/lagrangian/parcel/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C @@ -31,6 +31,13 @@ template Foam::CompositionModel::CompositionModel(CloudType& owner) : CloudSubModelBase(owner), + carrierThermo_(owner.carrierThermo()), + carrierMixture_ + ( + isA(carrierThermo_) + ? &refCast(carrierThermo_) + : nullptr + ), thermo_(owner.thermo()), phaseProps_() {} @@ -45,11 +52,13 @@ Foam::CompositionModel::CompositionModel ) : CloudSubModelBase(owner, dict, typeName, type), + carrierThermo_(owner.carrierThermo()), + carrierMixture_(&refCast(carrierThermo_)), thermo_(owner.thermo()), phaseProps_ ( this->coeffDict().lookup("phases"), - thermo_.carrier().species(), + carrierMixture_->species(), thermo_.liquids().components(), thermo_.solids().components() ) @@ -63,6 +72,8 @@ Foam::CompositionModel::CompositionModel ) : CloudSubModelBase(cm), + carrierThermo_(cm.carrierThermo_), + carrierMixture_(cm.carrierMixture_), thermo_(cm.thermo_), phaseProps_(cm.phaseProps_) {} @@ -78,7 +89,7 @@ Foam::CompositionModel::~CompositionModel() // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // template -const Foam::SLGThermo& Foam::CompositionModel::thermo() const +const Foam::parcelThermo& Foam::CompositionModel::thermo() const { return thermo_; } @@ -88,7 +99,14 @@ template const Foam::basicSpecieMixture& Foam::CompositionModel::carrier() const { - return thermo_.carrier(); + if (carrierMixture_ == nullptr) + { + FatalErrorInFunction + << "carrier requested, but object is not allocated" + << abort(FatalError); + } + + return *carrierMixture_; } @@ -160,14 +178,22 @@ Foam::label Foam::CompositionModel::carrierId const bool allowNotFound ) const { - label id = thermo_.carrierId(cmptName); + label id = -1; + + forAll(carrierMixture_->species(), i) + { + if (cmptName == carrierMixture_->species()[i]) + { + id = i; + } + } if (id < 0 && !allowNotFound) { FatalErrorInFunction << "Unable to determine global id for requested component " << cmptName << ". Available components are " << nl - << thermo_.carrier().species() + << carrierMixture_->species() << abort(FatalError); } @@ -245,7 +271,7 @@ Foam::scalarField Foam::CompositionModel::X forAll(Y, i) { label cid = props.carrierIds()[i]; - X[i] = Y[i]/thermo_.carrier().Wi(cid); + X[i] = Y[i]/carrierMixture_->Wi(cid); WInv += X[i]; } break; @@ -291,7 +317,7 @@ Foam::scalar Foam::CompositionModel::H forAll(Y, i) { label cid = props.carrierIds()[i]; - HMixture += Y[i]*thermo_.carrier().Ha(cid, p, T); + HMixture += Y[i]*carrierMixture_->Ha(cid, p, T); } break; } @@ -340,7 +366,7 @@ Foam::scalar Foam::CompositionModel::Hs forAll(Y, i) { label cid = props.carrierIds()[i]; - HsMixture += Y[i]*thermo_.carrier().Hs(cid, p, T); + HsMixture += Y[i]*carrierMixture_->Hs(cid, p, T); } break; } @@ -391,7 +417,7 @@ Foam::scalar Foam::CompositionModel::Hc forAll(Y, i) { label cid = props.carrierIds()[i]; - HcMixture += Y[i]*thermo_.carrier().Hf(cid); + HcMixture += Y[i]*carrierMixture_->Hf(cid); } break; } @@ -441,7 +467,7 @@ Foam::scalar Foam::CompositionModel::Cp forAll(Y, i) { label cid = props.carrierIds()[i]; - CpMixture += Y[i]*thermo_.carrier().Cp(cid, p, T); + CpMixture += Y[i]*carrierMixture_->Cp(cid, p, T); } break; } diff --git a/src/lagrangian/parcel/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H b/src/lagrangian/parcel/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H index cbc7c36737..8b89551c88 100644 --- a/src/lagrangian/parcel/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H +++ b/src/lagrangian/parcel/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -39,14 +39,10 @@ SourceFiles #define CompositionModel_H #include "CloudSubModelBase.H" -#include "IOdictionary.H" -#include "autoPtr.H" -#include "runTimeSelectionTables.H" - -#include "PtrList.H" -#include "SLGThermo.H" - +#include "parcelThermo.H" +#include "basicSpecieMixture.H" #include "phasePropertiesList.H" +#include "runTimeSelectionTables.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -64,8 +60,14 @@ class CompositionModel { // Private Data + //- Reference to thermophysical properties of the carrier fluid + const fluidThermo& carrierThermo_; + + //- Pointer to the multi-component carrier composition + const basicSpecieMixture* carrierMixture_; + //- Reference to the thermo database - const SLGThermo& thermo_; + const parcelThermo& thermo_; //- List of phase properties phasePropertiesList phaseProps_; @@ -127,7 +129,7 @@ public: // Access //- Return the thermo database - const SLGThermo& thermo() const; + const parcelThermo& thermo() const; // Composition lists diff --git a/src/lagrangian/parcel/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C b/src/lagrangian/parcel/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C index 9afda88e83..daa306ae10 100644 --- a/src/lagrangian/parcel/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C +++ b/src/lagrangian/parcel/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C @@ -37,13 +37,13 @@ Foam::tmp Foam::LiquidEvaporation::calcXc const label celli ) const { - scalarField Xc(this->owner().thermo().carrier().Y().size()); + scalarField Xc(this->owner().composition().carrier().Y().size()); forAll(Xc, i) { Xc[i] = - this->owner().thermo().carrier().Y()[i][celli] - /this->owner().thermo().carrier().Wi(i); + this->owner().composition().carrier().Y()[i][celli] + /this->owner().composition().carrier().Wi(i); } return Xc/sum(Xc); diff --git a/src/lagrangian/parcel/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C b/src/lagrangian/parcel/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C index 8b3ef66282..ce2feb76fe 100644 --- a/src/lagrangian/parcel/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C +++ b/src/lagrangian/parcel/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C @@ -37,13 +37,13 @@ Foam::tmp Foam::LiquidEvaporationBoil::calcXc const label celli ) const { - scalarField Xc(this->owner().thermo().carrier().Y().size()); + scalarField Xc(this->owner().composition().carrier().Y().size()); forAll(Xc, i) { Xc[i] = - this->owner().thermo().carrier().Y()[i][celli] - /this->owner().thermo().carrier().Wi(i); + this->owner().composition().carrier().Y()[i][celli] + /this->owner().composition().carrier().Wi(i); } return Xc/sum(Xc); @@ -178,13 +178,13 @@ void Foam::LiquidEvaporationBoil::calculate scalar Hc = 0.0; scalar Cpc = 0.0; scalar kappac = 0.0; - forAll(this->owner().thermo().carrier().Y(), i) + forAll(this->owner().composition().carrier().Y(), i) { - scalar Yc = this->owner().thermo().carrier().Y()[i][celli]; - Hc += Yc*this->owner().thermo().carrier().Ha(i, pc, Tc); - Hsc += Yc*this->owner().thermo().carrier().Ha(i, ps, Ts); - Cpc += Yc*this->owner().thermo().carrier().Cp(i, ps, Ts); - kappac += Yc*this->owner().thermo().carrier().kappa(i, ps, Ts); + scalar Yc = this->owner().composition().carrier().Y()[i][celli]; + Hc += Yc*this->owner().composition().carrier().Ha(i, pc, Tc); + Hsc += Yc*this->owner().composition().carrier().Ha(i, ps, Ts); + Cpc += Yc*this->owner().composition().carrier().Cp(i, ps, Ts); + kappac += Yc*this->owner().composition().carrier().kappa(i, ps, Ts); } // calculate mass transfer of each specie in liquid diff --git a/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C b/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C index 08faacf284..d9e2ff8ec6 100644 --- a/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C +++ b/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationDiffusionLimitedRate/COxidationDiffusionLimitedRate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,11 +52,11 @@ Foam::COxidationDiffusionLimitedRate::COxidationDiffusionLimitedRate CsLocalId_ = owner.composition().localId(idSolid, "C"); // Set local copies of thermo properties - WO2_ = owner.thermo().carrier().Wi(O2GlobalId_); - const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_); + WO2_ = owner.composition().carrier().Wi(O2GlobalId_); + const scalar WCO2 = owner.composition().carrier().Wi(CO2GlobalId_); WC_ = WCO2 - WO2_; - HcCO2_ = owner.thermo().carrier().Hf(CO2GlobalId_); + HcCO2_ = owner.composition().carrier().Hf(CO2GlobalId_); if (Sb_ < 0) { @@ -131,10 +131,11 @@ Foam::scalar Foam::COxidationDiffusionLimitedRate::calculate return 0.0; } - const SLGThermo& thermo = this->owner().thermo(); + const parcelThermo& thermo = this->owner().thermo(); + const basicSpecieMixture& carrier = this->owner().composition().carrier(); // Local mass fraction of O2 in the carrier phase - const scalar YO2 = thermo.carrier().Y(O2GlobalId_)[celli]; + const scalar YO2 = carrier.Y(O2GlobalId_)[celli]; // Change in C mass [kg] scalar dmC = 4.0*mathematical::pi*d*D_*YO2*Tc*rhoc/(Sb_*(T + Tc))*dt; diff --git a/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationHurtMitchell/COxidationHurtMitchell.C b/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationHurtMitchell/COxidationHurtMitchell.C index b462aec1b7..3ab28866e7 100644 --- a/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationHurtMitchell/COxidationHurtMitchell.C +++ b/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationHurtMitchell/COxidationHurtMitchell.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2012-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2012-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -52,11 +52,11 @@ Foam::COxidationHurtMitchell::COxidationHurtMitchell ashLocalId_ = owner.composition().localId(idSolid, "ash", true); // Set local copies of thermo properties - WO2_ = owner.thermo().carrier().Wi(O2GlobalId_); - const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_); + WO2_ = owner.composition().carrier().Wi(O2GlobalId_); + const scalar WCO2 = owner.composition().carrier().Wi(CO2GlobalId_); WC_ = WCO2 - WO2_; - HcCO2_ = owner.thermo().carrier().Hf(CO2GlobalId_); + HcCO2_ = owner.composition().carrier().Hf(CO2GlobalId_); const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_]; const scalar YSolidTot = owner.composition().YMixture0()[idSolid]; @@ -130,10 +130,11 @@ Foam::scalar Foam::COxidationHurtMitchell::calculate return 0.0; } - const SLGThermo& thermo = this->owner().thermo(); + const parcelThermo& thermo = this->owner().thermo(); + const basicSpecieMixture& carrier = this->owner().composition().carrier(); // Local mass fraction of O2 in the carrier phase - const scalar YO2 = thermo.carrier().Y(O2GlobalId_)[celli]; + const scalar YO2 = carrier.Y(O2GlobalId_)[celli]; // No combustion if no oxygen present if (YO2 < small) diff --git a/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationIntrinsicRate/COxidationIntrinsicRate.C b/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationIntrinsicRate/COxidationIntrinsicRate.C index d1b98a7377..6018ce254b 100644 --- a/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationIntrinsicRate/COxidationIntrinsicRate.C +++ b/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationIntrinsicRate/COxidationIntrinsicRate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2014-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2014-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -58,11 +58,11 @@ Foam::COxidationIntrinsicRate::COxidationIntrinsicRate CsLocalId_ = owner.composition().localId(idSolid, "C"); // Set local copies of thermo properties - WO2_ = owner.thermo().carrier().Wi(O2GlobalId_); - const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_); + WO2_ = owner.composition().carrier().Wi(O2GlobalId_); + const scalar WCO2 = owner.composition().carrier().Wi(CO2GlobalId_); WC_ = WCO2 - WO2_; - HcCO2_ = owner.thermo().carrier().Hf(CO2GlobalId_); + HcCO2_ = owner.composition().carrier().Hf(CO2GlobalId_); if (Sb_ < 0) { @@ -143,10 +143,11 @@ Foam::scalar Foam::COxidationIntrinsicRate::calculate return 0.0; } - const SLGThermo& thermo = this->owner().thermo(); + const parcelThermo& thermo = this->owner().thermo(); + const basicSpecieMixture& carrier = this->owner().composition().carrier(); // Local mass fraction of O2 in the carrier phase [] - const scalar YO2 = thermo.carrier().Y(O2GlobalId_)[celli]; + const scalar YO2 = carrier.Y(O2GlobalId_)[celli]; // Quick exit if oxidant not present if (YO2 < rootVSmall) diff --git a/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C b/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C index 92820a94ea..d3584bbd9b 100644 --- a/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C +++ b/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationKineticDiffusionLimitedRate/COxidationKineticDiffusionLimitedRate.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -53,11 +53,11 @@ COxidationKineticDiffusionLimitedRate CsLocalId_ = owner.composition().localId(idSolid, "C"); // Set local copies of thermo properties - WO2_ = owner.thermo().carrier().Wi(O2GlobalId_); - const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_); + WO2_ = owner.composition().carrier().Wi(O2GlobalId_); + const scalar WCO2 = owner.composition().carrier().Wi(CO2GlobalId_); WC_ = WCO2 - WO2_; - HcCO2_ = owner.thermo().carrier().Hf(CO2GlobalId_); + HcCO2_ = owner.composition().carrier().Hf(CO2GlobalId_); const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_]; const scalar YSolidTot = owner.composition().YMixture0()[idSolid]; @@ -128,10 +128,11 @@ Foam::scalar Foam::COxidationKineticDiffusionLimitedRate::calculate return 0.0; } - const SLGThermo& thermo = this->owner().thermo(); + const parcelThermo& thermo = this->owner().thermo(); + const basicSpecieMixture& carrier = this->owner().composition().carrier(); // Local mass fraction of O2 in the carrier phase - const scalar YO2 = thermo.carrier().Y(O2GlobalId_)[celli]; + const scalar YO2 = carrier.Y(O2GlobalId_)[celli]; // Diffusion rate coefficient const scalar D0 = C1_/d*pow(0.5*(T + Tc), 0.75); diff --git a/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C b/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C index ecf669dc42..c27ff1a83c 100644 --- a/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C +++ b/src/lagrangian/parcel/submodels/ReactingMultiphase/SurfaceReactionModel/COxidationMurphyShaddix/COxidationMurphyShaddix.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -65,11 +65,11 @@ Foam::COxidationMurphyShaddix::COxidationMurphyShaddix CsLocalId_ = owner.composition().localId(idSolid, "C"); // Set local copies of thermo properties - WO2_ = owner.thermo().carrier().Wi(O2GlobalId_); - const scalar WCO2 = owner.thermo().carrier().Wi(CO2GlobalId_); + WO2_ = owner.composition().carrier().Wi(O2GlobalId_); + const scalar WCO2 = owner.composition().carrier().Wi(CO2GlobalId_); WC_ = WCO2 - WO2_; - HcCO2_ = owner.thermo().carrier().Hf(CO2GlobalId_); + HcCO2_ = owner.composition().carrier().Hf(CO2GlobalId_); const scalar YCloc = owner.composition().Y0(idSolid)[CsLocalId_]; const scalar YSolidTot = owner.composition().YMixture0()[idSolid]; @@ -142,10 +142,11 @@ Foam::scalar Foam::COxidationMurphyShaddix::calculate return 0.0; } - const SLGThermo& thermo = this->owner().thermo(); + const parcelThermo& thermo = this->owner().thermo(); + const basicSpecieMixture& carrier = this->owner().composition().carrier(); // Cell carrier phase O2 species density [kg/m^3] - const scalar rhoO2 = rhoc*thermo.carrier().Y(O2GlobalId_)[celli]; + const scalar rhoO2 = rhoc*carrier.Y(O2GlobalId_)[celli]; if (rhoO2 < small) { diff --git a/src/lagrangian/parcel/submodels/Spray/StochasticCollision/ORourkeCollision/ORourkeCollision.C b/src/lagrangian/parcel/submodels/Spray/StochasticCollision/ORourkeCollision/ORourkeCollision.C index 263058aff9..5341a68e56 100644 --- a/src/lagrangian/parcel/submodels/Spray/StochasticCollision/ORourkeCollision/ORourkeCollision.C +++ b/src/lagrangian/parcel/submodels/Spray/StochasticCollision/ORourkeCollision/ORourkeCollision.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -24,7 +24,7 @@ License \*---------------------------------------------------------------------------*/ #include "ORourkeCollision.H" -#include "SLGThermo.H" +#include "parcelThermo.H" #include "CompactListList.H" #include "mathematicalConstants.H" @@ -299,7 +299,7 @@ Foam::ORourkeCollision::ORourkeCollision StochasticCollisionModel(dict, owner, modelName), liquids_ ( - owner.db().template lookupObject("SLGThermo").liquids() + static_cast&>(owner).thermo().liquids() ), coalescence_(this->coeffDict().lookup("coalescence")) {} diff --git a/src/lagrangian/parcel/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C b/src/lagrangian/parcel/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C index c3a80118b3..ce59593999 100644 --- a/src/lagrangian/parcel/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C +++ b/src/lagrangian/parcel/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C @@ -143,7 +143,7 @@ void Foam::ThermoSurfaceFilm::absorbInteraction const liquidProperties& liq = thermo_.liquids().properties()[0]; // Local pressure - const scalar pc = thermo_.thermo().p()[p.cell()]; + const scalar pc = carrierThermo_.p()[p.cell()]; filmModel.addSources ( @@ -213,7 +213,7 @@ void Foam::ThermoSurfaceFilm::drySplashInteraction const vector& nf = pp.faceNormals()[facei]; // Local pressure - const scalar pc = thermo_.thermo().p()[p.cell()]; + const scalar pc = carrierThermo_.p()[p.cell()]; // Retrieve parcel properties const scalar m = p.mass()*p.nParticle(); @@ -269,7 +269,7 @@ void Foam::ThermoSurfaceFilm::wetSplashInteraction const vector& nf = pp.faceNormals()[facei]; // Local pressure - const scalar pc = thermo_.thermo().p()[p.cell()]; + const scalar pc = carrierThermo_.p()[p.cell()]; // Retrieve parcel properties const scalar m = p.mass()*p.nParticle(); @@ -470,10 +470,11 @@ Foam::ThermoSurfaceFilm::ThermoSurfaceFilm : SurfaceFilmModel(dict, owner, typeName), rndGen_(owner.rndGen()), - thermo_ + carrierThermo_ ( - owner.db().objectRegistry::template lookupObject("SLGThermo") + static_cast&>(owner).carrierThermo() ), + thermo_(static_cast&>(owner).thermo()), TFilmPatch_(0), CpFilmPatch_(0), interactionType_ @@ -513,6 +514,7 @@ Foam::ThermoSurfaceFilm::ThermoSurfaceFilm : SurfaceFilmModel(sfm), rndGen_(sfm.rndGen_), + carrierThermo_(sfm.carrierThermo_), thermo_(sfm.thermo_), TFilmPatch_(sfm.TFilmPatch_), CpFilmPatch_(sfm.CpFilmPatch_), diff --git a/src/lagrangian/parcel/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.H b/src/lagrangian/parcel/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.H index 819c01001b..d54540e42b 100644 --- a/src/lagrangian/parcel/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.H +++ b/src/lagrangian/parcel/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -100,8 +100,11 @@ protected: //- Reference to the cloud random number generator Random& rndGen_; + //- Thermophysical properties of the carrier fluid + const fluidThermo& carrierThermo_; + //- Reference to the cloud thermo package - const SLGThermo& thermo_; + const parcelThermo& thermo_; // Cached injector fields per film patch