code tidying
This commit is contained in:
parent
91675bd616
commit
aae0345283
@ -26,6 +26,8 @@ License
|
|||||||
|
|
||||||
#include "physicoChemicalConstants.H"
|
#include "physicoChemicalConstants.H"
|
||||||
|
|
||||||
|
using namespace Foam::constant;
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class ParcelType>
|
template<class ParcelType>
|
||||||
@ -229,7 +231,7 @@ Foam::ThermoCloud<ParcelType>::Ep() const
|
|||||||
Ep[cellI] += p.nParticle()*p.areaP()*pow4(p.T());
|
Ep[cellI] += p.nParticle()*p.areaP()*pow4(p.T());
|
||||||
}
|
}
|
||||||
|
|
||||||
Ep *= epsilon*constant::physicoChemical::sigma.value()/V;
|
Ep *= epsilon*physicoChemical::sigma.value()/V;
|
||||||
}
|
}
|
||||||
|
|
||||||
return tEp;
|
return tEp;
|
||||||
|
@ -102,7 +102,7 @@ void Foam::KinematicParcel<ParcelType>::calc
|
|||||||
const scalar mass0 = mass();
|
const scalar mass0 = mass();
|
||||||
|
|
||||||
// Reynolds number
|
// Reynolds number
|
||||||
const scalar Re = this->Re(U0, d0, muc_);
|
const scalar Re = this->Re(U0, d0, rhoc_, muc_);
|
||||||
|
|
||||||
|
|
||||||
// Sources
|
// Sources
|
||||||
|
@ -389,12 +389,13 @@ public:
|
|||||||
//- Surface area for given diameter
|
//- Surface area for given diameter
|
||||||
inline scalar areaS(const scalar d) const;
|
inline scalar areaS(const scalar d) const;
|
||||||
|
|
||||||
//- Reynolds number - particle properties input
|
//- Reynolds number
|
||||||
inline scalar Re
|
inline scalar Re
|
||||||
(
|
(
|
||||||
const vector& U,
|
const vector& U, // particle velocity
|
||||||
const scalar d,
|
const scalar d, // particle diameter
|
||||||
const scalar mu
|
const scalar rhoc, // carrier density
|
||||||
|
const scalar muc // carrier dynamic viscosity
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
||||||
|
@ -26,6 +26,8 @@ License
|
|||||||
|
|
||||||
#include "mathConstants.H"
|
#include "mathConstants.H"
|
||||||
|
|
||||||
|
using namespace Foam::constant;
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template <class ParcelType>
|
template <class ParcelType>
|
||||||
@ -351,7 +353,7 @@ template <class ParcelType>
|
|||||||
inline Foam::scalar
|
inline Foam::scalar
|
||||||
Foam::KinematicParcel<ParcelType>::volume(const scalar d) const
|
Foam::KinematicParcel<ParcelType>::volume(const scalar d) const
|
||||||
{
|
{
|
||||||
return constant::math::pi/6.0*pow3(d);
|
return math::pi/6.0*pow3(d);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -381,7 +383,7 @@ template <class ParcelType>
|
|||||||
inline Foam::scalar
|
inline Foam::scalar
|
||||||
Foam::KinematicParcel<ParcelType>::areaS(const scalar d) const
|
Foam::KinematicParcel<ParcelType>::areaS(const scalar d) const
|
||||||
{
|
{
|
||||||
return constant::math::pi*d*d;
|
return math::pi*d*d;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -391,10 +393,11 @@ Foam::KinematicParcel<ParcelType>::Re
|
|||||||
(
|
(
|
||||||
const vector& U,
|
const vector& U,
|
||||||
const scalar d,
|
const scalar d,
|
||||||
const scalar mu
|
const scalar rhoc,
|
||||||
|
const scalar muc
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return rhoc_*mag(U - Uc_)*d/mu;
|
return rhoc*mag(U - Uc_)*d/muc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -27,6 +27,8 @@ License
|
|||||||
#include "ReactingMultiphaseParcel.H"
|
#include "ReactingMultiphaseParcel.H"
|
||||||
#include "mathConstants.H"
|
#include "mathConstants.H"
|
||||||
|
|
||||||
|
using namespace Foam::constant;
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class ParcelType>
|
template<class ParcelType>
|
||||||
@ -214,7 +216,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
|
|||||||
calcSurfaceValues(td, cellI, T0, Ts, rhos, mus, Pr, kappa);
|
calcSurfaceValues(td, cellI, T0, Ts, rhos, mus, Pr, kappa);
|
||||||
|
|
||||||
// Reynolds number
|
// Reynolds number
|
||||||
scalar Re = this->Re(U0, d0, mus);
|
scalar Re = this->Re(U0, d0, rhos, mus);
|
||||||
|
|
||||||
|
|
||||||
// Sources
|
// Sources
|
||||||
@ -495,7 +497,7 @@ void Foam::ReactingMultiphaseParcel<ParcelType>::calc
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
this->d_ = cbrt(mass1/this->rho_*6.0/constant::math::pi);
|
this->d_ = cbrt(mass1/this->rho_*6.0/math::pi);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -159,7 +159,7 @@ void Foam::ReactingParcel<ParcelType>::correctSurfaceValues
|
|||||||
rhos = 0;
|
rhos = 0;
|
||||||
mus = 0;
|
mus = 0;
|
||||||
kappa = 0;
|
kappa = 0;
|
||||||
scalar cps = 0.0;
|
scalar cps = 0;
|
||||||
scalar sumYiSqrtW = 0;
|
scalar sumYiSqrtW = 0;
|
||||||
scalar sumYiCbrtW = 0;
|
scalar sumYiCbrtW = 0;
|
||||||
|
|
||||||
@ -233,11 +233,10 @@ void Foam::ReactingParcel<ParcelType>::calc
|
|||||||
// Calc surface values
|
// Calc surface values
|
||||||
// ~~~~~~~~~~~~~~~~~~~
|
// ~~~~~~~~~~~~~~~~~~~
|
||||||
scalar Ts, rhos, mus, Pr, kappa;
|
scalar Ts, rhos, mus, Pr, kappa;
|
||||||
ThermoParcel<ParcelType>::
|
this->calcSurfaceValues(td, cellI, T0, Ts, rhos, mus, Pr, kappa);
|
||||||
calcSurfaceValues(td, cellI, T0, Ts, rhos, mus, Pr, kappa);
|
|
||||||
|
|
||||||
// Reynolds number
|
// Reynolds number
|
||||||
scalar Re = this->Re(U0, d0, mus);
|
scalar Re = this->Re(U0, d0, rhos, mus);
|
||||||
|
|
||||||
|
|
||||||
// Sources
|
// Sources
|
||||||
|
@ -133,7 +133,7 @@ void Foam::ThermoParcel<ParcelType>::calc
|
|||||||
calcSurfaceValues(td, cellI, T0, Ts, rhos, mus, Pr, kappa);
|
calcSurfaceValues(td, cellI, T0, Ts, rhos, mus, Pr, kappa);
|
||||||
|
|
||||||
// Reynolds number
|
// Reynolds number
|
||||||
scalar Re = this->Re(U0, d0, mus);
|
scalar Re = this->Re(U0, d0, rhos, mus);
|
||||||
|
|
||||||
|
|
||||||
// Sources
|
// Sources
|
||||||
@ -231,37 +231,26 @@ Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer
|
|||||||
// Calc heat transfer coefficient
|
// Calc heat transfer coefficient
|
||||||
scalar htc = td.cloud().heatTransfer().htc(d, Re, Pr, kappa, NCpW);
|
scalar htc = td.cloud().heatTransfer().htc(d, Re, Pr, kappa, NCpW);
|
||||||
|
|
||||||
const scalar As = this->areaS(d);
|
|
||||||
|
|
||||||
if (mag(htc) < ROOTVSMALL && !td.cloud().radiation())
|
if (mag(htc) < ROOTVSMALL && !td.cloud().radiation())
|
||||||
{
|
{
|
||||||
return T + dt*Sh/(this->volume(d)*rho*cp);
|
return T + dt*Sh/(this->volume(d)*rho*cp);
|
||||||
}
|
}
|
||||||
|
|
||||||
scalar ap;
|
const scalar As = this->areaS(d);
|
||||||
scalar bp;
|
scalar ap = Tc_ + Sh/As/htc;
|
||||||
|
scalar bp = 6.0*(Sh/As + htc*(Tc_ - T));
|
||||||
if (td.cloud().radiation())
|
if (td.cloud().radiation())
|
||||||
{
|
{
|
||||||
const scalarField& G =
|
const scalarField& G =
|
||||||
td.cloud().mesh().objectRegistry::lookupObject<volScalarField>("G");
|
td.cloud().mesh().objectRegistry::lookupObject<volScalarField>("G");
|
||||||
|
const scalar Gc = G[cellI];
|
||||||
const scalar sigma = physicoChemical::sigma.value();
|
const scalar sigma = physicoChemical::sigma.value();
|
||||||
const scalar epsilon = td.constProps().epsilon0();
|
const scalar epsilon = td.constProps().epsilon0();
|
||||||
|
|
||||||
ap =
|
ap = (ap + epsilon*Gc/(4.0*htc))/(1.0 + epsilon*sigma*pow3(T)/htc);
|
||||||
(Sh/As + htc*Tc_ + epsilon*G[cellI]/4.0)
|
bp += 6.0*(epsilon*(Gc/4.0 - sigma*pow4(T)));
|
||||||
/(htc + epsilon*sigma*pow3(T));
|
|
||||||
|
|
||||||
bp =
|
|
||||||
6.0
|
|
||||||
*(Sh/As + htc*(Tc_ - T) + epsilon*(G[cellI]/4.0 - sigma*pow4(T)))
|
|
||||||
/(rho*d*cp*(ap - T));
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
ap = Tc_ + Sh/As/htc;
|
|
||||||
bp = 6.0*(Sh/As + htc*(Tc_ - T))/(rho*d*cp*(ap - T));
|
|
||||||
}
|
}
|
||||||
|
bp /= rho*d*cp*(ap - T);
|
||||||
|
|
||||||
// Integrate to find the new parcel temperature
|
// Integrate to find the new parcel temperature
|
||||||
IntegrationScheme<scalar>::integrationResult Tres =
|
IntegrationScheme<scalar>::integrationResult Tres =
|
||||||
|
@ -28,6 +28,8 @@ License
|
|||||||
#include "DataEntry.H"
|
#include "DataEntry.H"
|
||||||
#include "mathConstants.H"
|
#include "mathConstants.H"
|
||||||
|
|
||||||
|
using namespace Foam::constant;
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
@ -201,7 +203,7 @@ void Foam::ConeInjection<CloudType>::setProperties
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
// set particle velocity
|
// set particle velocity
|
||||||
const scalar deg2Rad = constant::math::pi/180.0;
|
const scalar deg2Rad = math::pi/180.0;
|
||||||
|
|
||||||
scalar t = time - this->SOI_;
|
scalar t = time - this->SOI_;
|
||||||
scalar ti = thetaInner_().value(t);
|
scalar ti = thetaInner_().value(t);
|
||||||
@ -211,7 +213,7 @@ void Foam::ConeInjection<CloudType>::setProperties
|
|||||||
coneAngle *= deg2Rad;
|
coneAngle *= deg2Rad;
|
||||||
scalar alpha = sin(coneAngle);
|
scalar alpha = sin(coneAngle);
|
||||||
scalar dcorr = cos(coneAngle);
|
scalar dcorr = cos(coneAngle);
|
||||||
scalar beta = constant::math::twoPi*this->owner().rndGen().scalar01();
|
scalar beta = math::twoPi*this->owner().rndGen().scalar01();
|
||||||
|
|
||||||
vector normal = alpha*(tanVec1_*cos(beta) + tanVec2_*sin(beta));
|
vector normal = alpha*(tanVec1_*cos(beta) + tanVec2_*sin(beta));
|
||||||
vector dirVec = dcorr*direction_;
|
vector dirVec = dcorr*direction_;
|
||||||
|
@ -28,6 +28,8 @@ License
|
|||||||
#include "DataEntry.H"
|
#include "DataEntry.H"
|
||||||
#include "mathConstants.H"
|
#include "mathConstants.H"
|
||||||
|
|
||||||
|
using namespace Foam::constant;
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
@ -247,7 +249,7 @@ void Foam::ConeInjectionMP<CloudType>::setProperties
|
|||||||
// set particle velocity
|
// set particle velocity
|
||||||
const label i = parcelI%positions_.size();
|
const label i = parcelI%positions_.size();
|
||||||
|
|
||||||
const scalar deg2Rad = constant::math::pi/180.0;
|
const scalar deg2Rad = math::pi/180.0;
|
||||||
|
|
||||||
scalar t = time - this->SOI_;
|
scalar t = time - this->SOI_;
|
||||||
scalar ti = thetaInner_().value(t);
|
scalar ti = thetaInner_().value(t);
|
||||||
@ -257,7 +259,7 @@ void Foam::ConeInjectionMP<CloudType>::setProperties
|
|||||||
coneAngle *= deg2Rad;
|
coneAngle *= deg2Rad;
|
||||||
scalar alpha = sin(coneAngle);
|
scalar alpha = sin(coneAngle);
|
||||||
scalar dcorr = cos(coneAngle);
|
scalar dcorr = cos(coneAngle);
|
||||||
scalar beta = constant::math::twoPi*this->owner().rndGen().scalar01();
|
scalar beta = math::twoPi*this->owner().rndGen().scalar01();
|
||||||
|
|
||||||
vector normal = alpha*(tanVec1_[i]*cos(beta) + tanVec2_[i]*sin(beta));
|
vector normal = alpha*(tanVec1_[i]*cos(beta) + tanVec2_[i]*sin(beta));
|
||||||
vector dirVec = dcorr*axes_[i];
|
vector dirVec = dcorr*axes_[i];
|
||||||
|
@ -28,6 +28,8 @@ License
|
|||||||
#include "volFields.H"
|
#include "volFields.H"
|
||||||
#include "mathConstants.H"
|
#include "mathConstants.H"
|
||||||
|
|
||||||
|
using namespace Foam::constant;
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
@ -128,9 +130,7 @@ Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection
|
|||||||
|
|
||||||
// Determine total volume of particles to inject
|
// Determine total volume of particles to inject
|
||||||
this->volumeTotal_ =
|
this->volumeTotal_ =
|
||||||
nParcelsPerInjector_
|
nParcelsPerInjector_*sum(pow3(diameters_))*math::pi/6.0;
|
||||||
*sum(pow3(diameters_))
|
|
||||||
*constant::math::pi/6.0;
|
|
||||||
|
|
||||||
// Set/cache the injector cells
|
// Set/cache the injector cells
|
||||||
forAll(positions_, i)
|
forAll(positions_, i)
|
||||||
|
@ -28,6 +28,8 @@ License
|
|||||||
#include "mathConstants.H"
|
#include "mathConstants.H"
|
||||||
#include "meshTools.H"
|
#include "meshTools.H"
|
||||||
|
|
||||||
|
using namespace Foam::constant;
|
||||||
|
|
||||||
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
|
// * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
@ -195,9 +197,10 @@ Foam::scalar Foam::InjectionModel<CloudType>::setNumberOfParticles
|
|||||||
{
|
{
|
||||||
case pbMass:
|
case pbMass:
|
||||||
{
|
{
|
||||||
nP = volume/volumeTotal_
|
nP =
|
||||||
|
volume/volumeTotal_
|
||||||
*massTotal_/rho
|
*massTotal_/rho
|
||||||
/(parcels*constant::math::pi/6.0*pow3(diameter));
|
/(parcels*math::pi/6.0*pow3(diameter));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case pbNumber:
|
case pbNumber:
|
||||||
|
@ -27,6 +27,8 @@ License
|
|||||||
#include "ManualInjection.H"
|
#include "ManualInjection.H"
|
||||||
#include "mathConstants.H"
|
#include "mathConstants.H"
|
||||||
|
|
||||||
|
using namespace Foam::constant;
|
||||||
|
|
||||||
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
@ -106,7 +108,7 @@ Foam::ManualInjection<CloudType>::ManualInjection
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Determine volume of particles to inject
|
// Determine volume of particles to inject
|
||||||
this->volumeTotal_ = sum(pow3(diameters_))*constant::math::pi/6.0;
|
this->volumeTotal_ = sum(pow3(diameters_))*math::pi/6.0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -28,6 +28,8 @@ License
|
|||||||
#include "specie.H"
|
#include "specie.H"
|
||||||
#include "mathConstants.H"
|
#include "mathConstants.H"
|
||||||
|
|
||||||
|
using namespace Foam::constant;
|
||||||
|
|
||||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class CloudType>
|
template<class CloudType>
|
||||||
@ -148,7 +150,7 @@ void Foam::LiquidEvaporation<CloudType>::calculate
|
|||||||
scalarField Xc = calcXc(cellI);
|
scalarField Xc = calcXc(cellI);
|
||||||
|
|
||||||
// droplet surface area
|
// droplet surface area
|
||||||
scalar A = constant::math::pi*sqr(d);
|
scalar A = math::pi*sqr(d);
|
||||||
|
|
||||||
// calculate mass transfer of each specie in liquid
|
// calculate mass transfer of each specie in liquid
|
||||||
forAll(activeLiquids_, i)
|
forAll(activeLiquids_, i)
|
||||||
|
Loading…
Reference in New Issue
Block a user