From 76e07b0da60c2274137c29a0cabffbfc4697c9b2 Mon Sep 17 00:00:00 2001 From: Henry Weller Date: Sun, 21 Mar 2021 23:04:40 +0000 Subject: [PATCH] surfaceFilmModels: Replaced the simplistic constant heat capacity thermodynamics with rhoThermo The constant heat capacity hacked thermo in surfaceFilmModels and the corresponding transfer terms in Lagrangian have been replaced by the standard OpenFOAM rhoThermo which provides a general handling of thermo-physical properties, in particular non-constant heat capacity. Further rationalisation of liquid and solid properties has also been undertaken in support of this work to provide a completely consistent interface to sensible and absolute enthalpy. Now for surfaceFilmModels the thermo-physical model and properties are specified in a constant//thermophysicalProperties dictionary consistent with all other types of continuum simulation. This significantly rationalises, simplifies and generalises the handling of thermo-physical properties for film simulations and is a start at doing the same for Lagrangian. --- .../VoFPatchTransfer/VoFPatchTransfer.C | 7 +- .../VoFSurfaceFilm/VoFSurfaceFilm.C | 6 +- .../Templates/SprayParcel/SprayParcel.C | 6 +- .../Templates/SprayParcel/SprayParcelName.C | 3 +- .../Templates/ThermoParcel/ThermoParcel.H | 5 +- .../Templates/ThermoParcel/ThermoParcelI.H | 9 +- .../CompositionModel/CompositionModel.C | 22 +- .../LiquidEvaporation/LiquidEvaporation.C | 4 +- .../LiquidEvaporationBoil.C | 4 +- .../ThermoSurfaceFilm/ThermoSurfaceFilm.C | 13 +- src/regionModels/surfaceFilmModels/Make/files | 23 +- .../kinematicSingleLayer.C | 121 +++-- .../kinematicSingleLayer.H | 44 +- .../kinematicSingleLayerI.H | 21 +- .../BrunDrippingEjection.C | 5 +- .../curvatureSeparation/curvatureSeparation.C | 4 +- .../constantFilmThermo/constantFilmThermo.C | 366 --------------- .../constantFilmThermo/constantFilmThermo.H | 223 --------- .../filmThermoModel/filmThermoModel.C | 76 ---- .../filmThermoModel/filmThermoModel.H | 184 -------- .../filmThermoModel/filmThermoModelNew.C | 95 ---- .../liquidFilmThermo/liquidFilmThermo.C | 429 ------------------ .../liquidFilmThermo/liquidFilmThermo.H | 187 -------- .../Arrhenius}/ArrheniusViscosity.C | 2 +- .../Arrhenius}/ArrheniusViscosity.H | 2 +- .../Newtonian/NewtonianViscosity.C} | 14 +- .../Newtonian/NewtonianViscosity.H} | 27 +- .../constant}/constantViscosity.C | 2 +- .../constant}/constantViscosity.H | 2 +- .../filmViscosityModel/filmViscosityModel.C | 2 +- .../filmViscosityModel/filmViscosityModel.H | 2 +- .../filmViscosityModelNew.C | 0 .../function1}/function1Viscosity.C | 2 +- .../function1}/function1Viscosity.H | 2 +- .../thixotropic}/thixotropicViscosity.C | 0 .../thixotropic}/thixotropicViscosity.H | 2 +- .../waxSolvent}/waxSolventViscosity.C | 2 +- .../waxSolvent}/waxSolventViscosity.H | 2 +- .../contactAngleForce/contactAngleForce.C | 6 +- ...bedTemperatureDependentContactAngleForce.C | 4 +- .../temperatureDependentContactAngleForce.C | 4 +- .../thermocapillaryForce.C | 6 +- .../solidification/solidification.C | 8 +- .../speciePhaseChange/speciePhaseChange.C | 9 +- .../standardPhaseChange/standardPhaseChange.C | 29 +- .../waxSolventEvaporation.C | 23 +- .../surfaceFilmModel/surfaceFilmModel.C | 9 +- .../surfaceFilmModel/surfaceFilmModel.H | 3 - .../surfaceFilmRegionModel.H | 23 +- .../thermoSingleLayer/thermoSingleLayer.C | 194 ++------ .../thermoSingleLayer/thermoSingleLayer.H | 65 --- .../thermoSingleLayer/thermoSingleLayerI.H | 41 -- .../liquidProperties/Ar/Ar.C | 9 +- .../liquidProperties/Ar/Ar.H | 15 +- .../liquidProperties/Ar/ArI.H | 16 +- .../liquidProperties/C10H22/C10H22.C | 9 +- .../liquidProperties/C10H22/C10H22.H | 15 +- .../liquidProperties/C10H22/C10H22I.H | 16 +- .../liquidProperties/C12H26/C12H26.C | 9 +- .../liquidProperties/C12H26/C12H26.H | 15 +- .../liquidProperties/C12H26/C12H26I.H | 16 +- .../liquidProperties/C13H28/C13H28.C | 9 +- .../liquidProperties/C13H28/C13H28.H | 15 +- .../liquidProperties/C13H28/C13H28I.H | 16 +- .../liquidProperties/C14H30/C14H30.C | 9 +- .../liquidProperties/C14H30/C14H30.H | 15 +- .../liquidProperties/C14H30/C14H30I.H | 16 +- .../liquidProperties/C16H34/C16H34.C | 9 +- .../liquidProperties/C16H34/C16H34.H | 15 +- .../liquidProperties/C16H34/C16H34I.H | 16 +- .../liquidProperties/C2H5OH/C2H5OH.C | 9 +- .../liquidProperties/C2H5OH/C2H5OH.H | 15 +- .../liquidProperties/C2H5OH/C2H5OHI.H | 16 +- .../liquidProperties/C2H6/C2H6.C | 9 +- .../liquidProperties/C2H6/C2H6.H | 15 +- .../liquidProperties/C2H6/C2H6I.H | 16 +- .../liquidProperties/C2H6O/C2H6O.C | 9 +- .../liquidProperties/C2H6O/C2H6O.H | 15 +- .../liquidProperties/C2H6O/C2H6OI.H | 16 +- .../liquidProperties/C3H6O/C3H6O.C | 9 +- .../liquidProperties/C3H6O/C3H6O.H | 15 +- .../liquidProperties/C3H6O/C3H6OI.H | 16 +- .../liquidProperties/C3H8/C3H8.C | 9 +- .../liquidProperties/C3H8/C3H8.H | 15 +- .../liquidProperties/C3H8/C3H8I.H | 16 +- .../liquidProperties/C4H10O/C4H10O.C | 9 +- .../liquidProperties/C4H10O/C4H10O.H | 15 +- .../liquidProperties/C4H10O/C4H10OI.H | 16 +- .../liquidProperties/C6H14/C6H14.C | 9 +- .../liquidProperties/C6H14/C6H14.H | 15 +- .../liquidProperties/C6H14/C6H14I.H | 17 +- .../liquidProperties/C6H6/C6H6.C | 9 +- .../liquidProperties/C6H6/C6H6.H | 15 +- .../liquidProperties/C6H6/C6H6I.H | 16 +- .../liquidProperties/C7H16/C7H16.C | 9 +- .../liquidProperties/C7H16/C7H16.H | 15 +- .../liquidProperties/C7H16/C7H16I.H | 16 +- .../liquidProperties/C7H8/C7H8.C | 9 +- .../liquidProperties/C7H8/C7H8.H | 15 +- .../liquidProperties/C7H8/C7H8I.H | 16 +- .../liquidProperties/C8H10/C8H10.C | 9 +- .../liquidProperties/C8H10/C8H10.H | 15 +- .../liquidProperties/C8H10/C8H10I.H | 16 +- .../liquidProperties/C8H18/C8H18.C | 9 +- .../liquidProperties/C8H18/C8H18.H | 15 +- .../liquidProperties/C8H18/C8H18I.H | 16 +- .../liquidProperties/C9H20/C9H20.C | 9 +- .../liquidProperties/C9H20/C9H20.H | 15 +- .../liquidProperties/C9H20/C9H20I.H | 16 +- .../liquidProperties/CH3OH/CH3OH.C | 9 +- .../liquidProperties/CH3OH/CH3OH.H | 15 +- .../liquidProperties/CH3OH/CH3OHI.H | 16 +- .../liquidProperties/CH4N2O/CH4N2O.C | 9 +- .../liquidProperties/CH4N2O/CH4N2O.H | 16 +- .../liquidProperties/CH4N2O/CH4N2OI.H | 16 +- .../liquidProperties/H2O/H2O.C | 9 +- .../liquidProperties/H2O/H2O.H | 15 +- .../liquidProperties/H2O/H2OI.H | 16 +- .../liquidProperties/IC8H18/IC8H18.C | 9 +- .../liquidProperties/IC8H18/IC8H18.H | 15 +- .../liquidProperties/IC8H18/IC8H18I.H | 16 +- .../liquidProperties/IDEA/IDEA.C | 9 +- .../liquidProperties/IDEA/IDEA.H | 15 +- .../liquidProperties/IDEA/IDEAI.H | 16 +- .../liquidProperties/MB/MB.C | 9 +- .../liquidProperties/MB/MB.H | 15 +- .../liquidProperties/MB/MBI.H | 16 +- .../liquidProperties/N2/N2.C | 9 +- .../liquidProperties/N2/N2.H | 15 +- .../liquidProperties/N2/N2I.H | 16 +- .../liquidProperties/aC10H7CH3/aC10H7CH3.C | 9 +- .../liquidProperties/aC10H7CH3/aC10H7CH3.H | 15 +- .../liquidProperties/aC10H7CH3/aC10H7CH3I.H | 16 +- .../liquidProperties/bC10H7CH3/bC10H7CH3.C | 9 +- .../liquidProperties/bC10H7CH3/bC10H7CH3.H | 15 +- .../liquidProperties/bC10H7CH3/bC10H7CH3I.H | 17 +- .../liquidProperties/iC3H8O/iC3H8O.C | 9 +- .../liquidProperties/iC3H8O/iC3H8O.H | 16 +- .../liquidProperties/iC3H8O/iC3H8OI.H | 16 +- .../liquidProperties/liquid/liquid.C | 8 +- .../liquidProperties/liquid/liquid.H | 15 +- .../liquidProperties/liquid/liquidI.H | 16 +- .../liquidProperties/liquidProperties.H | 17 +- .../liquidProperties/liquidPropertiesI.H | 20 +- .../liquidProperties/nC3H8O/nC3H8O.C | 9 +- .../liquidProperties/nC3H8O/nC3H8O.H | 16 +- .../liquidProperties/nC3H8O/nC3H8OI.H | 16 +- .../solidProperties/solidProperties.H | 9 +- .../solidProperties/solidPropertiesI.H | 12 +- .../cylinder/Allclean | 3 +- .../cylinder/constant/surfaceFilmProperties | 12 +- .../wallFilmRegion/thermophysicalProperties | 32 ++ .../cylinder/system/wallFilmRegion/fvSchemes | 2 +- .../cylinder/system/wallFilmRegion/fvSolution | 2 +- .../buoyantReactingParticleFoam/hotBoxes/0/T | 2 +- .../hotBoxes/Allclean | 3 +- .../hotBoxes/constant/surfaceFilmProperties | 12 +- .../wallFilmRegion/thermophysicalProperties | 32 ++ .../hotBoxes/system/wallFilmRegion/fvSchemes | 2 +- .../hotBoxes/system/wallFilmRegion/fvSolution | 2 +- .../rivuletPanel/Allclean | 3 +- .../constant/surfaceFilmProperties | 35 +- .../wallFilmRegion/thermophysicalProperties | 32 ++ .../system/wallFilmRegion/fvSchemes | 2 +- .../system/wallFilmRegion/fvSolution | 2 +- .../splashPanel/Allclean | 2 +- .../constant/surfaceFilmProperties | 12 +- .../wallFilm/thermophysicalProperties | 32 ++ .../splashPanel/system/wallFilm/fvSchemes | 2 +- .../splashPanel/system/wallFilm/fvSolution | 2 +- .../laminar/plateFilm/Allclean | 2 +- .../plateRegion/thermophysicalProperties | 32 ++ .../plateFilm/constant/surfaceFilmProperties | 47 +- .../constant/thermophysicalProperties.liquid | 29 +- .../plateFilm/system/plateRegion/fvSchemes | 2 +- .../plateFilm/system/plateRegion/fvSolution | 2 +- 176 files changed, 1530 insertions(+), 2458 deletions(-) delete mode 100644 src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/constantFilmThermo/constantFilmThermo.C delete mode 100644 src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/constantFilmThermo/constantFilmThermo.H delete mode 100644 src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModel.C delete mode 100644 src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModel.H delete mode 100644 src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModelNew.C delete mode 100644 src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/liquidFilmThermo/liquidFilmThermo.C delete mode 100644 src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/liquidFilmThermo/liquidFilmThermo.H rename src/regionModels/surfaceFilmModels/submodels/{thermo/filmViscosityModel/ArrheniusViscosity => kinematic/filmViscosityModel/Arrhenius}/ArrheniusViscosity.C (97%) rename src/regionModels/surfaceFilmModels/submodels/{thermo/filmViscosityModel/ArrheniusViscosity => kinematic/filmViscosityModel/Arrhenius}/ArrheniusViscosity.H (98%) rename src/regionModels/surfaceFilmModels/submodels/{thermo/filmViscosityModel/liquidViscosity/liquidViscosity.C => kinematic/filmViscosityModel/Newtonian/NewtonianViscosity.C} (89%) rename src/regionModels/surfaceFilmModels/submodels/{thermo/filmViscosityModel/liquidViscosity/liquidViscosity.H => kinematic/filmViscosityModel/Newtonian/NewtonianViscosity.H} (80%) rename src/regionModels/surfaceFilmModels/submodels/{thermo/filmViscosityModel/constantViscosity => kinematic/filmViscosityModel/constant}/constantViscosity.C (97%) rename src/regionModels/surfaceFilmModels/submodels/{thermo/filmViscosityModel/constantViscosity => kinematic/filmViscosityModel/constant}/constantViscosity.H (97%) rename src/regionModels/surfaceFilmModels/submodels/{thermo => kinematic}/filmViscosityModel/filmViscosityModel/filmViscosityModel.C (97%) rename src/regionModels/surfaceFilmModels/submodels/{thermo => kinematic}/filmViscosityModel/filmViscosityModel/filmViscosityModel.H (98%) rename src/regionModels/surfaceFilmModels/submodels/{thermo => kinematic}/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C (100%) rename src/regionModels/surfaceFilmModels/submodels/{thermo/filmViscosityModel/function1Viscosity => kinematic/filmViscosityModel/function1}/function1Viscosity.C (97%) rename src/regionModels/surfaceFilmModels/submodels/{thermo/filmViscosityModel/function1Viscosity => kinematic/filmViscosityModel/function1}/function1Viscosity.H (98%) rename src/regionModels/surfaceFilmModels/submodels/{thermo/filmViscosityModel/thixotropicViscosity => kinematic/filmViscosityModel/thixotropic}/thixotropicViscosity.C (100%) rename src/regionModels/surfaceFilmModels/submodels/{thermo/filmViscosityModel/thixotropicViscosity => kinematic/filmViscosityModel/thixotropic}/thixotropicViscosity.H (98%) rename src/regionModels/surfaceFilmModels/submodels/{thermo/filmViscosityModel/waxSolventViscosity => kinematic/filmViscosityModel/waxSolvent}/waxSolventViscosity.C (98%) rename src/regionModels/surfaceFilmModels/submodels/{thermo/filmViscosityModel/waxSolventViscosity => kinematic/filmViscosityModel/waxSolvent}/waxSolventViscosity.H (98%) create mode 100644 tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/constant/wallFilmRegion/thermophysicalProperties create mode 100644 tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/constant/wallFilmRegion/thermophysicalProperties create mode 100644 tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/constant/wallFilmRegion/thermophysicalProperties create mode 100644 tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/constant/wallFilm/thermophysicalProperties create mode 100644 tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/constant/plateRegion/thermophysicalProperties diff --git a/applications/solvers/multiphase/compressibleInterFoam/VoFPatchTransfer/VoFPatchTransfer.C b/applications/solvers/multiphase/compressibleInterFoam/VoFPatchTransfer/VoFPatchTransfer.C index 0d770acc07..70cd344d33 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/VoFPatchTransfer/VoFPatchTransfer.C +++ b/applications/solvers/multiphase/compressibleInterFoam/VoFPatchTransfer/VoFPatchTransfer.C @@ -225,6 +225,9 @@ void VoFPatchTransfer::correct const polyPatch& pp = pbm[patchi]; const labelList& faceCells = pp.faceCells(); + const vectorField& U = film.U(); + const scalarField& he = film.thermo().he(); + // Accumulate the total mass removed from patch scalar dMassPatch = 0; @@ -244,8 +247,8 @@ void VoFPatchTransfer::correct transferRateCoeff_*delta[celli]*rho[celli]*magSf[celli]; massToTransfer[celli] += dMass; - momentumToTransfer[celli] += dMass*film.U()[celli]; - energyToTransfer[celli] += dMass*film.h()[celli]; + momentumToTransfer[celli] += dMass*U[celli]; + energyToTransfer[celli] += dMass*he[celli]; } if diff --git a/applications/solvers/multiphase/compressibleInterFoam/VoFSurfaceFilm/VoFSurfaceFilm.C b/applications/solvers/multiphase/compressibleInterFoam/VoFSurfaceFilm/VoFSurfaceFilm.C index f198202925..1011f27953 100644 --- a/applications/solvers/multiphase/compressibleInterFoam/VoFSurfaceFilm/VoFSurfaceFilm.C +++ b/applications/solvers/multiphase/compressibleInterFoam/VoFSurfaceFilm/VoFSurfaceFilm.C @@ -131,11 +131,11 @@ void Foam::fv::VoFSurfaceFilm::addSup ) ); - const volScalarField CpVoF(thermo.thermo1().Cp()); + const volScalarField::Internal Cv(thermo.thermo1().Cv()); eqn += - film_->Sh()()/thermo.thermo1().Cp()() - + film_->Tref*film_->Srho(); + film_->Sh()()/Cv + + film_->Srho()*(eqn.psi() - thermo.thermo1().he()/Cv); } else { diff --git a/src/lagrangian/parcel/parcels/Templates/SprayParcel/SprayParcel.C b/src/lagrangian/parcel/parcels/Templates/SprayParcel/SprayParcel.C index 677babb7fa..e4d9babe8f 100644 --- a/src/lagrangian/parcel/parcels/Templates/SprayParcel/SprayParcel.C +++ b/src/lagrangian/parcel/parcels/Templates/SprayParcel/SprayParcel.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 @@ -346,8 +346,8 @@ Foam::scalar Foam::SprayParcel::chi scalar TBoil = liq.pvInvert(p0); scalar hl = liq.hl(pAmb, TBoil); - scalar iTp = liq.h(pAmb, T0) - pAmb/liq.rho(pAmb, T0); - scalar iTb = liq.h(pAmb, TBoil) - pAmb/liq.rho(pAmb, TBoil); + scalar iTp = liq.Ha(pAmb, T0) - pAmb/liq.rho(pAmb, T0); + scalar iTb = liq.Ha(pAmb, TBoil) - pAmb/liq.rho(pAmb, TBoil); chi += X[i]*(iTp - iTb)/hl; } diff --git a/src/lagrangian/parcel/parcels/Templates/SprayParcel/SprayParcelName.C b/src/lagrangian/parcel/parcels/Templates/SprayParcel/SprayParcelName.C index f920150265..7d7f4f8318 100644 --- a/src/lagrangian/parcel/parcels/Templates/SprayParcel/SprayParcelName.C +++ b/src/lagrangian/parcel/parcels/Templates/SprayParcel/SprayParcelName.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 @@ -34,4 +34,3 @@ namespace Foam // ************************************************************************* // - diff --git a/src/lagrangian/parcel/parcels/Templates/ThermoParcel/ThermoParcel.H b/src/lagrangian/parcel/parcels/Templates/ThermoParcel/ThermoParcel.H index 0c00565b05..69d08803a6 100644 --- a/src/lagrangian/parcel/parcels/Templates/ThermoParcel/ThermoParcel.H +++ b/src/lagrangian/parcel/parcels/Templates/ThermoParcel/ThermoParcel.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 @@ -369,9 +369,6 @@ public: //- Return const access to specific heat capacity inline scalar Cp() const; - //- Return the parcel sensible enthalpy - inline scalar hs() const; - // Edit diff --git a/src/lagrangian/parcel/parcels/Templates/ThermoParcel/ThermoParcelI.H b/src/lagrangian/parcel/parcels/Templates/ThermoParcel/ThermoParcelI.H index d83e3d5d2b..e2cc013573 100644 --- a/src/lagrangian/parcel/parcels/Templates/ThermoParcel/ThermoParcelI.H +++ b/src/lagrangian/parcel/parcels/Templates/ThermoParcel/ThermoParcelI.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 @@ -174,13 +174,6 @@ inline Foam::scalar Foam::ThermoParcel::Cp() const } -template -inline Foam::scalar Foam::ThermoParcel::hs() const -{ - return Cp_*(T_ - 298.15); -} - - template inline Foam::scalar& Foam::ThermoParcel::T() { diff --git a/src/lagrangian/parcel/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C b/src/lagrangian/parcel/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C index 23d520638b..0b8ee5cbdf 100644 --- a/src/lagrangian/parcel/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.C +++ b/src/lagrangian/parcel/submodels/Reacting/CompositionModel/CompositionModel/CompositionModel.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 @@ -299,7 +299,7 @@ Foam::scalar Foam::CompositionModel::H { forAll(Y, i) { - HMixture += Y[i]*thermo_.liquids().properties()[i].h(p, T); + HMixture += Y[i]*thermo_.liquids().properties()[i].Ha(p, T); } break; } @@ -307,12 +307,7 @@ Foam::scalar Foam::CompositionModel::H { forAll(Y, i) { - HMixture += - Y[i] - *( - thermo_.solids().properties()[i].Hf() - + thermo_.solids().properties()[i].Cp()*T - ); + HMixture += Y[i]*thermo_.solids().properties()[i].Ha(T); } break; } @@ -354,11 +349,7 @@ Foam::scalar Foam::CompositionModel::Hs forAll(Y, i) { HsMixture += - Y[i] - *( - thermo_.liquids().properties()[i].h(p, T) - - thermo_.liquids().properties()[i].h(p, 298.15) - ); + Y[i]*(thermo_.liquids().properties()[i].Hs(p, T)); } break; } @@ -366,7 +357,7 @@ Foam::scalar Foam::CompositionModel::Hs { forAll(Y, i) { - HsMixture += Y[i]*thermo_.solids().properties()[i].Cp()*T; + HsMixture += Y[i]*thermo_.solids().properties()[i].Hs(T); } break; } @@ -408,8 +399,7 @@ Foam::scalar Foam::CompositionModel::Hc { forAll(Y, i) { - HcMixture += - Y[i]*thermo_.liquids().properties()[i].h(p, 298.15); + HcMixture += Y[i]*thermo_.liquids().properties()[i].Hf(); } break; } diff --git a/src/lagrangian/parcel/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C b/src/lagrangian/parcel/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C index af0e9d3a6a..9afda88e83 100644 --- a/src/lagrangian/parcel/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.C +++ b/src/lagrangian/parcel/submodels/Reacting/PhaseChangeModel/LiquidEvaporation/LiquidEvaporation.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 @@ -230,7 +230,7 @@ Foam::scalar Foam::LiquidEvaporation::dh case (parent::etEnthalpyDifference): { scalar hc = this->owner().composition().carrier().Ha(idc, p, T); - scalar hp = liquids_.properties()[idl].h(p, T); + scalar hp = liquids_.properties()[idl].Ha(p, T); dh = hc - hp; break; diff --git a/src/lagrangian/parcel/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C b/src/lagrangian/parcel/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C index 5a480fa214..8b3ef66282 100644 --- a/src/lagrangian/parcel/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.C +++ b/src/lagrangian/parcel/submodels/Reacting/PhaseChangeModel/LiquidEvaporationBoil/LiquidEvaporationBoil.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 @@ -326,7 +326,7 @@ Foam::scalar Foam::LiquidEvaporationBoil::dh case (parent::etEnthalpyDifference): { scalar hc = this->owner().composition().carrier().Ha(idc, p, TDash); - scalar hp = liquids_.properties()[idl].h(p, TDash); + scalar hp = liquids_.properties()[idl].Ha(p, TDash); dh = hc - hp; break; diff --git a/src/lagrangian/parcel/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C b/src/lagrangian/parcel/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C index 5e34c6513c..c3a80118b3 100644 --- a/src/lagrangian/parcel/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C +++ b/src/lagrangian/parcel/submodels/Thermodynamic/SurfaceFilmModel/ThermoSurfaceFilm/ThermoSurfaceFilm.C @@ -140,6 +140,11 @@ void Foam::ThermoSurfaceFilm::absorbInteraction // Parcel tangential velocity const vector Ut = Urel - Un; + const liquidProperties& liq = thermo_.liquids().properties()[0]; + + // Local pressure + const scalar pc = thermo_.thermo().p()[p.cell()]; + filmModel.addSources ( pp.index(), @@ -147,7 +152,7 @@ void Foam::ThermoSurfaceFilm::absorbInteraction mass, // mass mass*Ut, // tangential momentum mass*mag(Un), // impingement pressure - mass*p.hs() // energy + mass*liq.Hs(pc, p.T()) // energy ); this->nParcelsTransferred()++; @@ -625,11 +630,11 @@ void Foam::ThermoSurfaceFilm::cacheFilmFields filmModel ); - TFilmPatch_ = thermalFilmModel.T().boundaryField()[filmPatchi]; + TFilmPatch_ = thermalFilmModel.thermo().T().boundaryField()[filmPatchi]; filmModel.toPrimary(filmPatchi, TFilmPatch_); - // CpFilmPatch_ = thermalFilmModel.Cpv().boundaryField()[filmPatchi]; - CpFilmPatch_ = thermalFilmModel.Cp().boundaryField()[filmPatchi]; + CpFilmPatch_ = + thermalFilmModel.thermo().Cpv()().boundaryField()[filmPatchi]; filmModel.toPrimary(filmPatchi, CpFilmPatch_); } diff --git a/src/regionModels/surfaceFilmModels/Make/files b/src/regionModels/surfaceFilmModels/Make/files index 413e68da8f..4c30c4d92e 100644 --- a/src/regionModels/surfaceFilmModels/Make/files +++ b/src/regionModels/surfaceFilmModels/Make/files @@ -32,15 +32,19 @@ $(KINEMATICMODELS)/transferModels/transferModel/transferModel.C $(KINEMATICMODELS)/transferModels/transferModel/transferModelNew.C $(KINEMATICMODELS)/transferModels/transferModelList/transferModelList.C -$(KINEMATICMODELS)/filmThermoModel/filmThermoModel/filmThermoModel.C -$(KINEMATICMODELS)/filmThermoModel/filmThermoModel/filmThermoModelNew.C -$(KINEMATICMODELS)/filmThermoModel/constantFilmThermo/constantFilmThermo.C -$(KINEMATICMODELS)/filmThermoModel/liquidFilmThermo/liquidFilmThermo.C - $(KINEMATICMODELS)/filmMomentumTransportModel/filmMomentumTransportModel/filmMomentumTransportModel.C $(KINEMATICMODELS)/filmMomentumTransportModel/filmMomentumTransportModel/filmMomentumTransportModelNew.C $(KINEMATICMODELS)/filmMomentumTransportModel/laminar/laminar.C +$(KINEMATICMODELS)/filmViscosityModel/filmViscosityModel/filmViscosityModel.C +$(KINEMATICMODELS)/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C +$(KINEMATICMODELS)/filmViscosityModel/constant/constantViscosity.C +$(KINEMATICMODELS)/filmViscosityModel/Newtonian/NewtonianViscosity.C +$(KINEMATICMODELS)/filmViscosityModel/thixotropic/thixotropicViscosity.C +$(KINEMATICMODELS)/filmViscosityModel/Arrhenius/ArrheniusViscosity.C +$(KINEMATICMODELS)/filmViscosityModel/function1/function1Viscosity.C +$(KINEMATICMODELS)/filmViscosityModel/waxSolvent/waxSolventViscosity.C + THERMOMODELS=submodels/thermo $(THERMOMODELS)/phaseChangeModel/phaseChangeModel/phaseChangeModel.C $(THERMOMODELS)/phaseChangeModel/phaseChangeModel/phaseChangeModelNew.C @@ -62,15 +66,6 @@ $(THERMOMODELS)/filmRadiationModel/constantRadiation/constantRadiation.C $(THERMOMODELS)/filmRadiationModel/primaryRadiation/primaryRadiation.C $(THERMOMODELS)/filmRadiationModel/standardRadiation/standardRadiation.C -$(THERMOMODELS)/filmViscosityModel/filmViscosityModel/filmViscosityModel.C -$(THERMOMODELS)/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C -$(THERMOMODELS)/filmViscosityModel/constantViscosity/constantViscosity.C -$(THERMOMODELS)/filmViscosityModel/liquidViscosity/liquidViscosity.C -$(THERMOMODELS)/filmViscosityModel/thixotropicViscosity/thixotropicViscosity.C -$(THERMOMODELS)/filmViscosityModel/ArrheniusViscosity/ArrheniusViscosity.C -$(THERMOMODELS)/filmViscosityModel/function1Viscosity/function1Viscosity.C -$(THERMOMODELS)/filmViscosityModel/waxSolventViscosity/waxSolventViscosity.C - # Boundary conditions PATCHFIELDS=derivedFvPatchFields diff --git a/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.C b/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.C index 5e594172cc..9bce130435 100644 --- a/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.C +++ b/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.C @@ -39,10 +39,9 @@ License #include "fvmSup.H" #include "constrainHbyA.H" -#include "addToRunTimeSelectionTable.H" #include "mappedWallPolyPatch.H" #include "mapDistribute.H" -#include "filmThermoModel.H" +#include "filmViscosityModel.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -57,8 +56,6 @@ namespace surfaceFilmModels defineTypeNameAndDebug(kinematicSingleLayer, 0); -addToRunTimeSelectionTable(surfaceFilmRegionModel, kinematicSingleLayer, mesh); - // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // bool kinematicSingleLayer::read() @@ -67,14 +64,6 @@ bool kinematicSingleLayer::read() } -void kinematicSingleLayer::correctThermoFields() -{ - rho_ == thermo_->rho(); - mu_ == thermo_->mu(); - sigma_ == thermo_->sigma(); -} - - void kinematicSingleLayer::resetPrimaryRegionSourceTerms() { DebugInFunction << endl; @@ -92,7 +81,7 @@ void kinematicSingleLayer::transferPrimaryRegionThermoFields() // Update fields from primary region via direct mapped // (coupled) boundary conditions UPrimary_.correctBoundaryConditions(); - pPrimary_.correctBoundaryConditions(); + p_.correctBoundaryConditions(); rhoPrimary_.correctBoundaryConditions(); muPrimary_.correctBoundaryConditions(); } @@ -147,7 +136,7 @@ void kinematicSingleLayer::transferPrimaryRegionSourceFields() tmp kinematicSingleLayer::pc() { - return -fvc::laplacian(sigma_, delta_); + return -fvc::laplacian(sigma(), delta_); } @@ -170,7 +159,7 @@ tmp kinematicSingleLayer::pe() return volScalarField::New ( IOobject::modelName("pe", typeName), - pPrimary_ // Pressure (mapped from primary region) + p_ // Pressure (mapped from primary region) - tpSp // Accumulated particle impingement ); } @@ -181,8 +170,8 @@ tmp kinematicSingleLayer::rhog() const return fvc::interpolate ( - max(nHat() & -g_, dimensionedScalar(g_.dimensions(), 0))*VbyA() - )*fvc::interpolate(rho_); + max(nHat() & -g(), dimensionedScalar(g().dimensions(), 0))*VbyA() + )*fvc::interpolate(rho()); } @@ -191,8 +180,8 @@ tmp kinematicSingleLayer::gGradRho() const return fvc::interpolate ( - max(nHat() & -g_, dimensionedScalar(g_.dimensions(), 0))*VbyA() - )*fvc::snGrad(rho_); + max(nHat() & -g(), dimensionedScalar(g().dimensions(), 0))*VbyA() + )*fvc::snGrad(rho()); } @@ -229,7 +218,7 @@ void kinematicSingleLayer::predictDelta() { DebugInFunction << endl; - solve(fvm::ddt(rho_, alpha_) + fvc::div(phi_) == -rhoSp_); + solve(fvm::ddt(rho(), alpha_) + fvc::div(phi_) == -rhoSp_); // Bound film volume fraction alpha_.max(0); @@ -243,7 +232,7 @@ void kinematicSingleLayer::predictDelta() void kinematicSingleLayer::updateContinuityErr() { - continuityErr_ = (fvc::ddt(alpha_, rho_) + fvc::div(phi_))() + rhoSp_; + continuityErr_ = (fvc::ddt(alpha_, rho()) + fvc::div(phi_))() + rhoSp_; } @@ -316,6 +305,9 @@ tmp kinematicSingleLayer::solveMomentum { DebugInFunction << endl; + // Evaluate viscosity from user-model + viscosity_->correct(thermo_->p(), thermo_->T()); + const volScalarField::Internal rVDt ( 1/(time().deltaT()*regionMesh().V()) @@ -324,7 +316,7 @@ tmp kinematicSingleLayer::solveMomentum // Momentum equation tmp tUEqn ( - fvm::ddt(alpha_, rho_, U_) + fvm::div(phi_, U_) + fvm::ddt(alpha_, rho(), U_) + fvm::div(phi_, U_) - fvm::Sp(continuityErr_, U_) == - USp_ @@ -355,7 +347,7 @@ tmp kinematicSingleLayer::solveMomentum + gGradRho()*alphaf + rhog()*fvc::snGrad(alpha_) )*regionMesh().magSf() - - fvc::interpolate(rho_)*(g_ & regionMesh().Sf()) + - fvc::interpolate(rho())*(g() & regionMesh().Sf()) ), 0 ) ) @@ -384,7 +376,7 @@ void kinematicSingleLayer::solveAlpha const volVectorField HbyA(constrainHbyA(rAU*UEqn.H(), U_, alpha_)); const surfaceScalarField alphaf(fvc::interpolate(alpha_)); - const surfaceScalarField rhof(fvc::interpolate(rho_)); + const surfaceScalarField rhof(fvc::interpolate(rho())); const surfaceScalarField alpharAUf(fvc::interpolate(alpha_*rAU)); const surfaceScalarField rhogf(rhog()); @@ -398,7 +390,7 @@ void kinematicSingleLayer::solveAlpha fvc::snGrad(pe + pc, "snGrad(p)") + gGradRho()*alphaf )*regionMesh().magSf() - - rhof*(g_ & regionMesh().Sf()), + - rhof*(g() & regionMesh().Sf()), 0 ) ) @@ -423,7 +415,7 @@ void kinematicSingleLayer::solveAlpha // Film thickness equation fvScalarMatrix alphaEqn ( - fvm::ddt(rho_, alpha_) + fvm::ddt(rho(), alpha_) + fvm::div(phid, alpha_) - fvm::laplacian(ddrhorAUrhogf, alpha_) == @@ -488,21 +480,21 @@ kinematicSingleLayer::kinematicSingleLayer deltaSmall_("deltaSmall", dimLength, small), deltaCoLimit_(solution().lookupOrDefault("deltaCoLimit", 1e-4)), - rho_ + p_ ( IOobject ( - "rho", + "p", time().timeName(), - regionMesh(), - IOobject::NO_READ, - IOobject::AUTO_WRITE + regionMesh() ), regionMesh(), - dimensionedScalar(dimDensity, 0), - zeroGradientFvPatchScalarField::typeName + dimensionedScalar(dimPressure, 0), + this->mappedFieldAndInternalPatchTypes() ), + thermo_(rhoThermo::New(regionMesh())), + mu_ ( IOobject @@ -518,21 +510,6 @@ kinematicSingleLayer::kinematicSingleLayer zeroGradientFvPatchScalarField::typeName ), - sigma_ - ( - IOobject - ( - "sigma", - time().timeName(), - regionMesh(), - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - regionMesh(), - dimensionedScalar(dimMass/sqr(dimTime), 0), - zeroGradientFvPatchScalarField::typeName - ), - delta_ ( IOobject @@ -798,21 +775,6 @@ kinematicSingleLayer::kinematicSingleLayer this->mappedFieldAndInternalPatchTypes() ), - pPrimary_ - ( - IOobject - ( - "p", // must have same name as p to enable mapping - time().timeName(), - regionMesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), - regionMesh(), - dimensionedScalar(dimPressure, 0), - this->mappedFieldAndInternalPatchTypes() - ), - rhoPrimary_ ( IOobject @@ -843,7 +805,9 @@ kinematicSingleLayer::kinematicSingleLayer this->mappedFieldAndInternalPatchTypes() ), - thermo_(thermoModel::New(*this, coeffs_)), + viscosity_(viscosityModel::New(*this, coeffs(), mu_)), + + sigma_(Function1::New("sigma", coeffs())), availableMass_(regionMesh().nCells(), 0), @@ -865,8 +829,6 @@ kinematicSingleLayer::kinematicSingleLayer correctCoverage(); - correctThermoFields(); - surfaceScalarField phi ( IOobject @@ -878,7 +840,7 @@ kinematicSingleLayer::kinematicSingleLayer IOobject::AUTO_WRITE, false ), - fvc::flux(alpha_*rho_*U_) + fvc::flux(alpha_*rho()*U_) ); phi_ == phi; @@ -895,6 +857,27 @@ kinematicSingleLayer::~kinematicSingleLayer() // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // +tmp kinematicSingleLayer::sigma() const +{ + tmp tsigma + ( + volScalarField::New + ( + type() + ":sigma", + regionMesh(), + dimensionedScalar(dimMass/sqr(dimTime), 0), + extrapolatedCalculatedFvPatchScalarField::typeName + ) + ); + + tsigma.ref().primitiveFieldRef() = sigma_->value(thermo_->T()); + + tsigma.ref().correctBoundaryConditions(); + + return tsigma; +} + + void kinematicSingleLayer::addSources ( const label patchi, @@ -927,8 +910,6 @@ void kinematicSingleLayer::preEvolveRegion() transferPrimaryRegionThermoFields(); - correctThermoFields(); - transferPrimaryRegionSourceFields(); // Reset transfer fields @@ -1028,7 +1009,7 @@ void kinematicSingleLayer::info() Info<< indent << "added mass = " << addedMassTotal << nl << indent << "current mass = " - << gSum((delta_*rho_*magSf())()) << nl + << gSum((delta_*rho()*magSf())()) << nl << indent << "min/max(mag(U)) = " << gMin(mag(Uinternal)) << ", " << gMax(mag(Uinternal)) << nl << indent << "min/max(delta) = " << gMin(deltaInternal) << ", " diff --git a/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.H b/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.H index a43710d35c..04db1f2fdc 100644 --- a/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.H +++ b/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayer.H @@ -41,6 +41,8 @@ SourceFiles #include "surfaceFields.H" #include "fvMatrices.H" #include "pimpleControl.H" +#include "rhoThermo.H" +#include "Function1.H" #include "ejectionModelList.H" #include "transferModelList.H" @@ -57,7 +59,7 @@ namespace surfaceFilmModels { // Forward class declarations -class thermoModel; +class viscosityModel; /*---------------------------------------------------------------------------*\ Class kinematicSingleLayer Declaration @@ -88,20 +90,17 @@ protected: // Thermo properties - // Fields + //- Pressure [Pa] + volScalarField p_; - //- Density [kg/m^3] - volScalarField rho_; - - //- Dynamic viscosity [Pa.s] - volScalarField mu_; - - //- Surface tension [m/s^2] - volScalarField sigma_; + autoPtr thermo_; // Fields + //- Dynamic viscosity [Pa.s] + volScalarField mu_; + //- Film thickness [m] volScalarField delta_; @@ -177,9 +176,6 @@ protected: //- Velocity [m/s] volVectorField UPrimary_; - //- Pressure [Pa] - volScalarField pPrimary_; - //- Density [kg/m^3] volScalarField rhoPrimary_; @@ -189,8 +185,11 @@ protected: // Sub-models - //- Film thermo model - autoPtr thermo_; + //- Viscosity model + autoPtr viscosity_; + + //- Surface tension function + autoPtr> sigma_; //- Available mass for transfer via sub-models scalarField availableMass_; @@ -219,9 +218,6 @@ protected: //- Read control parameters from dictionary virtual bool read(); - //- Correct the thermo fields - virtual void correctThermoFields(); - //- Reset source term fields virtual void resetPrimaryRegionSourceTerms(); @@ -325,11 +321,14 @@ public: // Thermo properties + //- Return the film density [kg/m^3] + inline const volScalarField& rho() const; + //- Return const access to the dynamic viscosity [Pa.s] inline const volScalarField& mu() const; - //- Return const access to the surface tension [kg/s^2] - inline const volScalarField& sigma() const; + //- Return the surface tension coefficient [kg/s^2] + tmp sigma() const; // Fields @@ -340,9 +339,6 @@ public: //- Return const access to the film volume fraction [] inline const volScalarField& alpha() const; - //- Return the film density [kg/m^3] - inline const volScalarField& rho() const; - //- Return the film velocity [m/s] inline const volVectorField& U() const; @@ -450,7 +446,7 @@ public: // Sub-models //- Film thermo - inline const thermoModel& thermo() const; + inline const rhoThermo& thermo() const; //- Ejection inline ejectionModelList& ejection(); diff --git a/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayerI.H b/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayerI.H index d6bc9a5a42..99432985ce 100644 --- a/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayerI.H +++ b/src/regionModels/surfaceFilmModels/kinematicSingleLayer/kinematicSingleLayerI.H @@ -23,7 +23,6 @@ License \*---------------------------------------------------------------------------*/ -#include "filmThermoModel.H" #include "surfaceInterpolate.H" #include "fvcSurfaceIntegrate.H" @@ -44,15 +43,15 @@ inline const dimensionedScalar& kinematicSingleLayer::deltaSmall() const } -inline const volScalarField& kinematicSingleLayer::mu() const +inline const volScalarField& kinematicSingleLayer::rho() const { - return mu_; + return thermo_->rho(); } -inline const volScalarField& kinematicSingleLayer::sigma() const +inline const volScalarField& kinematicSingleLayer::mu() const { - return sigma_; + return mu_; } @@ -68,12 +67,6 @@ inline const volScalarField& kinematicSingleLayer::alpha() const } -inline const volScalarField& kinematicSingleLayer::rho() const -{ - return rho_; -} - - inline const volVectorField& kinematicSingleLayer::U() const { return U_; @@ -173,7 +166,7 @@ inline const volVectorField& kinematicSingleLayer::UPrimary() const inline const volScalarField& kinematicSingleLayer::pPrimary() const { - return pPrimary_; + return thermo_->p(); } @@ -189,7 +182,7 @@ inline const volScalarField& kinematicSingleLayer::muPrimary() const } -inline const thermoModel& kinematicSingleLayer::thermo() const +inline const rhoThermo& kinematicSingleLayer::thermo() const { return thermo_(); } @@ -216,7 +209,7 @@ kinematicSingleLayer::momentumTransport() const inline tmp kinematicSingleLayer::mass() const { - return rho_()*delta_()*magSf(); + return rho()()*delta_()*magSf(); } diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/ejectionModel/BrunDrippingEjection/BrunDrippingEjection.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/ejectionModel/BrunDrippingEjection/BrunDrippingEjection.C index 89567ed2ca..38d69a7746 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/ejectionModel/BrunDrippingEjection/BrunDrippingEjection.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/ejectionModel/BrunDrippingEjection/BrunDrippingEjection.C @@ -82,7 +82,10 @@ void BrunDrippingEjection::correct const scalarField& delta = film.delta(); const scalarField& rho = film.rho(); - const scalarField& sigma = film.sigma(); + + const tmp tsigma = film.sigma(); + const volScalarField::Internal& sigma = tsigma(); + const scalar magg = mag(film.g().value()); forAll(delta, celli) diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/ejectionModel/curvatureSeparation/curvatureSeparation.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/ejectionModel/curvatureSeparation/curvatureSeparation.C index 4cd71a5f7a..824fe68457 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/ejectionModel/curvatureSeparation/curvatureSeparation.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/ejectionModel/curvatureSeparation/curvatureSeparation.C @@ -250,7 +250,9 @@ void curvatureSeparation::correct const surfaceScalarField& phi = film.phi(); const volScalarField& rho = film.rho(); const scalarField magSqrU(magSqr(film.U())); - const volScalarField& sigma = film.sigma(); + + const tmp tsigma = film.sigma(); + const volScalarField::Internal& sigma = tsigma(); const scalarField invR1(calcInvR1(U)); const scalarField cosAngle(calcCosAngle(phi)); diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/constantFilmThermo/constantFilmThermo.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/constantFilmThermo/constantFilmThermo.C deleted file mode 100644 index 4d63ee63bb..0000000000 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/constantFilmThermo/constantFilmThermo.C +++ /dev/null @@ -1,366 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "constantFilmThermo.H" -#include "extrapolatedCalculatedFvPatchFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace regionModels -{ -namespace surfaceFilmModels -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(constantFilmThermo, 0); - -addToRunTimeSelectionTable -( - thermoModel, - constantFilmThermo, - dictionary -); - - -void constantFilmThermo::init(thermoData& td) -{ - if (coeffDict_.readIfPresent(td.name_, td.value_)) - { - td.set_ = true; - } -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -constantFilmThermo::constantFilmThermo -( - surfaceFilmRegionModel& film, - const dictionary& dict -) -: - thermoModel(typeName, film, dict), - name_(coeffDict_.lookup("specie")), - rho0_("rho0"), - mu0_("mu0"), - sigma0_("sigma0"), - Cp0_("Cp0"), - kappa0_("kappa0"), - D0_("D0"), - hl0_("hl0"), - pv0_("pv0"), - W0_("W0"), - Tb0_("Tb0") -{ - init(rho0_); - init(mu0_); - init(sigma0_); - init(Cp0_); - init(kappa0_); - init(D0_); - init(hl0_); - init(pv0_); - init(W0_); - init(Tb0_); -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -constantFilmThermo::~constantFilmThermo() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -const word& constantFilmThermo::name() const -{ - return name_; -} - - -scalar constantFilmThermo::rho -( - const scalar p, - const scalar T -) const -{ - if (!rho0_.set_) - { - coeffDict_.lookup(rho0_.name_) >> rho0_.value_; - rho0_.set_ = true; - } - - return rho0_.value_; -} - - -scalar constantFilmThermo::mu -( - const scalar p, - const scalar T -) const -{ - if (!mu0_.set_) - { - coeffDict_.lookup(mu0_.name_) >> mu0_.value_; - mu0_.set_ = true; - } - - return mu0_.value_; -} - - -scalar constantFilmThermo::sigma -( - const scalar p, - const scalar T -) const -{ - if (!sigma0_.set_) - { - coeffDict_.lookup(sigma0_.name_) >> sigma0_.value_; - sigma0_.set_ = true; - } - - return sigma0_.value_; -} - - -scalar constantFilmThermo::Cp -( - const scalar p, - const scalar T -) const -{ - if (!Cp0_.set_) - { - coeffDict_.lookup(Cp0_.name_) >> Cp0_.value_; - Cp0_.set_ = true; - } - - return Cp0_.value_; -} - - -scalar constantFilmThermo::kappa -( - const scalar p, - const scalar T -) const -{ - if (!kappa0_.set_) - { - coeffDict_.lookup(kappa0_.name_) >> kappa0_.value_; - kappa0_.set_ = true; - } - - return kappa0_.value_; -} - - -scalar constantFilmThermo::D -( - const scalar p, - const scalar T -) const -{ - if (!D0_.set_) - { - coeffDict_.lookup(D0_.name_) >> D0_.value_; - D0_.set_ = true; - } - - return D0_.value_; -} - - -scalar constantFilmThermo::hl -( - const scalar p, - const scalar T -) const -{ - if (!hl0_.set_) - { - coeffDict_.lookup(hl0_.name_) >> hl0_.value_; - hl0_.set_ = true; - } - - return hl0_.value_; -} - - -scalar constantFilmThermo::pv -( - const scalar p, - const scalar T -) const -{ - if (!pv0_.set_) - { - coeffDict_.lookup(pv0_.name_) >> pv0_.value_; - pv0_.set_ = true; - } - - return pv0_.value_; -} - - -scalar constantFilmThermo::W() const -{ - if (!W0_.set_) - { - coeffDict_.lookup(W0_.name_) >> W0_.value_; - W0_.set_ = true; - } - - return W0_.value_; -} - - -scalar constantFilmThermo::Tb(const scalar p) const -{ - if (!Tb0_.set_) - { - coeffDict_.lookup(Tb0_.name_) >> Tb0_.value_; - Tb0_.set_ = true; - } - - return Tb0_.value_; -} - - -tmp constantFilmThermo::rho() const -{ - tmp trho - ( - volScalarField::New - ( - type() + ':' + rho0_.name_, - film().regionMesh(), - dimensionedScalar(dimDensity, 0), - extrapolatedCalculatedFvPatchScalarField::typeName - ) - ); - - trho.ref().primitiveFieldRef() = this->rho(0, 0); - trho.ref().correctBoundaryConditions(); - - return trho; -} - - -tmp constantFilmThermo::mu() const -{ - tmp tmu - ( - volScalarField::New - ( - type() + ':' + mu0_.name_, - film().regionMesh(), - dimensionedScalar(dimPressure*dimTime, 0), - extrapolatedCalculatedFvPatchScalarField::typeName - ) - ); - - tmu.ref().primitiveFieldRef() = this->mu(0, 0); - tmu.ref().correctBoundaryConditions(); - - return tmu; -} - - -tmp constantFilmThermo::sigma() const -{ - tmp tsigma - ( - volScalarField::New - ( - type() + ':' + sigma0_.name_, - film().regionMesh(), - dimensionedScalar(dimMass/sqr(dimTime), 0), - extrapolatedCalculatedFvPatchScalarField::typeName - ) - ); - - tsigma.ref().primitiveFieldRef() = this->sigma(0, 0); - tsigma.ref().correctBoundaryConditions(); - - return tsigma; -} - - -tmp constantFilmThermo::Cp() const -{ - tmp tCp - ( - volScalarField::New - ( - type() + ':' + Cp0_.name_, - film().regionMesh(), - dimensionedScalar(dimEnergy/dimMass/dimTemperature, 0), - extrapolatedCalculatedFvPatchScalarField::typeName - ) - ); - - tCp.ref().primitiveFieldRef() = this->Cp(0, 0); - tCp.ref().correctBoundaryConditions(); - - return tCp; -} - - -tmp constantFilmThermo::kappa() const -{ - tmp tkappa - ( - volScalarField::New - ( - type() + ':' + kappa0_.name_, - film().regionMesh(), - dimensionedScalar(dimPower/dimLength/dimTemperature, 0), - extrapolatedCalculatedFvPatchScalarField::typeName - ) - ); - - tkappa.ref().primitiveFieldRef() = this->kappa(0, 0); - tkappa.ref().correctBoundaryConditions(); - - return tkappa; -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace regionModels -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/constantFilmThermo/constantFilmThermo.H b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/constantFilmThermo/constantFilmThermo.H deleted file mode 100644 index f5fc03104c..0000000000 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/constantFilmThermo/constantFilmThermo.H +++ /dev/null @@ -1,223 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::regionModels::surfaceFilmModels::constantFilmThermo - -Description - Constant thermo model - -SourceFiles - constantFilmThermo.C - -\*---------------------------------------------------------------------------*/ - -#ifndef constantFilmThermo_H -#define constantFilmThermo_H - -#include "filmThermoModel.H" -#include "dimensionSet.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace regionModels -{ -namespace surfaceFilmModels -{ - -/*---------------------------------------------------------------------------*\ - Class constantFilmThermo Declaration -\*---------------------------------------------------------------------------*/ - -class constantFilmThermo -: - public thermoModel -{ -public: - - struct thermoData - { - word name_; - scalar value_; - bool set_; - - thermoData() - : - name_("unknown"), - value_(0.0), - set_(false) - {} - - thermoData(const word& n) - : - name_(n), - value_(0.0), - set_(false) - {} - }; - - -private: - - // Private Data - - //- Specie name - word name_; - - //- Density [kg/m^3] - mutable thermoData rho0_; - - //- Dynamic viscosity [Pa.s] - mutable thermoData mu0_; - - //- Surface tension [kg/s^2] - mutable thermoData sigma0_; - - //- Specific heat capacity [J/kg/K] - mutable thermoData Cp0_; - - //- Thermal conductivity [W/m/K] - mutable thermoData kappa0_; - - //- Diffusivity [m^2/s] - mutable thermoData D0_; - - //- Latent heat [J/kg] - mutable thermoData hl0_; - - //- Vapour pressure [Pa] - mutable thermoData pv0_; - - //- Molecular weight [kg/kmol] - mutable thermoData W0_; - - //- Boiling temperature [K] - mutable thermoData Tb0_; - - - // Private Member Functions - - //- Initialise thermoData object - void init(thermoData& td); - - -public: - - //- Runtime type information - TypeName("constant"); - - - // Constructors - - //- Construct from surface film model and dictionary - constantFilmThermo - ( - surfaceFilmRegionModel& film, - const dictionary& dict - ); - - //- Disallow default bitwise copy construction - constantFilmThermo(const constantFilmThermo&) = delete; - - - //- Destructor - virtual ~constantFilmThermo(); - - - // Member Functions - - //- Return the specie name - virtual const word& name() const; - - - // Elemental access - - //- Return density [kg/m^3] - virtual scalar rho(const scalar p, const scalar T) const; - - //- Return dynamic viscosity [Pa.s] - virtual scalar mu(const scalar p, const scalar T) const; - - //- Return surface tension [kg/s^2] - virtual scalar sigma(const scalar p, const scalar T) const; - - //- Return specific heat capacity [J/kg/K] - virtual scalar Cp(const scalar p, const scalar T) const; - - //- Return thermal conductivity [W/m/K] - virtual scalar kappa(const scalar p, const scalar T) const; - - //- Return diffusivity [m^2/s] - virtual scalar D(const scalar p, const scalar T) const; - - //- Return latent heat [J/kg] - virtual scalar hl(const scalar p, const scalar T) const; - - //- Return vapour pressure [Pa] - virtual scalar pv(const scalar p, const scalar T) const; - - //- Return molecular weight [kg/kmol] - virtual scalar W() const; - - //- Return boiling temperature [K] - virtual scalar Tb(const scalar p) const; - - - // Field access - - //- Return density [kg/m^3] - virtual tmp rho() const; - - //- Return dynamic viscosity [Pa.s] - virtual tmp mu() const; - - //- Return surface tension [kg/s^2] - virtual tmp sigma() const; - - //- Return specific heat capacity [J/kg/K] - virtual tmp Cp() const; - - //- Return thermal conductivity [W/m/K] - virtual tmp kappa() const; - - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const constantFilmThermo&) = delete; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace regionModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModel.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModel.C deleted file mode 100644 index 6dd23d813e..0000000000 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModel.C +++ /dev/null @@ -1,76 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "filmThermoModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace regionModels -{ -namespace surfaceFilmModels -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(thermoModel, 0); -defineRunTimeSelectionTable(thermoModel, dictionary); - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -thermoModel::thermoModel -( - surfaceFilmRegionModel& film -) -: - filmSubModelBase(film) -{} - - -thermoModel::thermoModel -( - const word& modelType, - surfaceFilmRegionModel& film, - const dictionary& dict -) -: - filmSubModelBase(film, dict, typeName, modelType) -{} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -thermoModel::~thermoModel() -{} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace regionModels -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModel.H b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModel.H deleted file mode 100644 index e98f0f3dc1..0000000000 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModel.H +++ /dev/null @@ -1,184 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2020 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::regionModels::surfaceFilmModels::thermoModel - -Description - Base class for film thermo models - -SourceFiles - filmThermoModel.C - filmThermoModelNew.C - -\*---------------------------------------------------------------------------*/ - -#ifndef filmThermoModel_H -#define filmThermoModel_H - -#include "filmSubModelBase.H" -#include "runTimeSelectionTables.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace regionModels -{ -namespace surfaceFilmModels -{ - -/*---------------------------------------------------------------------------*\ - Class thermoModel Declaration -\*---------------------------------------------------------------------------*/ - -class thermoModel -: - public filmSubModelBase -{ -public: - - //- Runtime type information - TypeName("thermophysicalProperties"); - - - // Declare runtime constructor selection table - - declareRunTimeSelectionTable - ( - autoPtr, - thermoModel, - dictionary, - ( - surfaceFilmRegionModel& film, - const dictionary& dict - ), - (film, dict) - ); - - // Constructors - - //- Construct null - thermoModel(surfaceFilmRegionModel& film); - - //- Construct from type name, dictionary and surface film model - thermoModel - ( - const word& modelType, - surfaceFilmRegionModel& film, - const dictionary& dict - ); - - //- Disallow default bitwise copy construction - thermoModel(const thermoModel&) = delete; - - - // Selectors - - //- Return a reference to the selected phase change model - static autoPtr New - ( - surfaceFilmRegionModel& film, - const dictionary& dict - ); - - - //- Destructor - virtual ~thermoModel(); - - - // Member Functions - - //- Return the specie name - virtual const word& name() const = 0; - - - // Elemental access - - //- Return density [kg/m^3] - virtual scalar rho(const scalar p, const scalar T) const = 0; - - //- Return dynamic viscosity [Pa.s] - virtual scalar mu(const scalar p, const scalar T) const = 0; - - //- Return surface tension [kg/s^2] - virtual scalar sigma(const scalar p, const scalar T) const = 0; - - //- Return specific heat capacity [J/kg/K] - virtual scalar Cp(const scalar p, const scalar T) const = 0; - - //- Return thermal conductivity [W/m/K] - virtual scalar kappa(const scalar p, const scalar T) const = 0; - - //- Return diffusivity [m^2/s] - virtual scalar D(const scalar p, const scalar T) const = 0; - - //- Return latent heat [J/kg] - virtual scalar hl(const scalar p, const scalar T) const = 0; - - //- Return vapour pressure [Pa] - virtual scalar pv(const scalar p, const scalar T) const = 0; - - //- Return molecular weight [kg/kmol] - virtual scalar W() const = 0; - - //- Return boiling temperature [K] - virtual scalar Tb(const scalar p) const = 0; - - - // Field access - - //- Return density [kg/m^3] - virtual tmp rho() const = 0; - - //- Return dynamic viscosity [Pa.s] - virtual tmp mu() const = 0; - - //- Return surface tension [kg/s^2] - virtual tmp sigma() const = 0; - - //- Return specific heat capacity [J/kg/K] - virtual tmp Cp() const = 0; - - //- Return thermal conductivity [W/m/K] - virtual tmp kappa() const = 0; - - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const thermoModel&) = delete; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace regionModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModelNew.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModelNew.C deleted file mode 100644 index cc0525b24a..0000000000 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/filmThermoModel/filmThermoModelNew.C +++ /dev/null @@ -1,95 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "filmThermoModel.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace regionModels -{ -namespace surfaceFilmModels -{ - -// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * // - -autoPtr thermoModel::New -( - surfaceFilmRegionModel& model, - const dictionary& dict -) -{ - dict.lookupEntryBackwardsCompatible - ( - {thermoModel::typeName, "filmThermoModel"}, - false, - true - ); - - const dictionary& thermophysicalPropertiesDict - ( - dict.found(thermoModel::typeName) - ? dict.subDict(thermoModel::typeName) - : dict - ); - - const word modelType - ( - dict.found(thermoModel::typeName) - ? thermophysicalPropertiesDict.lookup("type") - : thermophysicalPropertiesDict.lookup("filmThermoModel") - ); - - Info<< " Selecting " << thermoModel::typeName - << " " << modelType << endl; - - dictionaryConstructorTable::iterator cstrIter = - dictionaryConstructorTablePtr_->find(modelType); - - if (cstrIter == dictionaryConstructorTablePtr_->end()) - { - FatalErrorInFunction - << "Unknown " << thermoModel::typeName - << " type " << modelType << nl << nl - << "Valid " << thermoModel::typeName << " types are:" << nl - << dictionaryConstructorTablePtr_->toc() - << exit(FatalError); - } - - return autoPtr - ( - cstrIter()(model, thermophysicalPropertiesDict) - ); -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace regionModels -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/liquidFilmThermo/liquidFilmThermo.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/liquidFilmThermo/liquidFilmThermo.C deleted file mode 100644 index 7c0a17550f..0000000000 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/liquidFilmThermo/liquidFilmThermo.C +++ /dev/null @@ -1,429 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -\*---------------------------------------------------------------------------*/ - -#include "liquidFilmThermo.H" -#include "demandDrivenData.H" -#include "thermoSingleLayer.H" -#include "extrapolatedCalculatedFvPatchFields.H" -#include "addToRunTimeSelectionTable.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace regionModels -{ -namespace surfaceFilmModels -{ - -// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // - -defineTypeNameAndDebug(liquidFilmThermo, 0); - -addToRunTimeSelectionTable -( - thermoModel, - liquidFilmThermo, - dictionary -); - - -// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // - -const thermoSingleLayer& liquidFilmThermo::thermoFilm() const -{ - if (!isA(filmModel_)) - { - FatalErrorInFunction - << "Thermo model requires a " << thermoSingleLayer::typeName - << " film to supply the pressure and temperature, but " - << filmModel_.type() << " film model selected. " - << "Use the 'useReferenceValues' flag to employ reference " - << "pressure and temperature" << exit(FatalError); - } - - return refCast(filmModel_); -} - - -// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // - -liquidFilmThermo::liquidFilmThermo -( - surfaceFilmRegionModel& film, - const dictionary& dict -) -: - thermoModel(typeName, film, dict), - useReferenceValues_(readBool(coeffDict_.lookup("useReferenceValues"))), - pRef_(0.0), - TRef_(0.0) -{ - if (dict.found("mixture")) - { - const dictionary& mixtureDict = dict.subDict("mixture"); - - const word name(mixtureDict.first()->keyword()); - - if (mixtureDict.isDict(name)) - { - liquidPtr_ = liquidProperties::New(mixtureDict.subDict(name)); - } - else - { - liquidPtr_ = liquidProperties::New(name); - } - } - else - { - liquidPtr_ = liquidProperties::New(dict.lookup("liquid")); - } - - if (useReferenceValues_) - { - coeffDict_.lookup("pRef") >> pRef_; - coeffDict_.lookup("TRef") >> TRef_; - } -} - - -// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // - -liquidFilmThermo::~liquidFilmThermo() -{} - - -// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // - -const word& liquidFilmThermo::name() const -{ - return liquidPtr_->name(); -} - - -scalar liquidFilmThermo::rho -( - const scalar p, - const scalar T -) const -{ - return liquidPtr_->rho(p, T); -} - - -scalar liquidFilmThermo::mu -( - const scalar p, - const scalar T -) const -{ - return liquidPtr_->mu(p, T); -} - - -scalar liquidFilmThermo::sigma -( - const scalar p, - const scalar T -) const -{ - return liquidPtr_->sigma(p, T); -} - - -scalar liquidFilmThermo::Cp -( - const scalar p, - const scalar T -) const -{ - return liquidPtr_->Cp(p, T); -} - - -scalar liquidFilmThermo::kappa -( - const scalar p, - const scalar T -) const -{ - return liquidPtr_->kappa(p, T); -} - - -scalar liquidFilmThermo::D -( - const scalar p, - const scalar T -) const -{ - return liquidPtr_->D(p, T); -} - - -scalar liquidFilmThermo::hl -( - const scalar p, - const scalar T -) const -{ - return liquidPtr_->hl(p, T); -} - - -scalar liquidFilmThermo::pv -( - const scalar p, - const scalar T -) const -{ - return liquidPtr_->pv(p, T); -} - - -scalar liquidFilmThermo::W() const -{ - return liquidPtr_->W(); -} - - -scalar liquidFilmThermo::Tb(const scalar p) const -{ - return liquidPtr_->pvInvert(p); -} - - -tmp liquidFilmThermo::rho() const -{ - tmp trho - ( - volScalarField::New - ( - type() + ":rho", - film().regionMesh(), - dimensionedScalar(dimDensity, 0), - extrapolatedCalculatedFvPatchScalarField::typeName - ) - ); - - scalarField& rho = trho.ref().primitiveFieldRef(); - - if (useReferenceValues_) - { - forAll(rho, celli) - { - rho[celli] = this->rho(pRef_, TRef_); - } - } - else - { - const thermoSingleLayer& film = thermoFilm(); - - const volScalarField& T = film.T(); - const volScalarField& p = film.pPrimary(); - - forAll(rho, celli) - { - rho[celli] = this->rho(p[celli], T[celli]); - } - } - - trho.ref().correctBoundaryConditions(); - - return trho; -} - - -tmp liquidFilmThermo::mu() const -{ - tmp tmu - ( - volScalarField::New - ( - type() + ":mu", - film().regionMesh(), - dimensionedScalar(dimPressure*dimTime, 0), - extrapolatedCalculatedFvPatchScalarField::typeName - ) - ); - - scalarField& mu = tmu.ref().primitiveFieldRef(); - - if (useReferenceValues_) - { - forAll(mu, celli) - { - mu[celli] = this->mu(pRef_, TRef_); - } - } - else - { - const thermoSingleLayer& film = thermoFilm(); - - const volScalarField& T = film.T(); - const volScalarField& p = film.pPrimary(); - - forAll(mu, celli) - { - mu[celli] = this->mu(p[celli], T[celli]); - } - } - - tmu.ref().correctBoundaryConditions(); - - return tmu; -} - - -tmp liquidFilmThermo::sigma() const -{ - tmp tsigma - ( - volScalarField::New - ( - type() + ":sigma", - film().regionMesh(), - dimensionedScalar(dimMass/sqr(dimTime), 0), - extrapolatedCalculatedFvPatchScalarField::typeName - ) - ); - - scalarField& sigma = tsigma.ref().primitiveFieldRef(); - - if (useReferenceValues_) - { - forAll(sigma, celli) - { - sigma[celli] = this->sigma(pRef_, TRef_); - } - } - else - { - const thermoSingleLayer& film = thermoFilm(); - - const volScalarField& T = film.T(); - const volScalarField& p = film.pPrimary(); - - forAll(sigma, celli) - { - sigma[celli] = this->sigma(p[celli], T[celli]); - } - } - - tsigma.ref().correctBoundaryConditions(); - - return tsigma; -} - - -tmp liquidFilmThermo::Cp() const -{ - tmp tCp - ( - volScalarField::New - ( - type() + ":Cp", - film().regionMesh(), - dimensionedScalar(dimEnergy/dimMass/dimTemperature, 0), - extrapolatedCalculatedFvPatchScalarField::typeName - ) - ); - - scalarField& Cp = tCp.ref().primitiveFieldRef(); - - if (useReferenceValues_) - { - forAll(Cp, celli) - { - Cp[celli] = this->Cp(pRef_, TRef_); - } - } - else - { - const thermoSingleLayer& film = thermoFilm(); - - const volScalarField& T = film.T(); - const volScalarField& p = film.pPrimary(); - - forAll(Cp, celli) - { - Cp[celli] = this->Cp(p[celli], T[celli]); - } - } - - tCp.ref().correctBoundaryConditions(); - - return tCp; -} - - -tmp liquidFilmThermo::kappa() const -{ - tmp tkappa - ( - volScalarField::New - ( - type() + ":kappa", - film().regionMesh(), - dimensionedScalar(dimPower/dimLength/dimTemperature, 0), - extrapolatedCalculatedFvPatchScalarField::typeName - ) - ); - - scalarField& kappa = tkappa.ref().primitiveFieldRef(); - - if (useReferenceValues_) - { - forAll(kappa, celli) - { - kappa[celli] = this->kappa(pRef_, TRef_); - } - } - else - { - const thermoSingleLayer& film = thermoFilm(); - - const volScalarField& T = film.T(); - const volScalarField& p = film.pPrimary(); - - forAll(kappa, celli) - { - kappa[celli] = this->kappa(p[celli], T[celli]); - } - } - - tkappa.ref().correctBoundaryConditions(); - - return tkappa; -} - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace regionModels -} // End namespace Foam - -// ************************************************************************* // diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/liquidFilmThermo/liquidFilmThermo.H b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/liquidFilmThermo/liquidFilmThermo.H deleted file mode 100644 index 5525fa35ab..0000000000 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/filmThermoModel/liquidFilmThermo/liquidFilmThermo.H +++ /dev/null @@ -1,187 +0,0 @@ -/*---------------------------------------------------------------------------*\ - ========= | - \\ / F ield | OpenFOAM: The Open Source CFD Toolbox - \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation - \\/ M anipulation | -------------------------------------------------------------------------------- -License - This file is part of OpenFOAM. - - OpenFOAM is free software: you can redistribute it and/or modify it - under the terms of the GNU General Public License as published by - the Free Software Foundation, either version 3 of the License, or - (at your option) any later version. - - OpenFOAM is distributed in the hope that it will be useful, but WITHOUT - ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or - FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License - for more details. - - You should have received a copy of the GNU General Public License - along with OpenFOAM. If not, see . - -Class - Foam::regionModels::surfaceFilmModels::liquidFilmThermo - -Description - Liquid thermo model - -SourceFiles - liquidFilmThermo.C - -\*---------------------------------------------------------------------------*/ - -#ifndef liquidFilmThermo_H -#define liquidFilmThermo_H - -#include "filmThermoModel.H" -#include "liquidProperties.H" - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -namespace Foam -{ -namespace regionModels -{ -namespace surfaceFilmModels -{ - -// Forward class declarations -class thermoSingleLayer; - -/*---------------------------------------------------------------------------*\ - Class liquidFilmThermo Declaration -\*---------------------------------------------------------------------------*/ - -class liquidFilmThermo -: - public thermoModel -{ -protected: - - // Protected data - - //- Pointer to the liquid properties - autoPtr liquidPtr_; - - //- Flag to indicate that model owns the liquid object - bool ownLiquid_; - - //- Flag to indicate that reference values of p and T should be used - bool useReferenceValues_; - - //- Reference pressure [pa] - scalar pRef_; - - //- Reference temperature [K] - scalar TRef_; - - - // Protected member functions - - //- Return a reference to a thermo film - const thermoSingleLayer& thermoFilm() const; - - //- Initialise the liquid pointer - void initLiquid(const dictionary& dict); - - -public: - - //- Runtime type information - TypeName("liquid"); - - - // Constructors - - //- Construct from surface film model and dictionary - liquidFilmThermo - ( - surfaceFilmRegionModel& film, - const dictionary& dict - ); - - //- Disallow default bitwise copy construction - liquidFilmThermo(const liquidFilmThermo&) = delete; - - - //- Destructor - virtual ~liquidFilmThermo(); - - - // Member Functions - - //- Return the specie name - virtual const word& name() const; - - - // Elemental access - - //- Return density [kg/m^3] - virtual scalar rho(const scalar p, const scalar T) const; - - //- Return dynamic viscosity [Pa.s] - virtual scalar mu(const scalar p, const scalar T) const; - - //- Return surface tension [kg/s^2] - virtual scalar sigma(const scalar p, const scalar T) const; - - //- Return specific heat capacity [J/kg/K] - virtual scalar Cp(const scalar p, const scalar T) const; - - //- Return thermal conductivity [W/m/K] - virtual scalar kappa(const scalar p, const scalar T) const; - - //- Return diffusivity [m^2/s] - virtual scalar D(const scalar p, const scalar T) const; - - //- Return latent heat [J/kg] - virtual scalar hl(const scalar p, const scalar T) const; - - //- Return vapour pressure [Pa] - virtual scalar pv(const scalar p, const scalar T) const; - - //- Return molecular weight [kg/kmol] - virtual scalar W() const; - - //- Return boiling temperature [K] - virtual scalar Tb(const scalar p) const; - - - // Field access - - //- Return density [kg/m^3] - virtual tmp rho() const; - - //- Return dynamic viscosity [Pa.s] - virtual tmp mu() const; - - //- Return surface tension [kg/s^2] - virtual tmp sigma() const; - - //- Return specific heat capacity [J/kg/K] - virtual tmp Cp() const; - - //- Return thermal conductivity [W/m/K] - virtual tmp kappa() const; - - - // Member Operators - - //- Disallow default bitwise assignment - void operator=(const liquidFilmThermo&) = delete; -}; - - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -} // End namespace surfaceFilmModels -} // End namespace regionModels -} // End namespace Foam - -// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // - -#endif - -// ************************************************************************* // diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/ArrheniusViscosity/ArrheniusViscosity.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/Arrhenius/ArrheniusViscosity.C similarity index 97% rename from src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/ArrheniusViscosity/ArrheniusViscosity.C rename to src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/Arrhenius/ArrheniusViscosity.C index eea2c2be41..f5dbc15974 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/ArrheniusViscosity/ArrheniusViscosity.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/Arrhenius/ArrheniusViscosity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/ArrheniusViscosity/ArrheniusViscosity.H b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/Arrhenius/ArrheniusViscosity.H similarity index 98% rename from src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/ArrheniusViscosity/ArrheniusViscosity.H rename to src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/Arrhenius/ArrheniusViscosity.H index bb9a271702..90b07d39b0 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/ArrheniusViscosity/ArrheniusViscosity.H +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/Arrhenius/ArrheniusViscosity.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2015-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2015-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/liquidViscosity/liquidViscosity.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/Newtonian/NewtonianViscosity.C similarity index 89% rename from src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/liquidViscosity/liquidViscosity.C rename to src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/Newtonian/NewtonianViscosity.C index 7551fdf330..9fe5a59aaf 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/liquidViscosity/liquidViscosity.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/Newtonian/NewtonianViscosity.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 @@ -23,7 +23,7 @@ License \*---------------------------------------------------------------------------*/ -#include "liquidViscosity.H" +#include "NewtonianViscosity.H" #include "thermoSingleLayer.H" #include "addToRunTimeSelectionTable.H" @@ -38,18 +38,18 @@ namespace surfaceFilmModels // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // -defineTypeNameAndDebug(liquidViscosity, 0); +defineTypeNameAndDebug(NewtonianViscosity, 0); addToRunTimeSelectionTable ( viscosityModel, - liquidViscosity, + NewtonianViscosity, dictionary ); // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // -liquidViscosity::liquidViscosity +NewtonianViscosity::NewtonianViscosity ( surfaceFilmRegionModel& film, const dictionary& dict, @@ -62,13 +62,13 @@ liquidViscosity::liquidViscosity // * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // -liquidViscosity::~liquidViscosity() +NewtonianViscosity::~NewtonianViscosity() {} // * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * // -void liquidViscosity::correct +void NewtonianViscosity::correct ( const volScalarField& p, const volScalarField& T diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/liquidViscosity/liquidViscosity.H b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/Newtonian/NewtonianViscosity.H similarity index 80% rename from src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/liquidViscosity/liquidViscosity.H rename to src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/Newtonian/NewtonianViscosity.H index d0c78d40f7..9209cbec58 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/liquidViscosity/liquidViscosity.H +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/Newtonian/NewtonianViscosity.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 @@ -22,18 +22,19 @@ License along with OpenFOAM. If not, see . Class - Foam::regionModels::surfaceFilmModels::liquidViscosity + Foam::regionModels::surfaceFilmModels::NewtonianViscosity Description - liquidViscosity viscosity model + Newtonian viscosity model + with the viscosity obtain directly from the thermophysical properties. SourceFiles - liquidViscosity.C + NewtonianViscosity.C \*---------------------------------------------------------------------------*/ -#ifndef liquidViscosity_H -#define liquidViscosity_H +#ifndef NewtonianViscosity_H +#define NewtonianViscosity_H #include "filmViscosityModel.H" @@ -47,23 +48,23 @@ namespace surfaceFilmModels { /*---------------------------------------------------------------------------*\ - Class liquidViscosity Declaration + Class NewtonianViscosity Declaration \*---------------------------------------------------------------------------*/ -class liquidViscosity +class NewtonianViscosity : public viscosityModel { public: //- Runtime type information - TypeName("liquid"); + TypeName("Newtonian"); // Constructors //- Construct from surface film model - liquidViscosity + NewtonianViscosity ( surfaceFilmRegionModel& film, const dictionary& dict, @@ -71,11 +72,11 @@ public: ); //- Disallow default bitwise copy construction - liquidViscosity(const liquidViscosity&) = delete; + NewtonianViscosity(const NewtonianViscosity&) = delete; //- Destructor - virtual ~liquidViscosity(); + virtual ~NewtonianViscosity(); // Member Functions @@ -93,7 +94,7 @@ public: // Member Operators //- Disallow default bitwise assignment - void operator=(const liquidViscosity&) = delete; + void operator=(const NewtonianViscosity&) = delete; }; diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/constantViscosity/constantViscosity.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/constant/constantViscosity.C similarity index 97% rename from src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/constantViscosity/constantViscosity.C rename to src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/constant/constantViscosity.C index 5e630efa60..02174f955f 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/constantViscosity/constantViscosity.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/constant/constantViscosity.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 diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/constantViscosity/constantViscosity.H b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/constant/constantViscosity.H similarity index 97% rename from src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/constantViscosity/constantViscosity.H rename to src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/constant/constantViscosity.H index 24122ca33d..2beeb8f537 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/constantViscosity/constantViscosity.H +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/constant/constantViscosity.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 diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModel.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/filmViscosityModel/filmViscosityModel.C similarity index 97% rename from src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModel.C rename to src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/filmViscosityModel/filmViscosityModel.C index 12a1a5040f..1fe8e97973 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModel.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/filmViscosityModel/filmViscosityModel.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 diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModel.H b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/filmViscosityModel/filmViscosityModel.H similarity index 98% rename from src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModel.H rename to src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/filmViscosityModel/filmViscosityModel.H index 5dcfc6b769..1bf46cdccf 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModel.H +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/filmViscosityModel/filmViscosityModel.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 diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C similarity index 100% rename from src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C rename to src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/filmViscosityModel/filmViscosityModelNew.C diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/function1Viscosity/function1Viscosity.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/function1/function1Viscosity.C similarity index 97% rename from src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/function1Viscosity/function1Viscosity.C rename to src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/function1/function1Viscosity.C index 9fdc623433..9b438a0c53 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/function1Viscosity/function1Viscosity.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/function1/function1Viscosity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/function1Viscosity/function1Viscosity.H b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/function1/function1Viscosity.H similarity index 98% rename from src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/function1Viscosity/function1Viscosity.H rename to src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/function1/function1Viscosity.H index c8699af571..a7f464d627 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/function1Viscosity/function1Viscosity.H +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/function1/function1Viscosity.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/thixotropicViscosity/thixotropicViscosity.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/thixotropic/thixotropicViscosity.C similarity index 100% rename from src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/thixotropicViscosity/thixotropicViscosity.C rename to src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/thixotropic/thixotropicViscosity.C diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/thixotropicViscosity/thixotropicViscosity.H b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/thixotropic/thixotropicViscosity.H similarity index 98% rename from src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/thixotropicViscosity/thixotropicViscosity.H rename to src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/thixotropic/thixotropicViscosity.H index 33a9ae5d9b..5a6840b9af 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/thixotropicViscosity/thixotropicViscosity.H +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/thixotropic/thixotropicViscosity.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 diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/waxSolventViscosity/waxSolventViscosity.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/waxSolvent/waxSolventViscosity.C similarity index 98% rename from src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/waxSolventViscosity/waxSolventViscosity.C rename to src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/waxSolvent/waxSolventViscosity.C index 9701cdf111..cf9d799e73 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/waxSolventViscosity/waxSolventViscosity.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/waxSolvent/waxSolventViscosity.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/waxSolventViscosity/waxSolventViscosity.H b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/waxSolvent/waxSolventViscosity.H similarity index 98% rename from src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/waxSolventViscosity/waxSolventViscosity.H rename to src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/waxSolvent/waxSolventViscosity.H index b04e2c697e..d270a90a81 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/filmViscosityModel/waxSolventViscosity/waxSolventViscosity.H +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/filmViscosityModel/waxSolvent/waxSolventViscosity.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForces/contactAngleForce/contactAngleForce.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForces/contactAngleForce/contactAngleForce.C index db50440466..95a9ff5c87 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForces/contactAngleForce/contactAngleForce.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForces/contactAngleForce/contactAngleForce.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -146,7 +146,9 @@ tmp contactAngleForce::correct(volVectorField& U) const scalarField& V = filmModel_.regionMesh().V(); const volScalarField& coverage = filmModel_.coverage(); - const volScalarField& sigma = filmModel_.sigma(); + + const tmp tsigma = filmModel_.sigma(); + const volScalarField& sigma = tsigma(); const tmp ttheta = theta(); const volScalarField& theta = ttheta(); diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForces/perturbedTemperatureDependent/perturbedTemperatureDependentContactAngleForce.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForces/perturbedTemperatureDependent/perturbedTemperatureDependentContactAngleForce.C index 6f9541d528..15bd277243 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForces/perturbedTemperatureDependent/perturbedTemperatureDependentContactAngleForce.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForces/perturbedTemperatureDependent/perturbedTemperatureDependentContactAngleForce.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -97,7 +97,7 @@ perturbedTemperatureDependentContactAngleForce::theta() const const thermoSingleLayer& film = filmType(); - const volScalarField& T = film.T(); + const volScalarField& T = film.thermo().T(); // Initialize with the function of temperature thetai.field() = thetaPtr_->value(T()); diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForces/temperatureDependent/temperatureDependentContactAngleForce.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForces/temperatureDependent/temperatureDependentContactAngleForce.C index 31cecf212d..0205f1f194 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForces/temperatureDependent/temperatureDependentContactAngleForce.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/force/contactAngleForces/temperatureDependent/temperatureDependentContactAngleForce.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -84,7 +84,7 @@ tmp temperatureDependentContactAngleForce::theta() const const thermoSingleLayer& film = filmType(); - const volScalarField& T = film.T(); + const volScalarField& T = film.thermo().T(); theta.ref().field() = thetaPtr_->value(T()); diff --git a/src/regionModels/surfaceFilmModels/submodels/kinematic/force/thermocapillaryForce/thermocapillaryForce.C b/src/regionModels/surfaceFilmModels/submodels/kinematic/force/thermocapillaryForce/thermocapillaryForce.C index 56b92bbfd2..1b69ccff50 100644 --- a/src/regionModels/surfaceFilmModels/submodels/kinematic/force/thermocapillaryForce/thermocapillaryForce.C +++ b/src/regionModels/surfaceFilmModels/submodels/kinematic/force/thermocapillaryForce/thermocapillaryForce.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -63,12 +63,10 @@ thermocapillaryForce::~thermocapillaryForce() tmp thermocapillaryForce::correct(volVectorField& U) { - const volScalarField& sigma = filmModel_.sigma(); - tmp tfvm(new fvVectorMatrix(U, dimForce)); - tfvm.ref() += fvc::grad(sigma)/filmModel_.VbyA(); + tfvm.ref() += fvc::grad(filmModel_.sigma())/filmModel_.VbyA(); return tfvm; } diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/solidification/solidification.C b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/solidification/solidification.C index 6da748ccc9..2829978c5c 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/solidification/solidification.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/solidification/solidification.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2013-2019 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2013-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -118,8 +118,8 @@ void solidification::correctModel { const thermoSingleLayer& film = filmType(); - const scalarField& T = film.T(); - const scalarField& h = film.h(); + const scalarField& T = film.thermo().T(); + const scalarField& he = film.thermo().he(); const scalarField& coverage = film.coverage(); const scalar rateLimiter = min @@ -144,7 +144,7 @@ void solidification::correctModel // Heat is assumed to be removed by heat-transfer to the wall // so the energy remains unchanged by the phase-change. - dEnergy[celli] += dm*h[celli]; + dEnergy[celli] += dm*he[celli]; } } } diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/speciePhaseChange/speciePhaseChange.C b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/speciePhaseChange/speciePhaseChange.C index 429d965cc5..9e838499a0 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/speciePhaseChange/speciePhaseChange.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/speciePhaseChange/speciePhaseChange.C @@ -27,6 +27,7 @@ License #include "thermoSingleLayer.H" #include "fluidThermo.H" #include "basicSpecieMixture.H" +#include "liquidThermo.H" #include "addToRunTimeSelectionTable.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -67,12 +68,16 @@ speciePhaseChange::~speciePhaseChange() Foam::label speciePhaseChange::vapId() const { const thermoSingleLayer& film = filmType(); - const thermoModel& thermo = film.thermo(); + + // Set local liquidThermo properties + const liquidProperties& liquidThermo = + refCast(film.thermo()) + .cellThermoMixture(0).properties(); const basicSpecieMixture& primarySpecieThermo = refCast(film.primaryThermo()); - return primarySpecieThermo.species()[thermo.name()]; + return primarySpecieThermo.species()[liquidThermo.name()]; } diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C index 927b4e9482..c5fd323bba 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/standardPhaseChange/standardPhaseChange.C @@ -26,6 +26,7 @@ License #include "standardPhaseChange.H" #include "addToRunTimeSelectionTable.H" #include "thermoSingleLayer.H" +#include "liquidThermo.H" #include "zeroField.H" // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // @@ -103,14 +104,16 @@ void standardPhaseChange::correctModel { const thermoSingleLayer& film = filmType(); - // Set local thermo properties - const thermoModel& thermo = film.thermo(); + // Set local liquidThermo properties + const liquidProperties& liquidThermo = + refCast(film.thermo()) + .cellThermoMixture(0).properties(); // Retrieve fields from film model const scalarField& delta = film.delta(); const scalarField& pInf = film.pPrimary(); - const scalarField& T = film.T(); - const scalarField& h = film.h(); + const scalarField& T = film.thermo().T(); + const scalarField& he = film.thermo().he(); const scalarField& rho = film.rho(); const scalarField& rhoInf = film.rhoPrimary(); const scalarField& muInf = film.muPrimary(); @@ -125,7 +128,7 @@ void standardPhaseChange::correctModel const scalar Wvap = this->Wvap(); // Molecular weight of liquid [kg/kmol] - const scalar Wliq = thermo.W(); + const scalar Wliq = liquidThermo.W(); forAll(dMass, celli) { @@ -137,22 +140,22 @@ void standardPhaseChange::correctModel const scalar pc = pInf[celli]; // Calculate the boiling temperature - const scalar Tb = thermo.Tb(pc); + const scalar Tb = liquidThermo.pvInvert(pc); // Local temperature - impose lower limit of 200 K for stability const scalar Tloc = min(TbFactor_*Tb, max(200.0, T[celli])); // Saturation pressure [Pa] - const scalar pSat = thermo.pv(pc, Tloc); + const scalar pSat = liquidThermo.pv(pc, Tloc); // Latent heat [J/kg] - const scalar hVap = thermo.hl(pc, Tloc); + const scalar hVap = liquidThermo.hl(pc, Tloc); // Calculate mass transfer if (pSat >= 0.95*pc) { // Boiling - const scalar Cp = thermo.Cp(pc, Tloc); + const scalar Cp = liquidThermo.Cp(pc, Tloc); const scalar Tcorr = max(0.0, T[celli] - Tb); const scalar qCorr = limMass[celli]*Cp*(Tcorr); dm = qCorr/hVap; @@ -172,7 +175,7 @@ void standardPhaseChange::correctModel const scalar Ys = Wliq*pSat/(Wliq*pSat + Wvap*(pc - pSat)); // Vapour diffusivity [m^2/s] - const scalar Dab = thermo.D(pc, Tloc); + const scalar Dab = liquidThermo.D(pc, Tloc); // Schmidt number const scalar Sc = muInfc/(rhoInfc*(Dab + rootVSmall)); @@ -187,11 +190,13 @@ void standardPhaseChange::correctModel dm = dt*magSf[celli]*rhoInfc*hm*(Ys - YInf[celli])/(1.0 - Ys); } - dMass[celli] += min(limMass[celli], max(dm, 0)); + dm = min(limMass[celli], max(dm, 0)); + + dMass[celli] += dm; // Heat is assumed to be removed by heat-transfer to the wall // so the energy remains unchanged by the phase-change. - dEnergy[celli] += dm*h[celli]; + dEnergy[celli] += dm*he[celli]; // dEnergy[celli] += dm*(h[celli] + hVap); } } diff --git a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/waxSolventEvaporation/waxSolventEvaporation.C b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/waxSolventEvaporation/waxSolventEvaporation.C index c3b19a669a..b4b31a35de 100644 --- a/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/waxSolventEvaporation/waxSolventEvaporation.C +++ b/src/regionModels/surfaceFilmModels/submodels/thermo/phaseChangeModel/waxSolventEvaporation/waxSolventEvaporation.C @@ -26,6 +26,7 @@ License #include "waxSolventEvaporation.H" #include "addToRunTimeSelectionTable.H" #include "thermoSingleLayer.H" +#include "liquidThermo.H" #include "zeroField.H" #include "fvmDdt.H" @@ -160,13 +161,15 @@ void waxSolventEvaporation::correctModel const volScalarField& rho = film.rho(); const surfaceScalarField& phi = film.phi(); - // Set local thermo properties - const thermoModel& thermo = film.thermo(); + // Set local liquidThermo properties + const liquidProperties& liquidThermo = + refCast(film.thermo()) + .cellThermoMixture(0).properties(); // Retrieve fields from film model const scalarField& pInf = film.pPrimary(); - const scalarField& T = film.T(); - const scalarField& h = film.h(); + const scalarField& T = film.thermo().T(); + const scalarField& he = film.thermo().he(); const scalarField& rhoInf = film.rhoPrimary(); const scalarField& muInf = film.muPrimary(); const scalarField& V = film.regionMesh().V(); @@ -237,14 +240,14 @@ void waxSolventEvaporation::correctModel const scalar pc = pInf[celli]; // Calculate the boiling temperature - const scalar Tb = thermo.Tb(pc); + const scalar Tb = liquidThermo.pvInvert(pc); // Local temperature - impose lower limit of 200 K for stability const scalar Tloc = min(TbFactor_*Tb, max(200.0, T[celli])); const scalar pPartialCoeff ( - thermo.pv(pc, Tloc)*activityCoeff_->value(Xsolvent) + liquidThermo.pv(pc, Tloc)*activityCoeff_->value(Xsolvent) ); scalar XsCoeff = pPartialCoeff/pc; @@ -275,7 +278,7 @@ void waxSolventEvaporation::correctModel const scalar Re = rhoInfc*mag(dU[celli])*L_/muInfc; // Vapour diffusivity [m^2/s] - const scalar Dab = thermo.D(pc, Tloc); + const scalar Dab = liquidThermo.D(pc, Tloc); // Schmidt number const scalar Sc = muInfc/(rhoInfc*(Dab + rootVSmall)); @@ -306,7 +309,7 @@ void waxSolventEvaporation::correctModel evapRateInf[celli] = evapRateCoeff[celli]*YInf[celli]; evapRateCoeff[celli] *= YsCoeff; - // hVap[celli] = thermo.hl(pc, Tloc); + // hVap[celli] = liquidThermo.hl(pc, Tloc); } } @@ -367,9 +370,7 @@ void waxSolventEvaporation::correctModel // Heat is assumed to be removed by heat-transfer to the wall // so the energy remains unchanged by the phase-change. - dEnergy += dm*h; - - // Latent heat [J/kg] + dEnergy += dm*he; // dEnergy += dm*(h[celli] + hVap); } } diff --git a/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel.C b/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel.C index 6dccd216ef..783ce59220 100644 --- a/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel.C +++ b/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2017-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2017-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -37,13 +37,6 @@ namespace regionModels defineTypeNameAndDebug(surfaceFilmModel, 0); defineRunTimeSelectionTable(surfaceFilmModel, mesh); -const dimensionedScalar surfaceFilmModel::Tref -( - "Tref", - dimTemperature, - 298.15 -); - // * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // diff --git a/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel.H b/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel.H index 110277d125..7b6bb1e048 100644 --- a/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel.H +++ b/src/regionModels/surfaceFilmModels/surfaceFilmModel/surfaceFilmModel.H @@ -58,9 +58,6 @@ public: //- Runtime type information TypeName("surfaceFilmModel"); - //- Reference temperature for enthalpy - static const dimensionedScalar Tref; - // Declare runtime constructor selection table diff --git a/src/regionModels/surfaceFilmModels/surfaceFilmRegionModel/surfaceFilmRegionModel.H b/src/regionModels/surfaceFilmModels/surfaceFilmRegionModel/surfaceFilmRegionModel.H index 807f8e2bf0..989447acbd 100644 --- a/src/regionModels/surfaceFilmModels/surfaceFilmRegionModel/surfaceFilmRegionModel.H +++ b/src/regionModels/surfaceFilmModels/surfaceFilmRegionModel/surfaceFilmRegionModel.H @@ -56,14 +56,15 @@ class surfaceFilmRegionModel public surfaceFilmModel, public singleLayerRegion { -protected: - - // Protected data + // Private data //- Acceleration due to gravity [m/s^2] const dimensionedVector& g_; +protected: + + // Protected member functions //- Read control parameters from dictionary @@ -135,19 +136,19 @@ public: virtual const volScalarField& rho() const = 0; //- Return the film surface tension [N/m] - virtual const volScalarField& sigma() const = 0; + virtual tmp sigma() const = 0; - // Transfer fields - to the primary region + // Transfer fields - to the primary region - //- Return mass transfer source - Eulerian phase only - virtual tmp primaryMassTrans() const = 0; + //- Return mass transfer source - Eulerian phase only + virtual tmp primaryMassTrans() const = 0; - //- Return the film mass available for transfer - virtual const volScalarField& cloudMassTrans() const = 0; + //- Return the film mass available for transfer + virtual const volScalarField& cloudMassTrans() const = 0; - //- Return the parcel diameters originating from film - virtual const volScalarField& cloudDiameterTrans() const = 0; + //- Return the parcel diameters originating from film + virtual const volScalarField& cloudDiameterTrans() const = 0; // Evolution diff --git a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C index 2759555366..e4b655dc01 100644 --- a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C +++ b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.C @@ -26,6 +26,7 @@ License #include "thermoSingleLayer.H" #include "fluidThermo.H" #include "basicSpecieMixture.H" +#include "liquidThermo.H" #include "fvcDdt.H" #include "fvcDiv.H" @@ -41,9 +42,6 @@ License #include "mapDistribute.H" #include "constants.H" -// Sub-models -#include "filmThermoModel.H" -#include "filmViscosityModel.H" #include "heatTransferModel.H" #include "phaseChangeModel.H" #include "filmRadiationModel.H" @@ -64,27 +62,6 @@ namespace surfaceFilmModels defineTypeNameAndDebug(thermoSingleLayer, 0); addToRunTimeSelectionTable(surfaceFilmRegionModel, thermoSingleLayer, mesh); -// * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * * // - -wordList thermoSingleLayer::hBoundaryTypes() -{ - wordList bTypes(T_.boundaryField().types()); - forAll(bTypes, patchi) - { - if - ( - T_.boundaryField()[patchi].fixesValue() - || isA(T_.boundaryField()[patchi]) - || isA>(T_.boundaryField()[patchi]) - ) - { - bTypes[patchi] = fixedValueFvPatchField::typeName; - } - } - - return bTypes; -} - // * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * // @@ -105,27 +82,20 @@ void thermoSingleLayer::resetPrimaryRegionSourceTerms() } -void thermoSingleLayer::correctThermoFields() -{ - rho_ == thermo_->rho(); - sigma_ == thermo_->sigma(); - Cp_ == thermo_->Cp(); - kappa_ == thermo_->kappa(); -} - - void thermoSingleLayer::correctHforMappedT() { - T_.correctBoundaryConditions(); + volScalarField& T = thermo_->T(); - volScalarField::Boundary& hBf = h_.boundaryFieldRef(); + T.correctBoundaryConditions(); - forAll(hBf, patchi) + volScalarField::Boundary& heBf = thermo_->he().boundaryFieldRef(); + + forAll(heBf, patchi) { - const fvPatchField& Tp = T_.boundaryField()[patchi]; + const fvPatchField& Tp = T.boundaryField()[patchi]; if (isA>(Tp)) { - hBf[patchi] == h(Tp, patchi); + heBf[patchi] == thermo().he(Tp, patchi); } } } @@ -242,10 +212,12 @@ void thermoSingleLayer::updateSubmodels() 1/(time().deltaT()*regionMesh().V()) ); + volScalarField& he = thermo_->he(); + // Update source fields rhoSp_ += rVDt*(cloudMassTrans_() + primaryMassTrans_()); USp_ += rVDt*(cloudMassTrans_()*U_() + primaryMomentumTrans_()); - hSp_ += rVDt*(cloudMassTrans_()*h_() + primaryEnergyTrans_()); + hSp_ += rVDt*(cloudMassTrans_()*he() + primaryEnergyTrans_()); momentumTransport_->correct(); } @@ -255,15 +227,20 @@ tmp thermoSingleLayer::q(volScalarField& h) const { const volScalarField::Internal coverage(pos(delta_() - deltaSmall_)); + const volScalarField::Internal& T = thermo().T(); + + const tmp tCpv = thermo().Cpv(); + const volScalarField::Internal& Cpv = tCpv(); + return ( // Heat-transfer to the primary region - - fvm::Sp((htcs_->h()/VbyA())/Cp_, h) - + (htcs_->h()/VbyA())*(h()/Cp_ + coverage*(TPrimary_() - T_())) + - fvm::Sp((htcs_->h()/VbyA())/Cpv, h) + + (htcs_->h()/VbyA())*(h()/Cpv + coverage*(TPrimary_() - T)) // Heat-transfer to the wall - - fvm::Sp((htcw_->h()/VbyA())/Cp_, h) - + (htcw_->h()/VbyA())*(h()/Cp_ + coverage*(Tw() - T_())) + - fvm::Sp((htcw_->h()/VbyA())/Cpv, h) + + (htcw_->h()/VbyA())*(h()/Cpv + coverage*(Tw() - T)) ); } @@ -274,27 +251,23 @@ void thermoSingleLayer::solveEnergy() correctHforMappedT(); - fvScalarMatrix hEqn + volScalarField& he = thermo_->he(); + + fvScalarMatrix heEqn ( - fvm::ddt(alpha_, rho_, h_) + fvm::div(phi_, h_) - - fvm::Sp(continuityErr_, h_) + fvm::ddt(alpha_, rho(), he) + fvm::div(phi_, he) + - fvm::Sp(continuityErr_, he) == - hSp_ - + q(h_) + + q(he) + radiation_->Shs()/VbyA() ); - hEqn.relax(); + heEqn.relax(); - hEqn.solve(); + heEqn.solve(); - // Update temperature using latest h_ - T_ == T(h_); - - correctThermoFields(); - - // Evaluate viscosity from user-model - viscosity_->correct(pPrimary_, T_); + thermo_->correct(); } @@ -320,64 +293,6 @@ thermoSingleLayer::thermoSingleLayer ) ), - Cp_ - ( - IOobject - ( - "Cp", - time().timeName(), - regionMesh(), - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - regionMesh(), - dimensionedScalar(dimEnergy/dimMass/dimTemperature, 0), - zeroGradientFvPatchScalarField::typeName - ), - - kappa_ - ( - IOobject - ( - "kappa", - time().timeName(), - regionMesh(), - IOobject::NO_READ, - IOobject::AUTO_WRITE - ), - regionMesh(), - dimensionedScalar(dimEnergy/dimTime/dimLength/dimTemperature, 0), - zeroGradientFvPatchScalarField::typeName - ), - - T_ - ( - IOobject - ( - "T", - time().timeName(), - regionMesh(), - IOobject::MUST_READ, - IOobject::AUTO_WRITE - ), - regionMesh() - ), - - h_ - ( - IOobject - ( - "h", - time().timeName(), - regionMesh(), - IOobject::NO_READ, - IOobject::NO_WRITE - ), - regionMesh(), - dimensionedScalar(dimEnergy/dimMass, 0), - hBoundaryTypes() - ), - primaryEnergyTrans_ ( IOobject @@ -443,8 +358,6 @@ thermoSingleLayer::thermoSingleLayer YPrimary_(), - viscosity_(viscosityModel::New(*this, coeffs(), mu_)), - htcs_ ( heatTransferModel::New(*this, coeffs().subDict("upperSurfaceModels")) @@ -512,11 +425,6 @@ thermoSingleLayer::thermoSingleLayer correctCoverage(); - correctThermoFields(); - - // Update derived fields - h_ == h(T_); - surfaceScalarField phi ( IOobject @@ -528,13 +436,10 @@ thermoSingleLayer::thermoSingleLayer IOobject::AUTO_WRITE, false ), - fvc::flux(alpha_*rho_*U_) + fvc::flux(alpha_*rho()*U_) ); phi_ == phi; - - // Evaluate viscosity from user-model - viscosity_->correct(pPrimary_, T_); } } @@ -626,27 +531,9 @@ void thermoSingleLayer::evolveRegion() } -const volScalarField& thermoSingleLayer::Cp() const -{ - return Cp_; -} - - -const volScalarField& thermoSingleLayer::kappa() const -{ - return kappa_; -} - - -const volScalarField& thermoSingleLayer::T() const -{ - return T_; -} - - tmp thermoSingleLayer::Ts() const { - return T_; + return thermo().T(); } @@ -664,30 +551,26 @@ tmp thermoSingleLayer::Tw() const volScalarField::Internal& Tw = tTw.ref(); + const volScalarField& T = thermo().T(); + // Push boundary film temperature into wall temperature internal field for (label i=0; i(Tw, pp.faceCells()) = - T_.boundaryField()[patchi]; + T.boundaryField()[patchi]; } return tTw; } -const volScalarField& thermoSingleLayer::h() const -{ - return h_; -} - - void thermoSingleLayer::info() { kinematicSingleLayer::info(); - const scalarField& Tinternal = T_; + const scalarField& Tinternal = thermo().T(); Info<< indent << "min/mean/max(T) = " << gMin(Tinternal) << ", " @@ -706,7 +589,12 @@ tmp thermoSingleLayer::Srho const basicSpecieMixture& primarySpecieThermo = refCast(primaryThermo_); - const label vapId = primarySpecieThermo.species()[thermo_->name()]; + // Set local liquidThermo properties + const liquidProperties& liquidThermo = + refCast(thermo()) + .cellThermoMixture(0).properties(); + + const label vapId = primarySpecieThermo.species()[liquidThermo.name()]; tmp tSrho ( diff --git a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.H b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.H index 21076d0081..a737f3df30 100644 --- a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.H +++ b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayer.H @@ -70,11 +70,6 @@ class thermoSingleLayer : public kinematicSingleLayer { - // Private Member Functions - - //- Return boundary types for sensible enthalpy field - wordList hBoundaryTypes(); - protected: @@ -87,22 +82,6 @@ protected: //- Reference to the primary region thermo const fluidThermo& primaryThermo_; - - // Fields - - //- Specific heat capacity [J/kg/K] - volScalarField Cp_; - - //- Thermal conductivity [W/m/K] - volScalarField kappa_; - - //- Temperature - mean [K] - volScalarField T_; - - //- Sensible enthalpy [J/kg] - volScalarField h_; - - // Transfer fields - to the primary region //- Film energy transfer @@ -156,9 +135,6 @@ protected: // Sub-models - //- Viscosity model - autoPtr viscosity_; - //- Heat transfer coefficient between film surface and primary // region [W/m^2/K] autoPtr htcs_; @@ -187,9 +163,6 @@ protected: //- Read control parameters from dictionary virtual bool read(); - //- Correct the thermo fields - virtual void correctThermoFields(); - //- Correct sensible enthalpy for mapped temperature fields virtual void correctHforMappedT(); @@ -252,21 +225,6 @@ public: inline const fluidThermo& primaryThermo() const; - // Fields - - //- Return the film specific heat capacity [J/kg/K] - virtual const volScalarField& Cp() const; - - //- Return the film thermal conductivity [W/m/K] - virtual const volScalarField& kappa() const; - - //- Return the film mean temperature [K] - virtual const volScalarField& T() const; - - //- Return the film sensible enthalpy [J/kg] - virtual const volScalarField& h() const; - - // Derived Fields //- Return the film surface temperature [K] @@ -278,29 +236,6 @@ public: virtual tmp Tw() const; - // Thermo functions - - //- Return sensible enthalpy as a function of temperature - // for a patch - inline tmp h - ( - const scalarField& T, - const label patchi - ) const; - - //- Return sensible enthalpy as a function of temperature - inline tmp h - ( - const volScalarField& T - ) const; - - //- Return temperature as a function of sensible enthalpy - inline tmp T - ( - const volScalarField& h - ) const; - - // Source fields (read/write access) //- External hook to add sources to the film diff --git a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayerI.H b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayerI.H index e5c6cd4b91..b09edf5558 100644 --- a/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayerI.H +++ b/src/regionModels/surfaceFilmModels/thermoSingleLayer/thermoSingleLayerI.H @@ -45,47 +45,6 @@ inline const fluidThermo& thermoSingleLayer::primaryThermo() const } -inline tmp thermoSingleLayer::h -( - const scalarField& T, - const label patchi -) const -{ - const scalarField& Cp = Cp_.boundaryField()[patchi]; - return Cp*(T - Tref.value()); -} - - -inline tmp thermoSingleLayer::h -( - const volScalarField& T -) const -{ - return volScalarField::New - ( - "h(" + T.name() + ")", - Cp_*(T - Tref) - ); -} - - -inline tmp thermoSingleLayer::T -( - const volScalarField& h -) const -{ - tmp tT - ( - volScalarField::New("T(" + h.name() + ")", h/Cp_ + Tref) - ); - - tT.ref().min(Tmax_); - tT.ref().max(Tmin_); - - return tT; -} - - inline const volScalarField::Internal& thermoSingleLayer::hSp() const { return hSp_; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/Ar/Ar.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/Ar/Ar.C index b2d25450f3..ca09a341a2 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/Ar/Ar.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/Ar/Ar.C @@ -26,6 +26,9 @@ License #include "Ar.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -92,7 +95,8 @@ Foam::Ar::Ar() kappa_("kappa", 0.1819, -0.0003176, -4.11e-06, 0.0, 0.0, 0.0), kappag_("kappag", 0.0001236, 0.8262, -132.8, 16000), sigma_("sigma", 150.86, 0.03823, 1.2927, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 39.948, 28) // note: Same as nHeptane + D_("D", 147.18, 20.1, 39.948, 28), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -127,7 +131,8 @@ Foam::Ar::Ar kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/Ar/Ar.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/Ar/Ar.H index 10cbfe67e6..bd0ba33498 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/Ar/Ar.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/Ar/Ar.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 @@ -76,6 +76,9 @@ class Ar Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/Ar/ArI.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/Ar/ArI.H index fcbe06adb8..810d23b524 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/Ar/ArI.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/Ar/ArI.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::Ar::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::Ar::h(scalar p, scalar T) const +inline Foam::scalar Foam::Ar::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::Ar::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::Ar::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C10H22/C10H22.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C10H22/C10H22.C index e37833b6e3..c40dd325c6 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C10H22/C10H22.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C10H22/C10H22.C @@ -26,6 +26,9 @@ License #include "C10H22.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::C10H22::C10H22() kappa_("kappa", 0.2063, -0.000254, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", -668.4, 0.9323, -4071000000.0, 0.0), sigma_("sigma", 617.70, 0.055435, 1.3095, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 142.285, 28.0) // note: Same as nHeptane + D_("D", 147.18, 20.1, 142.285, 28.0), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::C10H22::C10H22 kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C10H22/C10H22.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C10H22/C10H22.H index ee3538ba4e..e9b4724ea1 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C10H22/C10H22.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C10H22/C10H22.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 @@ -76,6 +76,9 @@ class C10H22 Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C10H22/C10H22I.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C10H22/C10H22I.H index e3f600f7bc..bac7fa7cce 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C10H22/C10H22I.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C10H22/C10H22I.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::C10H22::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::C10H22::h(scalar p, scalar T) const +inline Foam::scalar Foam::C10H22::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::C10H22::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::C10H22::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C12H26/C12H26.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C12H26/C12H26.C index a6b71ee5d9..fdd2443d48 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C12H26/C12H26.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C12H26/C12H26.C @@ -26,6 +26,9 @@ License #include "C12H26.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::C12H26::C12H26() kappa_("kappa", 0.2047, -0.0002326, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", 5.719e-06, 1.4699, 579.4, 0.0), sigma_("sigma", 658.0, 0.055493, 1.3262, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 170.338, 28.0) // note: Same as nHeptane + D_("D", 147.18, 20.1, 170.338, 28.0), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::C12H26::C12H26 kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C12H26/C12H26.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C12H26/C12H26.H index 4811f119ac..45a3fa81ec 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C12H26/C12H26.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C12H26/C12H26.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 @@ -76,6 +76,9 @@ class C12H26 Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C12H26/C12H26I.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C12H26/C12H26I.H index b73fc719e5..67e67f62d8 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C12H26/C12H26I.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C12H26/C12H26I.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::C12H26::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::C12H26::h(scalar p, scalar T) const +inline Foam::scalar Foam::C12H26::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::C12H26::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::C12H26::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C13H28/C13H28.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C13H28/C13H28.C index 8420b3d012..8ed6c54d5f 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C13H28/C13H28.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C13H28/C13H28.C @@ -26,6 +26,9 @@ License #include "C13H28.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::C13H28::C13H28() kappa_("kappa", 0.1981, -0.0002046, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", 5.3701e-06, 1.4751, 599.09, 0.0), sigma_("sigma", 675.80, 0.05561, 1.3361, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 184.365, 28.0) // note: Same as nHeptane + D_("D", 147.18, 20.1, 184.365, 28.0), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::C13H28::C13H28 kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C13H28/C13H28.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C13H28/C13H28.H index 62a5672c95..9090bc2b42 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C13H28/C13H28.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C13H28/C13H28.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 @@ -76,6 +76,9 @@ class C13H28 Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C13H28/C13H28I.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C13H28/C13H28I.H index dc3c610f90..2e264c9740 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C13H28/C13H28I.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C13H28/C13H28I.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::C13H28::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::C13H28::h(scalar p, scalar T) const +inline Foam::scalar Foam::C13H28::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::C13H28::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::C13H28::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C14H30/C14H30.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C14H30/C14H30.C index 22f846608e..6af9f35beb 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C14H30/C14H30.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C14H30/C14H30.C @@ -26,6 +26,9 @@ License #include "C14H30.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::C14H30::C14H30() kappa_("kappa", 0.1957, -0.0001993, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", -0.000628, 0.944, -5490, 0.0), sigma_("sigma", 692.40, 0.056436, 1.3658, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 198.392, 28.0) // note: Same as nHeptane + D_("D", 147.18, 20.1, 198.392, 28.0), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::C14H30::C14H30 kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C14H30/C14H30.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C14H30/C14H30.H index 8d964e66f4..c4f389ee0f 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C14H30/C14H30.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C14H30/C14H30.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 @@ -76,6 +76,9 @@ class C14H30 Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C14H30/C14H30I.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C14H30/C14H30I.H index da6f8106ff..8b4c1997f1 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C14H30/C14H30I.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C14H30/C14H30I.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::C14H30::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::C14H30::h(scalar p, scalar T) const +inline Foam::scalar Foam::C14H30::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::C14H30::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::C14H30::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C16H34/C16H34.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C16H34/C16H34.C index 57612551a2..c32aedc123 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C16H34/C16H34.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C16H34/C16H34.C @@ -26,6 +26,9 @@ License #include "C16H34.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::C16H34::C16H34() kappa_("kappa", 0.1963, -0.00019, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", 3.075e-06, 1.552, 678.0, 0.0), sigma_("sigma", 720.60, 0.05699, 1.3929, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 226.446, 28.0) // note: Same as nHeptane + D_("D", 147.18, 20.1, 226.446, 28.0), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::C16H34::C16H34 kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C16H34/C16H34.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C16H34/C16H34.H index bea912f914..1d4a471381 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C16H34/C16H34.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C16H34/C16H34.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 @@ -76,6 +76,9 @@ class C16H34 Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C16H34/C16H34I.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C16H34/C16H34I.H index 9f0e8a23cb..6db00905bb 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C16H34/C16H34I.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C16H34/C16H34I.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::C16H34::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::C16H34::h(scalar p, scalar T) const +inline Foam::scalar Foam::C16H34::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::C16H34::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::C16H34::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H5OH/C2H5OH.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H5OH/C2H5OH.C index 0fd3731e5e..a2a08106f7 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H5OH/C2H5OH.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H5OH/C2H5OH.C @@ -26,6 +26,9 @@ License #include "C2H5OH.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::C2H5OH::C2H5OH() kappa_("kappa", 0.253, -0.000281, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", -3.12, 0.7152, -3550000.0, 0.0), sigma_("sigma", 3.7640e-02, -2.1570e-05, -1.025e-07, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 46.069, 28) // note: Same as nHeptane + D_("D", 147.18, 20.1, 46.069, 28), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::C2H5OH::C2H5OH kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H5OH/C2H5OH.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H5OH/C2H5OH.H index 3344b69eb4..4927538229 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H5OH/C2H5OH.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H5OH/C2H5OH.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 @@ -76,6 +76,9 @@ class C2H5OH Function1s::NSRDS0 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H5OH/C2H5OHI.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H5OH/C2H5OHI.H index 389dbffcfb..69e5411781 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H5OH/C2H5OHI.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H5OH/C2H5OHI.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::C2H5OH::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::C2H5OH::h(scalar p, scalar T) const +inline Foam::scalar Foam::C2H5OH::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::C2H5OH::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::C2H5OH::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6/C2H6.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6/C2H6.C index 1ee54fda61..7c19b60fc8 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6/C2H6.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6/C2H6.C @@ -26,6 +26,9 @@ License #include "C2H6.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -90,7 +93,8 @@ Foam::C2H6::C2H6() kappa_("kappa", 0.35758, -0.0011458, 6.1866e-07, 0.0, 0.0, 0.0), kappag_("kappag", 7.3869e-05, 1.1689, 500.73, 0.0), sigma_("sigma", 305.32, 0.048643, 1.1981, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 30.070, 28) // note: Same as nHeptane + D_("D", 147.18, 20.1, 30.070, 28), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -125,7 +129,8 @@ Foam::C2H6::C2H6 kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6/C2H6.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6/C2H6.H index 3e953aebe0..bfb21ece6f 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6/C2H6.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6/C2H6.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 @@ -76,6 +76,9 @@ class C2H6 Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6/C2H6I.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6/C2H6I.H index daf517d7ac..ae7be47da6 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6/C2H6I.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6/C2H6I.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::C2H6::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::C2H6::h(scalar p, scalar T) const +inline Foam::scalar Foam::C2H6::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::C2H6::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::C2H6::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6O/C2H6O.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6O/C2H6O.C index 3d7199609d..ef20fab52e 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6O/C2H6O.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6O/C2H6O.C @@ -26,6 +26,9 @@ License #include "C2H6O.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -92,7 +95,8 @@ Foam::C2H6O::C2H6O() kappa_("kappa", 0.31276, -0.0005677, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", 0.2247, 0.1026, 997.06, 1762900), sigma_("sigma", 400.10, 0.06096, 1.2286, 0, 0, 0), - D_("D", 147.18, 20.1, 46.069, 28) // note: Same as nHeptane + D_("D", 147.18, 20.1, 46.069, 28), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -127,7 +131,8 @@ Foam::C2H6O::C2H6O kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6O/C2H6O.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6O/C2H6O.H index d6754b6e36..61af643409 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6O/C2H6O.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6O/C2H6O.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 @@ -76,6 +76,9 @@ class C2H6O Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6O/C2H6OI.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6O/C2H6OI.H index 88b3d52895..5138eecca7 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6O/C2H6OI.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C2H6O/C2H6OI.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::C2H6O::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::C2H6O::h(scalar p, scalar T) const +inline Foam::scalar Foam::C2H6O::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::C2H6O::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::C2H6O::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H6O/C3H6O.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H6O/C3H6O.C index 0a39807ec6..6f018a511a 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H6O/C3H6O.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H6O/C3H6O.C @@ -26,6 +26,9 @@ License #include "C3H6O.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::C3H6O::C3H6O() kappa_("kappa", 0.2502, -0.000298, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", -26.8, 0.9098, -126500000, 0.0), sigma_("sigma", 508.20, 0.0622, 1.124, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 58.08, 28) // note: Same as nHeptane + D_("D", 147.18, 20.1, 58.08, 28), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::C3H6O::C3H6O kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H6O/C3H6O.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H6O/C3H6O.H index 3006766ef2..128517bfe2 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H6O/C3H6O.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H6O/C3H6O.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 @@ -76,6 +76,9 @@ class C3H6O Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H6O/C3H6OI.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H6O/C3H6OI.H index b925c7567e..29fcca436d 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H6O/C3H6OI.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H6O/C3H6OI.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::C3H6O::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::C3H6O::h(scalar p, scalar T) const +inline Foam::scalar Foam::C3H6O::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::C3H6O::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::C3H6O::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H8/C3H8.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H8/C3H8.C index de1d99cca2..e595d40d13 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H8/C3H8.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H8/C3H8.C @@ -26,6 +26,9 @@ License #include "C3H8.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -89,7 +92,8 @@ Foam::C3H8::C3H8() kappa_("kappa", 0.26755, -0.00066457, 2.774e-07, 0.0, 0.0, 0.0), kappag_("kappag", -1.12, 0.10972, -9834.6, -7535800), sigma_("sigma", 369.83, 0.05092, 1.2197, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 44.096, 28) // note: Same as nHeptane + D_("D", 147.18, 20.1, 44.096, 28), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -124,7 +128,8 @@ Foam::C3H8::C3H8 kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H8/C3H8.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H8/C3H8.H index c8ebb2653e..859ec2c213 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H8/C3H8.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H8/C3H8.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 @@ -76,6 +76,9 @@ class C3H8 Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H8/C3H8I.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H8/C3H8I.H index 047b9f323d..74e6b836dd 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H8/C3H8I.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C3H8/C3H8I.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::C3H8::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::C3H8::h(scalar p, scalar T) const +inline Foam::scalar Foam::C3H8::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::C3H8::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::C3H8::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C4H10O/C4H10O.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C4H10O/C4H10O.C index 3545b4144a..8623c73c00 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C4H10O/C4H10O.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C4H10O/C4H10O.C @@ -26,6 +26,9 @@ License #include "C4H10O.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::C4H10O::C4H10O() kappa_("kappa", 0.249, -0.0004005, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", -0.0044894, 0.6155, -3266.3, 0.0), sigma_("sigma", 466.70, 0.057356, 1.288, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 74.123, 28) // note: Same as nHeptane + D_("D", 147.18, 20.1, 74.123, 28), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::C4H10O::C4H10O kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C4H10O/C4H10O.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C4H10O/C4H10O.H index af1dccd00f..2a76f03330 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C4H10O/C4H10O.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C4H10O/C4H10O.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 @@ -76,6 +76,9 @@ class C4H10O Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C4H10O/C4H10OI.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C4H10O/C4H10OI.H index df987f077b..631b1c4b26 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C4H10O/C4H10OI.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C4H10O/C4H10OI.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::C4H10O::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::C4H10O::h(scalar p, scalar T) const +inline Foam::scalar Foam::C4H10O::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::C4H10O::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::C4H10O::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H14/C6H14.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H14/C6H14.C index 8e94b8d8cb..3ec769c08f 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H14/C6H14.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H14/C6H14.C @@ -26,6 +26,9 @@ License #include "C6H14.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::C6H14::C6H14() kappa_("kappa", 0.22492, -0.0003533, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", -650.5, 0.8053, -1412100000, 0.0), sigma_("sigma", 507.60, 0.055003, 1.2674, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 86.177, 28) // note: Same as nHeptane + D_("D", 147.18, 20.1, 86.177, 28), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::C6H14::C6H14 kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H14/C6H14.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H14/C6H14.H index cd814bd312..a133a9e694 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H14/C6H14.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H14/C6H14.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 @@ -76,6 +76,9 @@ class C6H14 Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H14/C6H14I.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H14/C6H14I.H index 93db7fa0ec..246e7c8374 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H14/C6H14I.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H14/C6H14I.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 @@ -47,12 +47,23 @@ inline Foam::scalar Foam::C6H14::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::C6H14::h(scalar p, scalar T) const +inline Foam::scalar Foam::C6H14::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::C6H14::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::C6H14::Ha(scalar p, scalar T) const { return h_.value(T); } - inline Foam::scalar Foam::C6H14::Cpg(scalar p, scalar T) const { return Cpg_.value(T); diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H6/C6H6.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H6/C6H6.C index b20926e12e..2c326f0868 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H6/C6H6.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H6/C6H6.C @@ -26,6 +26,9 @@ License #include "C6H6.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::C6H6::C6H6() kappa_("kappa", 0.2407, -0.0003202, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", 1.652e-05, 1.3117, 491, 0.0), sigma_("sigma", 562.16, 0.07195, 1.2389, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 78.114, 28) // note: Same as nHeptane + D_("D", 147.18, 20.1, 78.114, 28), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::C6H6::C6H6 kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H6/C6H6.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H6/C6H6.H index c4f3f33250..84354b1891 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H6/C6H6.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H6/C6H6.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 @@ -76,6 +76,9 @@ class C6H6 Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H6/C6H6I.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H6/C6H6I.H index 5ab6a8fa4c..e491a92069 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H6/C6H6I.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C6H6/C6H6I.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::C6H6::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::C6H6::h(scalar p, scalar T) const +inline Foam::scalar Foam::C6H6::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::C6H6::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::C6H6::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H16/C7H16.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H16/C7H16.C index 0da1aa6334..8b1e4c2f56 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H16/C7H16.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H16/C7H16.C @@ -26,6 +26,9 @@ License #include "C7H16.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -99,7 +102,8 @@ Foam::C7H16::C7H16() kappa_("kappa", 0.215, -0.000303, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", -0.070028, 0.38068, -7049.9, -2400500.0), sigma_("sigma", 540.20, 0.054143, 1.2512, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 100.204, 28.0) + D_("D", 147.18, 20.1, 100.204, 28.0), + Hf_(h_.value(Tstd)) {} @@ -134,7 +138,8 @@ Foam::C7H16::C7H16 kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H16/C7H16.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H16/C7H16.H index f5ed186fd1..4f572fb7d9 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H16/C7H16.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H16/C7H16.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 @@ -76,6 +76,9 @@ class C7H16 Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H16/C7H16I.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H16/C7H16I.H index 45ee38289a..91b61466dd 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H16/C7H16I.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H16/C7H16I.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::C7H16::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::C7H16::h(scalar p, scalar T) const +inline Foam::scalar Foam::C7H16::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::C7H16::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::C7H16::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H8/C7H8.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H8/C7H8.C index 8ecc3ca69b..ac8f1ae055 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H8/C7H8.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H8/C7H8.C @@ -26,6 +26,9 @@ License #include "C7H8.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::C7H8::C7H8() kappa_("kappa", 0.2043, -0.000239, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", 2.392e-05, 1.2694, 537, 0.0), sigma_("sigma", 591.79, 0.06685, 1.2456, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 92.141, 28) // note: Same as nHeptane + D_("D", 147.18, 20.1, 92.141, 28), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::C7H8::C7H8 kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H8/C7H8.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H8/C7H8.H index 151023431a..0c616d12eb 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H8/C7H8.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H8/C7H8.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 @@ -76,6 +76,9 @@ class C7H8 Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H8/C7H8I.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H8/C7H8I.H index d9eb9d12b1..04d1da3f8f 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H8/C7H8I.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C7H8/C7H8I.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::C7H8::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::C7H8::h(scalar p, scalar T) const +inline Foam::scalar Foam::C7H8::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::C7H8::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::C7H8::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H10/C8H10.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H10/C8H10.C index d9bd4190fc..d196dcc28f 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H10/C8H10.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H10/C8H10.C @@ -26,6 +26,9 @@ License #include "C8H10.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::C8H10::C8H10() kappa_("kappa", 0.20149, -0.00023988, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", 1.708e-05, 1.319, 565.6, 0.0), sigma_("sigma", 617.17, 0.066, 1.268, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 106.167, 28.0) // note: Same as nHeptane + D_("D", 147.18, 20.1, 106.167, 28.0), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::C8H10::C8H10 kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H10/C8H10.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H10/C8H10.H index 7c2081e694..b16f907f84 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H10/C8H10.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H10/C8H10.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 @@ -75,6 +75,9 @@ class C8H10 Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -132,8 +135,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H10/C8H10I.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H10/C8H10I.H index da39167801..7dc8706417 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H10/C8H10I.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H10/C8H10I.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::C8H10::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::C8H10::h(scalar p, scalar T) const +inline Foam::scalar Foam::C8H10::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::C8H10::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::C8H10::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H18/C8H18.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H18/C8H18.C index 3794a64054..f2ad86e4bf 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H18/C8H18.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H18/C8H18.C @@ -26,6 +26,9 @@ License #include "C8H18.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::C8H18::C8H18() kappa_("kappa", 0.2156, -0.00029483, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", -8758, 0.8448, -27121000000.0, 0.0), sigma_("sigma", 568.70, 0.052789, 1.2323, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 114.231, 28.0) // note: Same as nHeptane + D_("D", 147.18, 20.1, 114.231, 28.0), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::C8H18::C8H18 kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H18/C8H18.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H18/C8H18.H index b61014ab34..f4f88e82a6 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H18/C8H18.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H18/C8H18.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 @@ -76,6 +76,9 @@ class C8H18 Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H18/C8H18I.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H18/C8H18I.H index ad3650cbcd..251d6f2950 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H18/C8H18I.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C8H18/C8H18I.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::C8H18::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::C8H18::h(scalar p, scalar T) const +inline Foam::scalar Foam::C8H18::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::C8H18::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::C8H18::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C9H20/C9H20.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C9H20/C9H20.C index 8935f6567a..b287dcc5f9 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C9H20/C9H20.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C9H20/C9H20.C @@ -26,6 +26,9 @@ License #include "C9H20.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::C9H20::C9H20() kappa_("kappa", 0.209, -0.000264, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", -0.065771, 0.27198, -3482.3, -1580300.0), sigma_("sigma", 594.60, 0.054975, 1.2897, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 128.258, 28.0) // note: Same as nHeptane + D_("D", 147.18, 20.1, 128.258, 28.0), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::C9H20::C9H20 kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C9H20/C9H20.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C9H20/C9H20.H index 76b083f64a..828f8ff74d 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C9H20/C9H20.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C9H20/C9H20.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 @@ -76,6 +76,9 @@ class C9H20 Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C9H20/C9H20I.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C9H20/C9H20I.H index e625eaa73f..770967d064 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C9H20/C9H20I.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/C9H20/C9H20I.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::C9H20::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::C9H20::h(scalar p, scalar T) const +inline Foam::scalar Foam::C9H20::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::C9H20::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::C9H20::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH3OH/CH3OH.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH3OH/CH3OH.C index 868b3ffc18..867a484ea7 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH3OH/CH3OH.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH3OH/CH3OH.C @@ -26,6 +26,9 @@ License #include "CH3OH.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::CH3OH::CH3OH() kappa_("kappa", 0.2837, -0.000281, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", -7.763, 1.0279, -74360000.0, 6770000000.0), sigma_("sigma", 512.58, 0.056, -0.00014583, 1.08e-07, 0.0, 0.0), - D_("D", 147.18, 20.1, 32.042, 28.0) // note: Same as nHeptane + D_("D", 147.18, 20.1, 32.042, 28.0), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::CH3OH::CH3OH kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH3OH/CH3OH.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH3OH/CH3OH.H index 341f8c5972..1a6f829ec1 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH3OH/CH3OH.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH3OH/CH3OH.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 @@ -76,6 +76,9 @@ class CH3OH Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH3OH/CH3OHI.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH3OH/CH3OHI.H index d17e78e8e5..ccf48fd86e 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH3OH/CH3OHI.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH3OH/CH3OHI.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::CH3OH::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::CH3OH::h(scalar p, scalar T) const +inline Foam::scalar Foam::CH3OH::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::CH3OH::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::CH3OH::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH4N2O/CH4N2O.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH4N2O/CH4N2O.C index f800fdabe1..24169952b0 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH4N2O/CH4N2O.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH4N2O/CH4N2O.C @@ -26,6 +26,9 @@ License #include "CH4N2O.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -90,7 +93,8 @@ Foam::CH4N2O::CH4N2O() kappa_("kappa", -0.4267, 0.0056903, -8.0065e-06, 1.815e-09, 0.0, 0.0), kappag_("kappag", 6.977e-05, 1.1243, 844.9, -148850.0), sigma_("sigma", 705.0, 1.0, 0.0, 0.0, 0.0, 0.0), // note: set to constant - D_("D", 147.18, 20.1, 60.056, 28.0) // note: Same as nHeptane + D_("D", 147.18, 20.1, 60.056, 28.0), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -125,7 +129,8 @@ Foam::CH4N2O::CH4N2O kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH4N2O/CH4N2O.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH4N2O/CH4N2O.H index ceb82fd7ad..932521588c 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH4N2O/CH4N2O.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH4N2O/CH4N2O.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 @@ -77,6 +77,10 @@ class CH4N2O Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + + public: friend class liquidProperties; @@ -133,8 +137,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH4N2O/CH4N2OI.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH4N2O/CH4N2OI.H index 8ec7062c43..8e746ff603 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH4N2O/CH4N2OI.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/CH4N2O/CH4N2OI.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::CH4N2O::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::CH4N2O::h(scalar p, scalar T) const +inline Foam::scalar Foam::CH4N2O::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::CH4N2O::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::CH4N2O::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/H2O/H2O.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/H2O/H2O.C index a80a13b87f..4ab482252e 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/H2O/H2O.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/H2O/H2O.C @@ -26,6 +26,9 @@ License #include "H2O.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::H2O::H2O() kappa_("kappa", -0.4267, 0.0056903, -8.0065e-06, 1.815e-09, 0, 0), kappag_("kappag", 6.977e-05, 1.1243, 844.9, -148850), sigma_("sigma", 647.13, 0.18548, 2.717, -3.554, 2.047, 0), - D_("D", 15.0, 15.0, 18.015, 28) + D_("D", 15.0, 15.0, 18.015, 28), + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::H2O::H2O kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/H2O/H2O.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/H2O/H2O.H index 435be64b26..debe740a22 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/H2O/H2O.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/H2O/H2O.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 @@ -75,6 +75,9 @@ class H2O Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -132,8 +135,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/H2O/H2OI.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/H2O/H2OI.H index 87c69f566c..7df3e5f308 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/H2O/H2OI.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/H2O/H2OI.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::H2O::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::H2O::h(scalar p, scalar T) const +inline Foam::scalar Foam::H2O::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::H2O::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::H2O::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IC8H18/IC8H18.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IC8H18/IC8H18.C index aea9177b96..0e2a782b70 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IC8H18/IC8H18.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IC8H18/IC8H18.C @@ -26,6 +26,9 @@ License #include "IC8H18.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::IC8H18::IC8H18() kappa_("kappa", 0.1508, -0.0001712, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", 1.758e-05, 1.3114, 392.9, 0.0), sigma_("sigma", 543.96, 0.047434, 1.1975, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 114.231, 28.0) // note: Same as nHeptane + D_("D", 147.18, 20.1, 114.231, 28.0), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::IC8H18::IC8H18 kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IC8H18/IC8H18.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IC8H18/IC8H18.H index 1c6458864a..a04ccdb4a2 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IC8H18/IC8H18.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IC8H18/IC8H18.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 @@ -76,6 +76,9 @@ class IC8H18 Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IC8H18/IC8H18I.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IC8H18/IC8H18I.H index e06e6c70e3..a3210ccdc0 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IC8H18/IC8H18I.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IC8H18/IC8H18I.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::IC8H18::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::IC8H18::h(scalar p, scalar T) const +inline Foam::scalar Foam::IC8H18::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::IC8H18::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::IC8H18::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IDEA/IDEA.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IDEA/IDEA.C index 4c6405dd32..815ce3e700 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IDEA/IDEA.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IDEA/IDEA.C @@ -26,6 +26,9 @@ License #include "IDEA.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -115,7 +118,8 @@ Foam::IDEA::IDEA() -2.5529134309e+01, 8.6488806234 ), - D_("D", 147.18, 20.1, 142.2, 28.0) // note: Same as nHeptane + D_("D", 147.18, 20.1, 142.2, 28.0), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -150,7 +154,8 @@ Foam::IDEA::IDEA kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IDEA/IDEA.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IDEA/IDEA.H index 0fd9333847..3fa2e19399 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IDEA/IDEA.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IDEA/IDEA.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 @@ -98,6 +98,9 @@ class IDEA Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -155,8 +158,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IDEA/IDEAI.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IDEA/IDEAI.H index 7f8eae0d36..7417081fea 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IDEA/IDEAI.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/IDEA/IDEAI.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::IDEA::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::IDEA::h(scalar p, scalar T) const +inline Foam::scalar Foam::IDEA::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::IDEA::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::IDEA::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/MB/MB.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/MB/MB.C index db49d9d01b..08ad2f8b6a 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/MB/MB.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/MB/MB.C @@ -26,6 +26,9 @@ License #include "MB.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -91,7 +94,8 @@ Foam::MB::MB() kappa_("kappa", 0.2298, -0.0003002, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", 1333.1, 0.9962, 12317000000.0, 0.0), sigma_("sigma", 554.5, 0.064084, 1.2418, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 102.133, 28.0) // note: Same as nHeptane + D_("D", 147.18, 20.1, 102.133, 28.0), // note: Same as nHeptane, + Hf_(h_.value(Tstd)) {} @@ -126,7 +130,8 @@ Foam::MB::MB kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/MB/MB.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/MB/MB.H index 5d57e7fb5a..4486a585e2 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/MB/MB.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/MB/MB.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 @@ -76,6 +76,9 @@ class MB Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/MB/MBI.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/MB/MBI.H index ca564a3c11..b0faf672b4 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/MB/MBI.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/MB/MBI.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::MB::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::MB::h(scalar p, scalar T) const +inline Foam::scalar Foam::MB::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::MB::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::MB::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/N2/N2.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/N2/N2.C index 3d74d89d71..a87cc4eac9 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/N2/N2.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/N2/N2.C @@ -26,6 +26,9 @@ License #include "N2.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::N2::N2() kappa_("kappa", 0.7259, -0.016728, 0.00016215, -5.7605e-07, 0.0, 0.0), kappag_("kappag", 0.000351, 0.7652, 25.767, 0.0), sigma_("sigma", 126.10, 0.02898, 1.2457, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 28.014, 28.0) // note: Same as nHeptane + D_("D", 147.18, 20.1, 28.014, 28.0), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::N2::N2 kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/N2/N2.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/N2/N2.H index dc8bafcd06..0f6bcc3da1 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/N2/N2.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/N2/N2.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 @@ -76,6 +76,9 @@ class N2 Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/N2/N2I.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/N2/N2I.H index a5d6b9ed04..b8b5191cb6 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/N2/N2I.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/N2/N2I.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::N2::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::N2::h(scalar p, scalar T) const +inline Foam::scalar Foam::N2::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::N2::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::N2::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/aC10H7CH3/aC10H7CH3.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/aC10H7CH3/aC10H7CH3.C index 9dd84f7e5e..3bb163a822 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/aC10H7CH3/aC10H7CH3.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/aC10H7CH3/aC10H7CH3.C @@ -26,6 +26,9 @@ License #include "aC10H7CH3.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -91,7 +94,8 @@ Foam::aC10H7CH3::aC10H7CH3() kappa_("kappa", 0.19758, -0.0001796, 0, 0, 0, 0), kappag_("kappag", 0.3911, -0.1051, -213.52, 2318300), sigma_("sigma", 772.04, 0.076, 1.33, 0, 0, 0), - D_("D", 147.18, 20.1, 142.2, 28) // note: Same as nHeptane + D_("D", 147.18, 20.1, 142.2, 28), // note: Same as nHeptane + Hf_(h_.value(Tstd)) {} @@ -126,7 +130,8 @@ Foam::aC10H7CH3::aC10H7CH3 kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/aC10H7CH3/aC10H7CH3.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/aC10H7CH3/aC10H7CH3.H index 5b4dd2642c..96928a6ee6 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/aC10H7CH3/aC10H7CH3.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/aC10H7CH3/aC10H7CH3.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 @@ -76,6 +76,9 @@ class aC10H7CH3 Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/aC10H7CH3/aC10H7CH3I.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/aC10H7CH3/aC10H7CH3I.H index 0925aad9ea..7e279ac5a4 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/aC10H7CH3/aC10H7CH3I.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/aC10H7CH3/aC10H7CH3I.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::aC10H7CH3::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::aC10H7CH3::h(scalar p, scalar T) const +inline Foam::scalar Foam::aC10H7CH3::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::aC10H7CH3::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::aC10H7CH3::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/bC10H7CH3/bC10H7CH3.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/bC10H7CH3/bC10H7CH3.C index 14f505d7bf..6436f6f29b 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/bC10H7CH3/bC10H7CH3.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/bC10H7CH3/bC10H7CH3.C @@ -26,6 +26,9 @@ License #include "bC10H7CH3.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::bC10H7CH3::bC10H7CH3() kappa_("kappa", 0.1962, -0.00018414, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", 0.4477, -0.1282, -345.89, 2340100), sigma_("sigma", 761.0, 0.066442, 1.2634, 0.0, 0.0, 0.0), - D_("D", 147.18, 20.1, 142.2, 28) // note: Same as nHeptane + D_("D", 147.18, 20.1, 142.2, 28), // note: Same as nHeptane, + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::bC10H7CH3::bC10H7CH3 kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/bC10H7CH3/bC10H7CH3.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/bC10H7CH3/bC10H7CH3.H index c24366e280..e2457deb7f 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/bC10H7CH3/bC10H7CH3.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/bC10H7CH3/bC10H7CH3.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 @@ -76,6 +76,9 @@ class bC10H7CH3 Function1s::NSRDS6 sigma_; Function2s::APIdiffCoef D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + public: @@ -133,8 +136,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/bC10H7CH3/bC10H7CH3I.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/bC10H7CH3/bC10H7CH3I.H index 79496ec47c..f977c4b286 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/bC10H7CH3/bC10H7CH3I.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/bC10H7CH3/bC10H7CH3I.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 @@ -47,12 +47,25 @@ inline Foam::scalar Foam::bC10H7CH3::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::bC10H7CH3::h(scalar p, scalar T) const +inline Foam::scalar Foam::bC10H7CH3::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::bC10H7CH3::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::bC10H7CH3::Ha(scalar p, scalar T) const { return h_.value(T); } + inline Foam::scalar Foam::bC10H7CH3::Cpg(scalar p, scalar T) const { return Cpg_.value(T); diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/iC3H8O/iC3H8O.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/iC3H8O/iC3H8O.C index 6a11addd26..2563377655 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/iC3H8O/iC3H8O.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/iC3H8O/iC3H8O.C @@ -26,6 +26,9 @@ License #include "iC3H8O.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::iC3H8O::iC3H8O() kappa_("kappa", 0.2029, -0.0002278, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", -80.642, -1.4549, -604.42, 0.0), sigma_("sigma", 0.03818, -3.818e-05, -6.51e-08, 0.0, 0.0, 0.0), - D_("D", 4.75e-10, 1.75, 0.0, 0.0, 0.0) + D_("D", 4.75e-10, 1.75, 0.0, 0.0, 0.0), + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::iC3H8O::iC3H8O kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/iC3H8O/iC3H8O.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/iC3H8O/iC3H8O.H index 21df60bb35..4f782d7246 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/iC3H8O/iC3H8O.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/iC3H8O/iC3H8O.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 @@ -75,6 +75,10 @@ class iC3H8O Function1s::NSRDS0 sigma_; Function1s::NSRDS1 D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + + public: friend class liquidProperties; @@ -131,8 +135,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/iC3H8O/iC3H8OI.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/iC3H8O/iC3H8OI.H index 2df2903088..d0d9e077ec 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/iC3H8O/iC3H8OI.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/iC3H8O/iC3H8OI.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::iC3H8O::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::iC3H8O::h(scalar p, scalar T) const +inline Foam::scalar Foam::iC3H8O::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::iC3H8O::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::iC3H8O::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquid/liquid.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquid/liquid.C index e55d9ce556..c1f6efd12d 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquid/liquid.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquid/liquid.C @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -27,6 +27,9 @@ License #include "None.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -75,7 +78,8 @@ Foam::liquid::liquid(const dictionary& dict) kappa_(New("kappa", dict)), kappag_(New("kappag", dict)), sigma_(New("sigma", dict)), - D_(New("D", dict)) + D_(New("D", dict)), + Hf_(h_->value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquid/liquid.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquid/liquid.H index ee9fe12660..eb089a480f 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquid/liquid.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquid/liquid.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -68,6 +68,9 @@ class liquid autoPtr> sigma_; autoPtr> D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + // Private Member Functions @@ -112,8 +115,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquid/liquidI.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquid/liquidI.H index bd6e2d40aa..356481d3fc 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquid/liquidI.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquid/liquidI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2019-2020 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2019-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -47,7 +47,19 @@ inline Foam::scalar Foam::liquid::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::liquid::h(scalar p, scalar T) const +inline Foam::scalar Foam::liquid::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::liquid::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::liquid::Ha(scalar p, scalar T) const { return h_->value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.H index 6389f23ed1..6dfc9931f3 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidProperties.H @@ -226,16 +226,16 @@ public: // Fundamental thermodynamic properties - //- Sensible enthalpy [J/kg] - inline scalar Hs(const scalar p, const scalar T) const; + //- Liquid sensible enthalpy [J/kg] + virtual scalar Hs(scalar p, scalar T) const = 0; - //- Enthalpy of formation [J/kg] - inline scalar Hf() const; + //- Liquid heat of formation [J/kg] + virtual scalar Hf() const = 0; - //- Absolute enthalpy [J/kg] - inline scalar Ha(const scalar p, const scalar T) const; + //- Liquid absolute enthalpy [J/kg] + virtual scalar Ha(scalar p, scalar T) const = 0; - // Entropy [J/kg/K] + //- Liquid entropy [J/kg/K] scalar S(const scalar p, const scalar T) const; @@ -247,9 +247,6 @@ public: //- Heat of vapourisation [J/kg] virtual scalar hl(scalar p, scalar T) const = 0; - //- Liquid enthalpy [J/kg] - reference to 298.15 K - virtual scalar h(scalar p, scalar T) const = 0; - //- Vapour heat capacity [J/kg/K] virtual scalar Cpg(scalar p, scalar T) const = 0; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidPropertiesI.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidPropertiesI.H index 51b16357f7..c40c671a22 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidPropertiesI.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/liquidProperties/liquidPropertiesI.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 @@ -109,24 +109,6 @@ inline Foam::scalar Foam::liquidProperties::CpMCv(scalar p, scalar T) const } -inline Foam::scalar Foam::liquidProperties::Ha(scalar p, scalar T) const -{ - return h(p, T); -} - - -inline Foam::scalar Foam::liquidProperties::Hs(scalar p, scalar T) const -{ - return h(p, T); -} - - -inline Foam::scalar Foam::liquidProperties::Hf() const -{ - return 0; -} - - template inline void Foam::liquidProperties::readIfPresent ( diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/nC3H8O/nC3H8O.C b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/nC3H8O/nC3H8O.C index 57d9622039..485fe35d3c 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/nC3H8O/nC3H8O.C +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/nC3H8O/nC3H8O.C @@ -26,6 +26,9 @@ License #include "nC3H8O.H" #include "addToRunTimeSelectionTable.H" +#include "thermodynamicConstants.H" +using namespace Foam::constant::thermodynamic; + // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // namespace Foam @@ -100,7 +103,8 @@ Foam::nC3H8O::nC3H8O() kappa_("kappa", 0.204, -0.000169, 0.0, 0.0, 0.0, 0.0), kappag_("kappag", -613.84, 0.7927, -1157400000.0, 0.0), sigma_("sigma", 0.04533, -6.88e-05, -1.6e-08, 0.0, 0.0, 0.0), - D_("D", 4.75e-10, 1.75, 0.0, 0.0, 0.0) // note: same as iC3H8O + D_("D", 4.75e-10, 1.75, 0.0, 0.0, 0.0), // note: same as iC3H8O, + Hf_(h_.value(Tstd)) {} @@ -135,7 +139,8 @@ Foam::nC3H8O::nC3H8O kappa_(thermalConductivity), kappag_(vapourThermalConductivity), sigma_(surfaceTension), - D_(vapourDiffusivity) + D_(vapourDiffusivity), + Hf_(h_.value(Tstd)) {} diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/nC3H8O/nC3H8O.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/nC3H8O/nC3H8O.H index 01ef01d7e2..292171e6c2 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/nC3H8O/nC3H8O.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/nC3H8O/nC3H8O.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 @@ -75,6 +75,10 @@ class nC3H8O Function1s::NSRDS0 sigma_; Function1s::NSRDS1 D_; + //- Liquid heat of formation [J/kg] + scalar Hf_; + + public: friend class liquidProperties; @@ -131,8 +135,14 @@ public: //- Liquid heat capacity [J/kg/K] inline scalar Cp(scalar p, scalar T) const; - //- Liquid enthalpy [J/kg] - inline scalar h(scalar p, scalar T) const; + //- Liquid sensible enthalpy [J/kg] + inline scalar Hs(scalar p, scalar T) const; + + //- Liquid heat of formation [J/kg] + inline scalar Hf() const; + + //- Liquid absolute enthalpy [J/kg] + inline scalar Ha(scalar p, scalar T) const; //- Ideal gas heat capacity [J/kg/K] inline scalar Cpg(scalar p, scalar T) const; diff --git a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/nC3H8O/nC3H8OI.H b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/nC3H8O/nC3H8OI.H index 4326c2caaa..dd22b7a37b 100644 --- a/src/thermophysicalModels/thermophysicalProperties/liquidProperties/nC3H8O/nC3H8OI.H +++ b/src/thermophysicalModels/thermophysicalProperties/liquidProperties/nC3H8O/nC3H8OI.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 @@ -47,7 +47,19 @@ inline Foam::scalar Foam::nC3H8O::Cp(scalar p, scalar T) const } -inline Foam::scalar Foam::nC3H8O::h(scalar p, scalar T) const +inline Foam::scalar Foam::nC3H8O::Hs(scalar p, scalar T) const +{ + return Ha(p, T) - Hf(); +} + + +inline Foam::scalar Foam::nC3H8O::Hf() const +{ + return Hf_; +} + + +inline Foam::scalar Foam::nC3H8O::Ha(scalar p, scalar T) const { return h_.value(T); } diff --git a/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidProperties.H b/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidProperties.H index 34de0ab5bd..bf7333d18f 100644 --- a/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidProperties.H +++ b/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidProperties.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 @@ -149,11 +149,14 @@ public: //- Thermal conductivity [W/m/K] inline scalar kappa() const; + //- Sensible enthalpy - reference to Tstd [J/kg] + inline scalar Hs(const scalar T) const; + //- Heat of formation [J/kg] inline scalar Hf() const; - //- Sensible enthalpy - reference to Tstd [J/kg] - inline scalar Hs(const scalar T) const; + //- Absolute enthalpy [J/kg] + inline scalar Ha(scalar T) const; //- Emissivity [] inline scalar emissivity() const; diff --git a/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesI.H b/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesI.H index f82d5a460b..12b6f1f78c 100644 --- a/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesI.H +++ b/src/thermophysicalModels/thermophysicalProperties/solidProperties/solidProperties/solidPropertiesI.H @@ -2,7 +2,7 @@ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org - \\ / A nd | Copyright (C) 2011-2018 OpenFOAM Foundation + \\ / A nd | Copyright (C) 2011-2021 OpenFOAM Foundation \\/ M anipulation | ------------------------------------------------------------------------------- License @@ -45,15 +45,21 @@ inline Foam::scalar Foam::solidProperties::kappa() const } +inline Foam::scalar Foam::solidProperties::Hs(const scalar T) const +{ + return Cp_*(T - Tstd); +} + + inline Foam::scalar Foam::solidProperties::Hf() const { return Hf_; } -inline Foam::scalar Foam::solidProperties::Hs(const scalar T) const +inline Foam::scalar Foam::solidProperties::Ha(const scalar T) const { - return Cp_*(T - Tstd); + return Hs(T) + Hf(); } diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/Allclean b/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/Allclean index 6410dc90ef..1ece050446 100755 --- a/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/Allclean +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/Allclean @@ -6,7 +6,6 @@ cd ${0%/*} || exit 1 # Run from this directory cleanCase -rm -rf constant/wallFilmRegion -rm -f *.obj +rm -rf constant/wallFilmRegion/polyMesh #------------------------------------------------------------------------------ diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/constant/surfaceFilmProperties b/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/constant/surfaceFilmProperties index 02d72a9af6..a255f96ecc 100644 --- a/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/constant/surfaceFilmProperties +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/constant/surfaceFilmProperties @@ -19,19 +19,13 @@ surfaceFilmModel thermoSingleLayer; regionName wallFilmRegion; -thermophysicalProperties -{ - type liquid; - - useReferenceValues no; - liquid H2O; -} - viscosity { - model liquid; + model Newtonian; } +sigma 0.07; + deltaWet 1e-4; hydrophilic no; diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/constant/wallFilmRegion/thermophysicalProperties b/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/constant/wallFilmRegion/thermophysicalProperties new file mode 100644 index 0000000000..ce62d79608 --- /dev/null +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/constant/wallFilmRegion/thermophysicalProperties @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + properties liquid; + energy sensibleInternalEnergy; +} + +mixture +{ + H2O; +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/system/wallFilmRegion/fvSchemes b/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/system/wallFilmRegion/fvSchemes index 12fc639964..c2d1f607dc 100644 --- a/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/system/wallFilmRegion/fvSchemes +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/system/wallFilmRegion/fvSchemes @@ -31,7 +31,7 @@ divSchemes div(phid,alpha) Gauss upwind; div(phi,U) Gauss upwind; - div(phi,h) Gauss upwind; + div(phi,e) Gauss upwind; div(nHat) Gauss linear; } diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/system/wallFilmRegion/fvSolution b/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/system/wallFilmRegion/fvSolution index 9268de5b1b..599e40c0f1 100644 --- a/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/system/wallFilmRegion/fvSolution +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/cylinder/system/wallFilmRegion/fvSolution @@ -25,7 +25,7 @@ solvers relTol 0; } - "(U|h).*" + "(U|e).*" { solver smoothSolver; smoother symGaussSeidel; diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/0/T b/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/0/T index 4965597291..29c8ed5a42 100644 --- a/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/0/T +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/0/T @@ -30,7 +30,7 @@ boundaryField "(region0_to.*)" { type mapped; - field Ts; + field T; average 300; setAverage no; value uniform 300; diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/Allclean b/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/Allclean index 6410dc90ef..1ece050446 100755 --- a/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/Allclean +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/Allclean @@ -6,7 +6,6 @@ cd ${0%/*} || exit 1 # Run from this directory cleanCase -rm -rf constant/wallFilmRegion -rm -f *.obj +rm -rf constant/wallFilmRegion/polyMesh #------------------------------------------------------------------------------ diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/constant/surfaceFilmProperties b/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/constant/surfaceFilmProperties index 87c792548e..427d8b9b2b 100644 --- a/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/constant/surfaceFilmProperties +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/constant/surfaceFilmProperties @@ -19,19 +19,13 @@ surfaceFilmModel thermoSingleLayer; regionName wallFilmRegion; -thermophysicalProperties -{ - type liquid; - - useReferenceValues no; - liquid H2O; -} - viscosity { - model liquid; + model Newtonian; } +sigma 0.07; + deltaWet 1e-4; hydrophilic no; diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/constant/wallFilmRegion/thermophysicalProperties b/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/constant/wallFilmRegion/thermophysicalProperties new file mode 100644 index 0000000000..ce62d79608 --- /dev/null +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/constant/wallFilmRegion/thermophysicalProperties @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + properties liquid; + energy sensibleInternalEnergy; +} + +mixture +{ + H2O; +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/system/wallFilmRegion/fvSchemes b/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/system/wallFilmRegion/fvSchemes index 12fc639964..c2d1f607dc 100644 --- a/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/system/wallFilmRegion/fvSchemes +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/system/wallFilmRegion/fvSchemes @@ -31,7 +31,7 @@ divSchemes div(phid,alpha) Gauss upwind; div(phi,U) Gauss upwind; - div(phi,h) Gauss upwind; + div(phi,e) Gauss upwind; div(nHat) Gauss linear; } diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/system/wallFilmRegion/fvSolution b/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/system/wallFilmRegion/fvSolution index 4cb873ee2e..3e63e63d26 100644 --- a/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/system/wallFilmRegion/fvSolution +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/hotBoxes/system/wallFilmRegion/fvSolution @@ -26,7 +26,7 @@ solvers maxIter 100; } - "(U|h).*" + "(U|e).*" { solver smoothSolver; smoother GaussSeidel; diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/Allclean b/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/Allclean index 6410dc90ef..1ece050446 100755 --- a/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/Allclean +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/Allclean @@ -6,7 +6,6 @@ cd ${0%/*} || exit 1 # Run from this directory cleanCase -rm -rf constant/wallFilmRegion -rm -f *.obj +rm -rf constant/wallFilmRegion/polyMesh #------------------------------------------------------------------------------ diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/constant/surfaceFilmProperties b/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/constant/surfaceFilmProperties index ee14397e5e..8becd8e8cd 100644 --- a/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/constant/surfaceFilmProperties +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/constant/surfaceFilmProperties @@ -15,20 +15,21 @@ FoamFile } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // -surfaceFilmModel kinematicSingleLayer; +surfaceFilmModel thermoSingleLayer; regionName wallFilmRegion; -thermophysicalProperties +viscosity { - type constant; - - specie water; - rho0 1000; - mu0 1e-3; - sigma0 0.07; + model Newtonian; } +sigma 0.07; + +deltaWet 1e-12; + +hydrophilic no; + momentumTransport { model laminar; @@ -57,5 +58,23 @@ forces } } +upperSurfaceModels +{ + heatTransfer + { + model constant; + c0 1; + } +} + +lowerSurfaceModels +{ + heatTransfer + { + model constant; + c0 1; + } +} + // ************************************************************************* // diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/constant/wallFilmRegion/thermophysicalProperties b/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/constant/wallFilmRegion/thermophysicalProperties new file mode 100644 index 0000000000..ce62d79608 --- /dev/null +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/constant/wallFilmRegion/thermophysicalProperties @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + properties liquid; + energy sensibleInternalEnergy; +} + +mixture +{ + H2O; +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/system/wallFilmRegion/fvSchemes b/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/system/wallFilmRegion/fvSchemes index b120047ada..6e6c7d79d0 100644 --- a/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/system/wallFilmRegion/fvSchemes +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/system/wallFilmRegion/fvSchemes @@ -31,7 +31,7 @@ divSchemes div(phid,alpha) Gauss upwind; div(phi,U) Gauss upwind; - div(phi,h) Gauss upwind; + div(phi,e) Gauss upwind; div(nHat) Gauss linear; } diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/system/wallFilmRegion/fvSolution b/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/system/wallFilmRegion/fvSolution index ae29b1357f..9df2308aa9 100644 --- a/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/system/wallFilmRegion/fvSolution +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/rivuletPanel/system/wallFilmRegion/fvSolution @@ -25,7 +25,7 @@ solvers relTol 0; } - "(U|h).*" + "(U|e).*" { solver smoothSolver; smoother symGaussSeidel; diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/Allclean b/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/Allclean index 39d533d770..aaa05f5653 100755 --- a/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/Allclean +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/Allclean @@ -6,6 +6,6 @@ cd ${0%/*} || exit 1 # Run from this directory cleanCase -rm -rf constant/wallFilm +rm -rf constant/wallFilm/polyMesh #------------------------------------------------------------------------------ diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/constant/surfaceFilmProperties b/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/constant/surfaceFilmProperties index 2ef3010ded..8800e316c3 100644 --- a/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/constant/surfaceFilmProperties +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/constant/surfaceFilmProperties @@ -19,19 +19,13 @@ surfaceFilmModel thermoSingleLayer; regionName wallFilm; -thermophysicalProperties -{ - type liquid; - - useReferenceValues no; - liquid H2O; -} - viscosity { - model liquid; + model Newtonian; } +sigma 0.07; + deltaWet 1e-4; hydrophilic no; diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/constant/wallFilm/thermophysicalProperties b/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/constant/wallFilm/thermophysicalProperties new file mode 100644 index 0000000000..ce62d79608 --- /dev/null +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/constant/wallFilm/thermophysicalProperties @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + properties liquid; + energy sensibleInternalEnergy; +} + +mixture +{ + H2O; +} + + +// ************************************************************************* // diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/system/wallFilm/fvSchemes b/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/system/wallFilm/fvSchemes index 3d72b3a98b..fa58e7c2d9 100644 --- a/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/system/wallFilm/fvSchemes +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/system/wallFilm/fvSchemes @@ -31,7 +31,7 @@ divSchemes div(phid,alpha) Gauss upwind; div(phi,U) Gauss upwind; - div(phi,h) Gauss upwind; + div(phi,e) Gauss upwind; div(nHat) Gauss linear; } diff --git a/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/system/wallFilm/fvSolution b/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/system/wallFilm/fvSolution index 84baadb7dc..1cbfa8c9e5 100644 --- a/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/system/wallFilm/fvSolution +++ b/tutorials/lagrangian/buoyantReactingParticleFoam/splashPanel/system/wallFilm/fvSolution @@ -25,7 +25,7 @@ solvers relTol 0; } - "(U|h).*" + "(U|e).*" { solver PBiCGStab; preconditioner DILU; diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/Allclean b/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/Allclean index 4baea55abd..39884172da 100755 --- a/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/Allclean +++ b/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/Allclean @@ -6,6 +6,6 @@ cd ${0%/*} || exit 1 # Run from this directory cleanCase rm -rf 0/T.* -rm -rf constant/plateRegion +rm -rf constant/plateRegion/polyMesh #------------------------------------------------------------------------------ diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/constant/plateRegion/thermophysicalProperties b/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/constant/plateRegion/thermophysicalProperties new file mode 100644 index 0000000000..ce62d79608 --- /dev/null +++ b/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/constant/plateRegion/thermophysicalProperties @@ -0,0 +1,32 @@ +/*--------------------------------*- C++ -*----------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Version: dev + \\/ M anipulation | +\*---------------------------------------------------------------------------*/ +FoamFile +{ + version 2.0; + format ascii; + class dictionary; + location "constant"; + object thermophysicalProperties; +} +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +thermoType +{ + type heRhoThermo; + mixture pureMixture; + properties liquid; + energy sensibleInternalEnergy; +} + +mixture +{ + H2O; +} + + +// ************************************************************************* // diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/constant/surfaceFilmProperties b/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/constant/surfaceFilmProperties index ac458a3484..adc7db577e 100644 --- a/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/constant/surfaceFilmProperties +++ b/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/constant/surfaceFilmProperties @@ -21,53 +21,16 @@ regionName plateRegion; phase liquid; -thermophysicalProperties -{ - type liquid; - - mixture - { - liquid - { - type H2O; - - // Set Cp constant and the corresponding linear function for h for - // compatibility with the current hard-coded thermodynamics model in - // surfaceFilm - - Cp - { - a 4200; - b 0; - c 0; - d 0; - e 0; - f 0; - } - - h - { - a -1252230; // -Cp*TRef where TRef = 298.15 - b 4200; - c 0; - d 0; - e 0; - f 0; - } - } - } - - useReferenceValues no; -} - viscosity { - model liquid; + model Newtonian; } -deltaWet 1e-12; +sigma 0.07; -hydrophilic no; +deltaWet 1e-12; + +hydrophilic no; transfer { diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/constant/thermophysicalProperties.liquid b/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/constant/thermophysicalProperties.liquid index 02fff61839..ce62d79608 100644 --- a/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/constant/thermophysicalProperties.liquid +++ b/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/constant/thermophysicalProperties.liquid @@ -25,34 +25,7 @@ thermoType mixture { - liquid - { - type H2O; - - // Set Cp constant and the corresponding linear function for h - // for compatibility with the current hard-coded thermodynamics model - // in surfaceFilm - - Cp - { - a 4200; - b 0; - c 0; - d 0; - e 0; - f 0; - } - - h - { - a -1252230; // -Cp*TRef where TRef = 298.15 - b 4200; - c 0; - d 0; - e 0; - f 0; - } - } + H2O; } diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/system/plateRegion/fvSchemes b/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/system/plateRegion/fvSchemes index e58bc75551..5a029e423f 100644 --- a/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/system/plateRegion/fvSchemes +++ b/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/system/plateRegion/fvSchemes @@ -31,7 +31,7 @@ divSchemes div(phid,alpha) Gauss upwind; div(phi,U) Gauss upwind; - div(phi,h) Gauss upwind; + div(phi,e) Gauss upwind; } laplacianSchemes diff --git a/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/system/plateRegion/fvSolution b/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/system/plateRegion/fvSolution index dd60f8317d..8ffde56169 100644 --- a/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/system/plateRegion/fvSolution +++ b/tutorials/multiphase/compressibleInterFoam/laminar/plateFilm/system/plateRegion/fvSolution @@ -17,7 +17,7 @@ FoamFile solvers { - "(U|h|alpha).*" + "(U|e|alpha).*" { solver PBiCGStab; preconditioner DILU;