mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' into fieldSourcesLib
This commit is contained in:
@ -37,6 +37,8 @@ Description
|
|||||||
#include "vector.H"
|
#include "vector.H"
|
||||||
#include "ListOps.H"
|
#include "ListOps.H"
|
||||||
|
|
||||||
|
#include<list>
|
||||||
|
|
||||||
using namespace Foam;
|
using namespace Foam;
|
||||||
|
|
||||||
|
|
||||||
@ -117,6 +119,35 @@ int main(int argc, char *argv[])
|
|||||||
<< "-wordList: " << wLst << nl
|
<< "-wordList: " << wLst << nl
|
||||||
<< "-stringList: " << sLst << endl;
|
<< "-stringList: " << sLst << endl;
|
||||||
|
|
||||||
|
|
||||||
|
Info<< nl
|
||||||
|
<< "Test List Iterator Constuctor" << endl;
|
||||||
|
|
||||||
|
List<vector> initialList(IStringStream("((0 1 2) (3 4 5) (6 7 8))")());
|
||||||
|
|
||||||
|
Info<< " Initial List: " << initialList << endl;
|
||||||
|
|
||||||
|
List<vector> iteratorList(initialList.begin(), initialList.end());
|
||||||
|
|
||||||
|
Info<< " Foam::List constructed from Foam::List: "
|
||||||
|
<< iteratorList << endl;
|
||||||
|
|
||||||
|
std::list<vector> stlList(initialList.begin(), initialList.end());
|
||||||
|
|
||||||
|
Info<< " std::list constructed from Foam::List: ";
|
||||||
|
|
||||||
|
std::list<vector>::iterator it;
|
||||||
|
for (it=stlList.begin(); it != stlList.end(); it++)
|
||||||
|
{
|
||||||
|
Info<< *it << " ";
|
||||||
|
}
|
||||||
|
Info<< endl;
|
||||||
|
|
||||||
|
List<vector> iteratorSTLList(stlList.begin(), stlList.end());
|
||||||
|
|
||||||
|
Info<< " Foam::List constructed from std::list: "
|
||||||
|
<< iteratorList << endl;
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -273,12 +273,16 @@ int main(int argc, char *argv[])
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
outFile << nl << "NORMALS pointNormals float\n";
|
if (!pointNormals.empty())
|
||||||
forAll(pointNormals, i)
|
|
||||||
{
|
{
|
||||||
const vector& n = pointNormals[i];
|
outFile << nl << "NORMALS pointNormals float\n";
|
||||||
|
|
||||||
outFile << n.x() << ' ' << n.y() << ' ' << n.z() << nl;
|
forAll(pointNormals, i)
|
||||||
|
{
|
||||||
|
const vector& n = pointNormals[i];
|
||||||
|
|
||||||
|
outFile << n.x() << ' ' << n.y() << ' ' << n.z() << nl;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
Info<< "End\n" << endl;
|
||||||
|
|||||||
@ -200,7 +200,7 @@ Foam::List<T>::List(InputIterator first, InputIterator last)
|
|||||||
++iter
|
++iter
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
this->operator[](s++) = iter();
|
this->operator[](s++) = *iter;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -232,7 +232,7 @@ Foam::scalar Foam::LiquidEvaporation<CloudType>::dh
|
|||||||
"const label, "
|
"const label, "
|
||||||
"const label, "
|
"const label, "
|
||||||
"const label"
|
"const label"
|
||||||
")"
|
") const"
|
||||||
) << "Unknown enthalpyTransfer type" << abort(FatalError);
|
) << "Unknown enthalpyTransfer type" << abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -157,17 +157,23 @@ void Foam::LiquidEvaporationBoil<CloudType>::calculate
|
|||||||
// liquid volume fraction
|
// liquid volume fraction
|
||||||
const scalarField X(liquids_.X(Yl));
|
const scalarField X(liquids_.X(Yl));
|
||||||
|
|
||||||
// droplet surface pressure
|
// droplet surface pressure assumed to surface vapour pressure
|
||||||
scalar ps = liquids_.pv(pc, T, X);
|
scalar ps = liquids_.pv(pc, Ts, X);
|
||||||
|
|
||||||
// vapour density at droplet surface [kg/m3]
|
// vapour density at droplet surface [kg/m3]
|
||||||
scalar rhos = ps*liquids_.W(X)/(specie::RR*Ts);
|
scalar rhos = ps*liquids_.W(X)/(specie::RR*Ts);
|
||||||
|
|
||||||
// thermal conductivity of carrier [W/m/K]
|
// carrier thermo properties
|
||||||
|
scalar Hsc = 0.0;
|
||||||
|
scalar Hc = 0.0;
|
||||||
|
scalar Cpc = 0.0;
|
||||||
scalar kappac = 0.0;
|
scalar kappac = 0.0;
|
||||||
forAll(this->owner().thermo().carrier().Y(), i)
|
forAll(this->owner().thermo().carrier().Y(), i)
|
||||||
{
|
{
|
||||||
const scalar Yc = this->owner().thermo().carrier().Y()[i][cellI];
|
scalar Yc = this->owner().thermo().carrier().Y()[i][cellI];
|
||||||
|
Hc += Yc*this->owner().thermo().carrier().H(i, Tc);
|
||||||
|
Hsc += Yc*this->owner().thermo().carrier().H(i, Ts);
|
||||||
|
Cpc += Yc*this->owner().thermo().carrier().Cp(i, Ts);
|
||||||
kappac += Yc*this->owner().thermo().carrier().kappa(i, Ts);
|
kappac += Yc*this->owner().thermo().carrier().kappa(i, Ts);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -189,32 +195,77 @@ void Foam::LiquidEvaporationBoil<CloudType>::calculate
|
|||||||
// carrier phase concentration
|
// carrier phase concentration
|
||||||
const scalar Xc = XcMix[gid];
|
const scalar Xc = XcMix[gid];
|
||||||
|
|
||||||
|
|
||||||
if (Xc*pc > pSat)
|
if (Xc*pc > pSat)
|
||||||
{
|
{
|
||||||
// saturated vapour - no phase change
|
// saturated vapour - no phase change
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
// vapour diffusivity [m2/s]
|
||||||
|
const scalar Dab = liquids_.properties()[lid].D(ps, Ts);
|
||||||
|
|
||||||
|
// Schmidt number
|
||||||
|
const scalar Sc = nu/(Dab + ROOTVSMALL);
|
||||||
|
|
||||||
|
// Sherwood number
|
||||||
|
const scalar Sh = this->Sh(Re, Sc);
|
||||||
|
|
||||||
|
|
||||||
if (pSat > 0.999*pc)
|
if (pSat > 0.999*pc)
|
||||||
{
|
{
|
||||||
// boiling
|
// boiling
|
||||||
|
|
||||||
// const scalar deltaT = max(Tc - Td, 0.5);
|
const scalar deltaT = max(T - TBoil, 0.5);
|
||||||
const scalar deltaT = max(Tc - T, 0.5);
|
|
||||||
|
|
||||||
// liquid specific heat capacity
|
// vapour heat of formation
|
||||||
const scalar Cp = liquids_.properties()[lid].Cp(pc, Td);
|
|
||||||
|
|
||||||
// vapour heat of fomation
|
|
||||||
const scalar hv = liquids_.properties()[lid].hl(pc, Td);
|
const scalar hv = liquids_.properties()[lid].hl(pc, Td);
|
||||||
|
|
||||||
// Nusselt number
|
// empirical heat transfer coefficient W/m2/K
|
||||||
const scalar Nu = 2.0 + 0.6*sqrt(Re)*cbrt(Pr);
|
scalar alphaS = 0.0;
|
||||||
|
if (deltaT < 5.0)
|
||||||
|
{
|
||||||
|
alphaS = 760.0*pow(deltaT, 0.26);
|
||||||
|
}
|
||||||
|
else if (deltaT < 25.0)
|
||||||
|
{
|
||||||
|
alphaS = 27.0*pow(deltaT, 2.33);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
alphaS = 13800.0*pow(deltaT, 0.39);
|
||||||
|
}
|
||||||
|
|
||||||
const scalar lg = log(1.0 + Cp*deltaT/max(SMALL, hv));
|
// flash-boil vaporisation rate
|
||||||
|
const scalar Gf = alphaS*deltaT*pi*sqr(d)/hv;
|
||||||
|
|
||||||
// mass transfer [kg]
|
// model constants
|
||||||
dMassPC[lid] += pi*kappac*Nu*lg*d/Cp*dt;
|
// NOTE: using Sherwood number instead of Nusselt number
|
||||||
|
const scalar A = (Hc - Hsc)/hv;
|
||||||
|
const scalar B = pi*kappac/Cpc*d*Sh;
|
||||||
|
|
||||||
|
scalar G = 0.0;
|
||||||
|
if (A > 0.0)
|
||||||
|
{
|
||||||
|
// heat transfer from the surroundings contributes
|
||||||
|
// to the vaporisation process
|
||||||
|
scalar Gr = 1e-5;
|
||||||
|
|
||||||
|
for (label i=0; i<50; i++)
|
||||||
|
{
|
||||||
|
scalar GrDash = Gr;
|
||||||
|
|
||||||
|
G = B/(1.0 + Gr)*log(1.0 + A*(1.0 + Gr));
|
||||||
|
Gr = Gf/G;
|
||||||
|
|
||||||
|
if (mag(Gr - GrDash)/GrDash < 1e-3)
|
||||||
|
{
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
dMassPC[lid] += (G + Gf)*dt;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -226,23 +277,10 @@ void Foam::LiquidEvaporationBoil<CloudType>::calculate
|
|||||||
// molar ratio
|
// molar ratio
|
||||||
const scalar Xr = (Xs - Xc)/max(SMALL, 1.0 - Xs);
|
const scalar Xr = (Xs - Xc)/max(SMALL, 1.0 - Xs);
|
||||||
|
|
||||||
|
|
||||||
if (Xr > 0)
|
if (Xr > 0)
|
||||||
{
|
{
|
||||||
// vapour diffusivity [m2/s]
|
|
||||||
const scalar Dab = liquids_.properties()[lid].D(pc, Td);
|
|
||||||
|
|
||||||
// Schmidt number
|
|
||||||
const scalar Sc = nu/(Dab + ROOTVSMALL);
|
|
||||||
|
|
||||||
// Sherwood number
|
|
||||||
const scalar Sh = this->Sh(Re, Sc);
|
|
||||||
|
|
||||||
// mass transfer coefficient [m/s]
|
|
||||||
const scalar kc = Sh*Dab/(d + ROOTVSMALL);
|
|
||||||
|
|
||||||
// mass transfer [kg]
|
// mass transfer [kg]
|
||||||
dMassPC[lid] += pi*sqr(d)*kc*rhos*log(1.0 + Xr)*dt;
|
dMassPC[lid] += pi*d*Sh*Dab*rhos*log(1.0 + Xr)*dt;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -261,18 +299,24 @@ Foam::scalar Foam::LiquidEvaporationBoil<CloudType>::dh
|
|||||||
{
|
{
|
||||||
scalar dh = 0;
|
scalar dh = 0;
|
||||||
|
|
||||||
|
scalar TDash = T;
|
||||||
|
if (liquids_.properties()[idl].pv(p, T) >= 0.999*p)
|
||||||
|
{
|
||||||
|
TDash = liquids_.properties()[idl].pvInvert(p);
|
||||||
|
}
|
||||||
|
|
||||||
typedef PhaseChangeModel<CloudType> parent;
|
typedef PhaseChangeModel<CloudType> parent;
|
||||||
switch (parent::enthalpyTransfer_)
|
switch (parent::enthalpyTransfer_)
|
||||||
{
|
{
|
||||||
case (parent::etLatentHeat):
|
case (parent::etLatentHeat):
|
||||||
{
|
{
|
||||||
dh = liquids_.properties()[idl].hl(p, T);
|
dh = liquids_.properties()[idl].hl(p, TDash);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case (parent::etEnthalpyDifference):
|
case (parent::etEnthalpyDifference):
|
||||||
{
|
{
|
||||||
scalar hc = this->owner().composition().carrier().H(idc, T);
|
scalar hc = this->owner().composition().carrier().H(idc, TDash);
|
||||||
scalar hp = liquids_.properties()[idl].h(p, T);
|
scalar hp = liquids_.properties()[idl].h(p, TDash);
|
||||||
|
|
||||||
dh = hc - hp;
|
dh = hc - hp;
|
||||||
break;
|
break;
|
||||||
@ -287,7 +331,7 @@ Foam::scalar Foam::LiquidEvaporationBoil<CloudType>::dh
|
|||||||
"const label, "
|
"const label, "
|
||||||
"const label, "
|
"const label, "
|
||||||
"const label"
|
"const label"
|
||||||
")"
|
") const"
|
||||||
) << "Unknown enthalpyTransfer type" << abort(FatalError);
|
) << "Unknown enthalpyTransfer type" << abort(FatalError);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -27,7 +27,16 @@ Class
|
|||||||
Description
|
Description
|
||||||
Liquid evaporation model
|
Liquid evaporation model
|
||||||
- uses ideal gas assumption
|
- uses ideal gas assumption
|
||||||
- includes boiling model
|
- includes boiling model based on:
|
||||||
|
|
||||||
|
\verbatim
|
||||||
|
"Studies of Superheated Fuel Spray Structures and Vaporization in
|
||||||
|
GDI Engines"
|
||||||
|
|
||||||
|
Zuo, B., Gomes, A. M. and Rutland C. J.
|
||||||
|
|
||||||
|
International Journal of Engine Research, 2000, Vol. 1(4), pp. 321-336
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
|||||||
@ -59,6 +59,7 @@ solvers
|
|||||||
nCellsInCoarsestLevel 10;
|
nCellsInCoarsestLevel 10;
|
||||||
agglomerator faceAreaPair;
|
agglomerator faceAreaPair;
|
||||||
mergeLevels 1;
|
mergeLevels 1;
|
||||||
|
maxIter 20;
|
||||||
}
|
}
|
||||||
|
|
||||||
pFinal
|
pFinal
|
||||||
@ -66,7 +67,6 @@ solvers
|
|||||||
$p;
|
$p;
|
||||||
tolerance 1e-06;
|
tolerance 1e-06;
|
||||||
relTol 0;
|
relTol 0;
|
||||||
maxIter 20;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
"(Yi|O2|N2|H2O)"
|
"(Yi|O2|N2|H2O)"
|
||||||
|
|||||||
Reference in New Issue
Block a user