ENH: multiple minor updates to cloud sub-models

This commit is contained in:
andy
2010-10-21 17:30:41 +01:00
parent 29ab2ef2d3
commit b3c82b633c
41 changed files with 177 additions and 191 deletions

View File

@ -122,7 +122,7 @@ public:
friend Ostream& operator<< <Type>
(
Ostream&,
const Constant<Type>&
const Table<Type>&
);
};

View File

@ -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;

View File

@ -42,7 +42,7 @@ Foam::DispersionModel<CloudType>::DispersionModel
const word& type
)
:
SubModelBase<CloudType>(dict, owner, type)
SubModelBase<CloudType>(owner, dict, type)
{}

View File

@ -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
(

View File

@ -52,7 +52,7 @@ class GradientDispersionRAS
{
protected:
// Locally cached turbulence fields
// Protected data
// Locally cached turbulence fields

View File

@ -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>();

View File

@ -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>();

View File

@ -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)
{}

View File

@ -62,7 +62,6 @@ public:
// Constructors
//- Construct from dictionary
//- Construct from dictionary
Rebound(const dictionary& dict, CloudType& cloud);

View File

@ -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/>.
\*---------------------------------------------------------------------------*/

View File

@ -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

View File

@ -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;

View File

@ -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/>.
\*---------------------------------------------------------------------------*/

View File

@ -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/>.
\*---------------------------------------------------------------------------*/

View File

@ -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