mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: multiple minor updates to cloud sub-models
This commit is contained in:
@ -122,7 +122,7 @@ public:
|
||||
friend Ostream& operator<< <Type>
|
||||
(
|
||||
Ostream&,
|
||||
const Constant<Type>&
|
||||
const Table<Type>&
|
||||
);
|
||||
};
|
||||
|
||||
|
||||
@ -65,10 +65,13 @@ Foam::polynomial::~polynomial()
|
||||
|
||||
Foam::scalar Foam::polynomial::value(const scalar x) const
|
||||
{
|
||||
scalar y = 0.0;
|
||||
forAll(coeffs_, i)
|
||||
scalar y = coeffs_[0].first();
|
||||
scalar powX = x;
|
||||
|
||||
for (label i = 1; i < coeffs_.size(); i++)
|
||||
{
|
||||
y += coeffs_[i].first()*pow(x, coeffs_[i].second());
|
||||
y += coeffs_[i].first()*powX;
|
||||
powX *= x;
|
||||
}
|
||||
|
||||
return y;
|
||||
|
||||
@ -42,7 +42,7 @@ Foam::DispersionModel<CloudType>::DispersionModel
|
||||
const word& type
|
||||
)
|
||||
:
|
||||
SubModelBase<CloudType>(dict, owner, type)
|
||||
SubModelBase<CloudType>(owner, dict, type)
|
||||
{}
|
||||
|
||||
|
||||
|
||||
@ -76,13 +76,6 @@ public:
|
||||
//- Construct null from owner
|
||||
DispersionModel(CloudType& owner);
|
||||
|
||||
//- Construct from components
|
||||
DispersionModel
|
||||
(
|
||||
const dictionary& dict,
|
||||
CloudType& owner
|
||||
);
|
||||
|
||||
//- Construct from components
|
||||
DispersionModel
|
||||
(
|
||||
|
||||
@ -52,7 +52,7 @@ class GradientDispersionRAS
|
||||
{
|
||||
protected:
|
||||
|
||||
// Locally cached turbulence fields
|
||||
// Protected data
|
||||
|
||||
// Locally cached turbulence fields
|
||||
|
||||
|
||||
@ -26,6 +26,7 @@ License
|
||||
#include "ConeInjection.H"
|
||||
#include "DataEntry.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
using namespace Foam::constant::mathematical;
|
||||
|
||||
@ -204,15 +205,11 @@ void Foam::ConeInjection<CloudType>::setProperties
|
||||
{
|
||||
cachedRandom& rnd = this->owner().rndGen();
|
||||
|
||||
// set particle velocity
|
||||
const scalar deg2Rad = pi/180.0;
|
||||
|
||||
scalar t = time - this->SOI_;
|
||||
scalar ti = thetaInner_().value(t);
|
||||
scalar to = thetaOuter_().value(t);
|
||||
scalar coneAngle = deg2Rad*rnd.position<scalar>(ti, to);
|
||||
scalar coneAngle = degToRad(rnd.position<scalar>(ti, to));
|
||||
|
||||
coneAngle *= deg2Rad;
|
||||
scalar alpha = sin(coneAngle);
|
||||
scalar dcorr = cos(coneAngle);
|
||||
scalar beta = twoPi*rnd.sample01<scalar>();
|
||||
|
||||
@ -26,6 +26,7 @@ License
|
||||
#include "ConeInjectionMP.H"
|
||||
#include "DataEntry.H"
|
||||
#include "mathematicalConstants.H"
|
||||
#include "unitConversion.H"
|
||||
|
||||
using namespace Foam::constant::mathematical;
|
||||
|
||||
@ -250,14 +251,11 @@ void Foam::ConeInjectionMP<CloudType>::setProperties
|
||||
// set particle velocity
|
||||
const label i = parcelI%positions_.size();
|
||||
|
||||
const scalar deg2Rad = pi/180.0;
|
||||
|
||||
scalar t = time - this->SOI_;
|
||||
scalar ti = thetaInner_().value(t);
|
||||
scalar to = thetaOuter_().value(t);
|
||||
scalar coneAngle = deg2Rad*rnd.position<scalar>(ti, to);
|
||||
scalar coneAngle = degToRad(rnd.position<scalar>(ti, to));
|
||||
|
||||
coneAngle *= deg2Rad;
|
||||
scalar alpha = sin(coneAngle);
|
||||
scalar dcorr = cos(coneAngle);
|
||||
scalar beta = twoPi*rnd.sample01<scalar>();
|
||||
|
||||
@ -53,11 +53,7 @@ Foam::scalar Foam::NoInjection<CloudType>::volumeToInject
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class CloudType>
|
||||
Foam::NoInjection<CloudType>::NoInjection
|
||||
(
|
||||
const dictionary&,
|
||||
CloudType& owner
|
||||
)
|
||||
Foam::NoInjection<CloudType>::NoInjection(const dictionary&, CloudType& owner)
|
||||
:
|
||||
InjectionModel<CloudType>(owner)
|
||||
{}
|
||||
|
||||
@ -62,7 +62,6 @@ public:
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from dictionary
|
||||
//- Construct from dictionary
|
||||
Rebound(const dictionary& dict, CloudType& cloud);
|
||||
|
||||
|
||||
@ -8,10 +8,10 @@
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
OpenFOAM is 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
|
||||
@ -19,8 +19,7 @@ License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -8,10 +8,10 @@
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
OpenFOAM is 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
|
||||
@ -19,8 +19,7 @@ License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::NoComposition
|
||||
|
||||
@ -88,22 +88,27 @@ Foam::LiquidEvaporation<CloudType>::LiquidEvaporation
|
||||
) << "Evaporation model selected, but no active liquids defined"
|
||||
<< nl << endl;
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Participating liquid species:" << endl;
|
||||
|
||||
// Determine mapping between liquid and carrier phase species
|
||||
forAll(activeLiquids_, i)
|
||||
{
|
||||
Info<< " " << activeLiquids_[i] << endl;
|
||||
liqToCarrierMap_[i] =
|
||||
owner.composition().globalCarrierId(activeLiquids_[i]);
|
||||
}
|
||||
|
||||
// Determine mapping between model active liquids and global liquids
|
||||
label idLiquid = owner.composition().idLiquid();
|
||||
const label idLiquid = owner.composition().idLiquid();
|
||||
forAll(activeLiquids_, i)
|
||||
{
|
||||
liqToLiqMap_[i] =
|
||||
owner.composition().localId(idLiquid, activeLiquids_[i]);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
@ -144,19 +149,19 @@ void Foam::LiquidEvaporation<CloudType>::calculate
|
||||
) const
|
||||
{
|
||||
// construct carrier phase species volume fractions for cell, cellI
|
||||
scalarField Xc = calcXc(cellI);
|
||||
const scalarField Xc = calcXc(cellI);
|
||||
|
||||
// droplet surface area
|
||||
scalar A = pi*sqr(d);
|
||||
const scalar A = pi*sqr(d);
|
||||
|
||||
// calculate mass transfer of each specie in liquid
|
||||
forAll(activeLiquids_, i)
|
||||
{
|
||||
label gid = liqToCarrierMap_[i];
|
||||
label lid = liqToLiqMap_[i];
|
||||
const label gid = liqToCarrierMap_[i];
|
||||
const label lid = liqToLiqMap_[i];
|
||||
|
||||
// vapour diffusivity [m2/s]
|
||||
scalar Dab = liquids_.properties()[lid].D(pc, Ts);
|
||||
const scalar Dab = liquids_.properties()[lid].D(pc, Ts);
|
||||
|
||||
// saturation pressure for species i [pa]
|
||||
// - carrier phase pressure assumed equal to the liquid vapour pressure
|
||||
@ -164,25 +169,25 @@ void Foam::LiquidEvaporation<CloudType>::calculate
|
||||
// NOTE: if pSat > pc then particle is superheated
|
||||
// calculated evaporation rate will be greater than that of a particle
|
||||
// at boiling point, but this is not a boiling model
|
||||
scalar pSat = liquids_.properties()[lid].pv(pc, T);
|
||||
const scalar pSat = liquids_.properties()[lid].pv(pc, T);
|
||||
|
||||
// Schmidt number
|
||||
scalar Sc = nu/(Dab + ROOTVSMALL);
|
||||
const scalar Sc = nu/(Dab + ROOTVSMALL);
|
||||
|
||||
// Sherwood number
|
||||
scalar Sh = this->Sh(Re, Sc);
|
||||
const scalar Sh = this->Sh(Re, Sc);
|
||||
|
||||
// mass transfer coefficient [m/s]
|
||||
scalar kc = Sh*Dab/(d + ROOTVSMALL);
|
||||
const scalar kc = Sh*Dab/(d + ROOTVSMALL);
|
||||
|
||||
// vapour concentration at droplet surface [kmol/m3] at film temperature
|
||||
scalar Cs = pSat/(specie::RR*Ts);
|
||||
const scalar Cs = pSat/(specie::RR*Ts);
|
||||
|
||||
// vapour concentration in bulk gas [kmol/m3] at film temperature
|
||||
scalar Cinf = Xc[gid]*pc/(specie::RR*Ts);
|
||||
const scalar Cinf = Xc[gid]*pc/(specie::RR*Ts);
|
||||
|
||||
// molar flux of vapour [kmol/m2/s]
|
||||
scalar Ni = max(kc*(Cs - Cinf), 0.0);
|
||||
const scalar Ni = max(kc*(Cs - Cinf), 0.0);
|
||||
|
||||
// mass transfer [kg]
|
||||
dMassPC[lid] += Ni*A*liquids_.properties()[lid].W()*dt;
|
||||
|
||||
@ -8,10 +8,10 @@
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
OpenFOAM is 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
|
||||
@ -19,8 +19,7 @@ License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -8,10 +8,10 @@
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
OpenFOAM is 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
|
||||
@ -19,8 +19,7 @@ License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
@ -8,10 +8,10 @@
|
||||
License
|
||||
This file is part of OpenFOAM.
|
||||
|
||||
OpenFOAM is free software; you can redistribute it and/or modify it
|
||||
under the terms of the GNU General Public License as published by the
|
||||
Free Software Foundation; either version 2 of the License, or (at your
|
||||
option) any later version.
|
||||
OpenFOAM is 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
|
||||
@ -19,8 +19,7 @@ License
|
||||
for more details.
|
||||
|
||||
You should have received a copy of the GNU General Public License
|
||||
along with OpenFOAM; if not, write to the Free Software Foundation,
|
||||
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
|
||||
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
|
||||
|
||||
Class
|
||||
Foam::SingleKineticRateDevolatilisation
|
||||
|
||||
Reference in New Issue
Block a user