From b427b739a82cec2aeb5ef8b8a3d5d4d9ea117ab7 Mon Sep 17 00:00:00 2001 From: pkuLmq <1900011062@pku.edu.cn> Date: Mon, 19 Aug 2024 14:10:44 +0800 Subject: [PATCH] adjust update order of temperature and velocity for lagrangian parcels and add new evaporation model --- src/lagrangian/Allwmake | 1 + .../Templates/ReactingParcel/ReactingParcel.C | 71 +++++--- .../LiquidEvaporationSpalding.C | 153 ++++++++++++++++++ .../LiquidEvaporationSpalding.H | 117 ++++++++++++++ .../LiquidEvaporationSpaldings.C | 38 +++++ .../LiquidEvaporationSpalding/Make/files | 3 + .../LiquidEvaporationSpalding/Make/options | 43 +++++ 7 files changed, 408 insertions(+), 18 deletions(-) create mode 100755 src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/LiquidEvaporationSpalding.C create mode 100644 src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/LiquidEvaporationSpalding.H create mode 100755 src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/LiquidEvaporationSpaldings.C create mode 100644 src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/Make/files create mode 100644 src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/Make/options diff --git a/src/lagrangian/Allwmake b/src/lagrangian/Allwmake index e0d44ab93..4a44db6cf 100755 --- a/src/lagrangian/Allwmake +++ b/src/lagrangian/Allwmake @@ -7,5 +7,6 @@ cd ${0%/*} || exit 1 # Run from this directory wmake $targetType intermediate wmake $targetType turbulence wmake $targetType spray +wmake $targetType intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding #------------------------------------------------------------------------------ diff --git a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C index 9bff419bb..cd54c3cbf 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ReactingParcel/ReactingParcel.C @@ -394,7 +394,7 @@ void Foam::ReactingParcel::calc typedef typename TrackCloudType::reactingCloudType reactingCloudType; const CompositionModel& composition = cloud.composition(); - + const SLGThermo& thermo = cloud.thermo(); // Define local properties at beginning of time step // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -404,13 +404,34 @@ void Foam::ReactingParcel::calc const vector& U0 = this->U_; const scalar T0 = this->T_; const scalar mass0 = this->mass(); + const scalar RR = 1000.0*constant::physicoChemical::R.value(); - - // Calc surface values scalar Ts, rhos, mus, Prs, kappas; - this->calcSurfaceValues(cloud, td, T0, Ts, rhos, mus, Prs, kappas); - scalar Res = this->Re(rhos, U0, td.Uc(), d0, mus); + // Calc carrier thermo properties + scalarField Yg(thermo.carrier().species().size()); + scalar rhog = td.pc()*thermo.carrier().W()/(RR*td.Tc()); + scalar mug = 0; + scalar kappag = 0; + scalar Cpg = 0; + + thermo.carrier().calcMu(td.Tc(), td.pc()); + thermo.carrier().calcCp(td.Tc(), td.pc()); + forAll(Yg, i) + { + Yg[i] = thermo.carrier().Y(i)[this->cell()]; + mug += Yg[i]*thermo.carrier().mu(i, td.pc(), td.Tc()); + kappag += Yg[i]*thermo.carrier().kappa(i, td.pc(), td.Tc()); + Cpg += Yg[i]*thermo.carrier().Cp(i, td.pc(), td.Tc()); + } + + rhog = max(rhog, rootVSmall); + mug = max(mug, rootVSmall); + kappag = max(kappag, rootVSmall); + Cpg = max(Cpg, rootVSmall); + + scalar Prg = Cpg*mug/kappag; + Prg = max(Prg,rootVSmall); // Sources // ~~~~~~~ @@ -452,13 +473,21 @@ void Foam::ReactingParcel::calc // Surface concentrations of emitted species scalarField Cs(composition.carrier().species().size(), 0.0); + this->Cp_ = composition.Cp(0, Y_, td.pc(), T0); + + this->calcSurfaceValues(cloud, td, T0, Ts, rhos, mus, Prs, kappas); + // droplet Re calculated using carrier's rho and mu + scalar Red = this->Re(td.rhoc(), U0, td.Uc(), d0, mug); + // droplet Re calculated using surface value + scalar Res = this->Re(rhos, U0, td.Uc(), d0, mus); + // Calc mass and enthalpy transfer due to phase change calcPhaseChange ( cloud, td, dt, - Res, + Red, //using new droplet Re Prs, Ts, mus/rhos, @@ -524,8 +553,20 @@ void Foam::ReactingParcel::calc // Correct surface values due to emitted species correctSurfaceValues(cloud, td, Ts, Cs, rhos, mus, Prs, kappas); - Res = this->Re(rhos, U0, td.Uc(), this->d(), mus); + Res = this->Re(rhos, U0, td.Uc(), this->d_, mus); + Red = this->Re(td.rhoc(), U0, td.Uc(), this->d_, mug); + + // Motion + // ~~~~~~ + + // 3. Calculate new particle velocity + this->U_ = + this->calcVelocity(cloud, td, dt, Res, mus, mass1, Su, dUTrans, Spu); + + this->Cp_ = composition.Cp(0, Y_, td.pc(), T0); + Red = this->Re(td.rhoc(), this->U_, td.Uc(), this->d_, mug); + Res = this->Re(rhos, this->U_, td.Uc(), this->d_, mus); // 3. Compute heat- and momentum transfers // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ @@ -533,7 +574,7 @@ void Foam::ReactingParcel::calc // Heat transfer // ~~~~~~~~~~~~~ - // Calculate new particle temperature + // 4. Calculate new particle temperature this->T_ = this->calcHeatTransfer ( @@ -549,18 +590,10 @@ void Foam::ReactingParcel::calc Sph ); - this->Cp_ = composition.Cp(0, Y_, td.pc(), T0); - - - // Motion - // ~~~~~~ - - // Calculate new particle velocity - this->U_ = - this->calcVelocity(cloud, td, dt, Res, mus, mass1, Su, dUTrans, Spu); + this->Cp_ = composition.Cp(0, Y_, td.pc(), this->T_); - // 4. Accumulate carrier phase source terms + // 5. Accumulate carrier phase source terms // ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ if (cloud.solution().coupled()) @@ -584,6 +617,8 @@ void Foam::ReactingParcel::calc // Update sensible enthalpy transfer cloud.hsTrans()[this->cell()] += np0*dhsTrans; + // add additional term for work between droplets and carrier + cloud.hsTrans()[this->cell()] += U0&cloud.UTrans()[this->cell()]*dt; cloud.hsCoeff()[this->cell()] += np0*Sph; // Update radiation fields diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/LiquidEvaporationSpalding.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/LiquidEvaporationSpalding.C new file mode 100755 index 000000000..40c02b428 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/LiquidEvaporationSpalding.C @@ -0,0 +1,153 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2019 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 "LiquidEvaporationSpalding.H" +// #include "specie.H" +#include "mathematicalConstants.H" + +using namespace Foam::constant::mathematical; + +// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * // + +template +Foam::LiquidEvaporationSpalding::LiquidEvaporationSpalding +( + const dictionary& dict, + CloudType& owner +) +: + LiquidEvaporationBoil(dict, owner) +{ + +} + + +template +Foam::LiquidEvaporationSpalding::LiquidEvaporationSpalding +( + const LiquidEvaporationSpalding& pcm +) +: + LiquidEvaporationBoil(pcm) +{} + + +// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * // + +template +Foam::LiquidEvaporationSpalding::~LiquidEvaporationSpalding() +{} + + +// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // + +template +void Foam::LiquidEvaporationSpalding::calculate +( + const scalar dt, + const label celli, + const scalar Re, + const scalar Pr, + const scalar d, + const scalar nu, + const scalar T, + const scalar Ts, + const scalar pc, + const scalar Tc, + const scalarField& X, + scalarField& dMassPC +) const +{ + // immediately evaporate mass that has reached critical condition + // Info <<"Using new evaporation model"<< endl; + if ((this->liquids_.Tc(X) - T) < small) + { + if (debug) + { + WarningInFunction + << "Parcel reached critical conditions: " + << "evaporating all available mass" << endl; + } + + forAll(this->activeLiquids_, i) + { + const label lid = this->liqToLiqMap_[i]; + dMassPC[lid] = great; + } + + return; + } + + // droplet surface pressure assumed to surface vapour pressure + scalar ps = this->liquids_.pv(pc, Ts, X); + + // vapour density at droplet surface [kg/m3] + const scalar RR = 1000.0*constant::physicoChemical::R.value(); // J/(kmolĀ·k) + scalar rhos = ps*this->liquids_.W(X)/(RR*Ts); + + // calculate mass transfer of each specie in liquid + forAll(this->activeLiquids_, i) + { + const label gid = this->liqToCarrierMap_[i]; + const label lid = this->liqToLiqMap_[i]; + + // boiling temperature at cell pressure for liquid species lid [K] + const scalar TBoil = this->liquids_.properties()[lid].pvInvert(pc); + // limit droplet temperature to boiling/critical temperature + const scalar Td = min(T, 0.999*TBoil); + // saturation pressure for liquid species lid [Pa] + const scalar pSat = this->liquids_.properties()[lid].pv(pc, Td); + // surface molar fraction - Raoult's Law + const scalar Xs = X[lid]*pSat/pc; + + // vapour diffusivity [m2/s] + const scalar Dab = this->liquids_.properties()[lid].D(ps, Ts); + // Schmidt number + const scalar Sc = nu/(Dab + rootVSmall); + // Sherwood number + const scalar Sh = this->Sh(Re, Sc); + + // mixture molar weight + // scalar W_gas =this->owner().thermo().carrier().W(); + scalar W_gas =this->owner().thermo().carrier().W(); // kg/kmol + // scalar W_gas =this->owner().thermo().carrier().cellMixture(celli).W(); // kg/kmol + + const scalar Yc = this->owner().thermo().carrier().Y()[gid][celli]; + + // fuel molar weight [kg/kmol] + const scalar W_fuel = this->liquids_.properties()[lid].W(); + + const scalar Ys = Xs*W_fuel/W_gas/(1. + Xs*W_fuel/W_gas - Xs); // ref Hu.2017, Spalding.1953 + const scalar Bm = (Ys - Yc)/max(small, 1. - Ys); + + if (Bm > 0) + { + // mass transfer [kg] + dMassPC[lid] += pi*d*Sh*Dab*rhos*log(1.0 + Bm)*dt; + } + } +} + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/LiquidEvaporationSpalding.H b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/LiquidEvaporationSpalding.H new file mode 100644 index 000000000..c2b6d08bd --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/LiquidEvaporationSpalding.H @@ -0,0 +1,117 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | Website: https://openfoam.org + \\ / A nd | Copyright (C) 2011-2018 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::LiquidEvaporationSpalding + +Description + Liquid evaporation model + - uses ideal gas assumption + +\*---------------------------------------------------------------------------*/ + +#ifndef LiquidEvaporationSpalding_H +#define LiquidEvaporationSpalding_H + +// #include "PhaseChangeModel.H" +#include "LiquidEvaporationBoil.H" +#include "liquidMixtureProperties.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +namespace Foam +{ +/*---------------------------------------------------------------------------*\ + Class LiquidEvaporationSpalding Declaration +\*---------------------------------------------------------------------------*/ + +template +class LiquidEvaporationSpalding +: + public LiquidEvaporationBoil +{ +public: + + //- Runtime type information + TypeName("liquidEvaporationSpalding"); + + + // Constructors + + //- Construct from dictionary + LiquidEvaporationSpalding(const dictionary& dict, CloudType& cloud); + + //- Construct copy + LiquidEvaporationSpalding(const LiquidEvaporationSpalding& pcm); + + //- Construct and return a clone + virtual autoPtr> clone() const + { + return autoPtr> + ( + new LiquidEvaporationSpalding(*this) + ); + } + + + //- Destructor + virtual ~LiquidEvaporationSpalding(); + + + // Member Functions + + //- Update model + virtual void calculate + ( + const scalar dt, + const label celli, + const scalar Re, + const scalar Pr, + const scalar d, + const scalar nu, + const scalar T, + const scalar Ts, + const scalar pc, + const scalar Tc, + const scalarField& X, + scalarField& dMassPC + ) const; + +}; + + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +} // End namespace Foam + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#ifdef NoRepository + #include "LiquidEvaporationSpalding.C" +#endif + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + +#endif + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/LiquidEvaporationSpaldings.C b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/LiquidEvaporationSpaldings.C new file mode 100755 index 000000000..c311c808e --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/LiquidEvaporationSpaldings.C @@ -0,0 +1,38 @@ +/*---------------------------------------------------------------------------*\ + ========= | + \\ / F ield | OpenFOAM: The Open Source CFD Toolbox + \\ / O peration | + \\ / A nd | Copyright (C) 2011-2017 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 "basicSprayCloud.H" +#include "basicReactingCloud.H" + + +#include "LiquidEvaporationSpalding.H" + +// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // + + +makePhaseChangeModelType(LiquidEvaporationSpalding, basicSprayCloud ); + + +// ************************************************************************* // diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/Make/files b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/Make/files new file mode 100644 index 000000000..ffa5596cb --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/Make/files @@ -0,0 +1,3 @@ +LiquidEvaporationSpaldings.C + +LIB = $(DF_LIBBIN)/libEvaporationNew \ No newline at end of file diff --git a/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/Make/options b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/Make/options new file mode 100644 index 000000000..f836540e0 --- /dev/null +++ b/src/lagrangian/intermediate/submodels/Reacting/PhaseChangeModel/LiquidEvaporationSpalding/Make/options @@ -0,0 +1,43 @@ +EXE_INC = \ + -Wno-old-style-cast \ + -I$(LIB_SRC)/lagrangian/basic/lnInclude \ + -I$(LIB_SRC)/lagrangian/distributionModels/lnInclude \ + -I$(DF_SRC)/lagrangian/intermediate/lnInclude \ + -I$(LIB_SRC)/lagrangian/intermediate/lnInclude \ + -I$(DF_SRC)/lagrangian/spray/lnInclude \ + -I$(LIB_SRC)/lagrangian/spray/lnInclude \ + -I$(LIB_SRC)/transportModels/compressible/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \ + -I$(DF_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \ + -I$(LIB_SRC)/thermophysicalModels/thermophysicalProperties/lnInclude \ + -I$(DF_SRC)/thermophysicalModels/SLGThermo/lnInclude \ + -I$(CANTERA_ROOT)/include \ + -I$(DF_SRC)/dfCanteraMixture/lnInclude \ + -I$(LIB_SRC)/transportModels \ + -I$(LIB_SRC)/regionModels/regionModel/lnInclude \ + -I$(LIB_SRC)/regionModels/surfaceFilmModels/lnInclude \ + -I$(LIB_SRC)/dynamicFvMesh/lnInclude \ + -I$(LIB_SRC)/sampling/lnInclude \ + -I$(LIB_SRC)/finiteVolume/lnInclude \ + -I$(LIB_SRC)/meshTools/lnInclude + +LIB_LIBS = \ + $(CANTERA_ROOT)/lib/libcantera.so \ + -L$(DF_LIBBIN) \ + -ldfCanteraMixture \ + -llagrangian \ + -ldistributionModels \ + -lcompressibleTransportModels \ + -ldfFluidThermophysicalModels \ + -ldfThermophysicalProperties \ + -ldfSLGThermo \ + -lincompressibleTransportModels \ + -lregionModels \ + -ldfSurfaceFilmModels \ + -ldfLagrangianSpray \ + -ldynamicFvMesh \ + -lsampling \ + -lfiniteVolume \ + -lmeshTools \ + -L$(DF_LIBBIN) \ + -ldfLagrangianIntermediate