Commit 51bb18ce authored by henry's avatar henry
Browse files
parents 9bb3c1c1 0054d8d2
......@@ -13,6 +13,14 @@ PtrList<volScalarField>& Y = composition.Y();
word inertSpecie(thermo.lookup("inertSpecie"));
if (!composition.contains(inertSpecie))
{
FatalErrorIn(args.executable())
<< "Specified inert specie '" << inertSpecie << "' not found in "
<< "species list. Available species:" << composition.species()
<< exit(FatalError);
}
volScalarField rho
(
IOobject
......
......@@ -14,7 +14,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
label inertIndex = -1;
volScalarField Yt = 0.0*Y[0];
for (label i=0; i<Y.size(); i++)
forAll(Y, i)
{
if (Y[i].name() != inertSpecie)
{
......
......@@ -13,6 +13,14 @@
word inertSpecie(thermo.lookup("inertSpecie"));
if (!composition.contains(inertSpecie))
{
FatalErrorIn(args.executable())
<< "Specified inert specie '" << inertSpecie << "' not found in "
<< "species list. Available species:" << composition.species()
<< exit(FatalError);
}
volScalarField& p = thermo.p();
volScalarField& h = thermo.h();
const volScalarField& T = thermo.T();
......
......@@ -15,7 +15,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
label inertIndex = -1;
volScalarField Yt = 0.0*Y[0];
for (label i=0; i<Y.size(); i++)
forAll(Y, i)
{
if (Y[i].name() != inertSpecie)
{
......
......@@ -13,6 +13,14 @@
word inertSpecie(thermo.lookup("inertSpecie"));
if (!composition.contains(inertSpecie))
{
FatalErrorIn(args.executable())
<< "Specified inert specie '" << inertSpecie << "' not found in "
<< "species list. Available species:" << composition.species()
<< exit(FatalError);
}
volScalarField& p = thermo.p();
volScalarField& h = thermo.h();
const volScalarField& T = thermo.T();
......
......@@ -14,7 +14,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
label inertIndex = -1;
volScalarField Yt = 0.0*Y[0];
for (label i=0; i<Y.size(); i++)
forAll(Y, i)
{
if (Y[i].name() != inertSpecie)
{
......
......@@ -13,6 +13,14 @@
word inertSpecie(thermo.lookup("inertSpecie"));
if (!composition.contains(inertSpecie))
{
FatalErrorIn(args.executable())
<< "Specified inert specie '" << inertSpecie << "' not found in "
<< "species list. Available species:" << composition.species()
<< exit(FatalError);
}
volScalarField& p = thermo.p();
volScalarField& h = thermo.h();
const volScalarField& T = thermo.T();
......
......@@ -121,7 +121,7 @@ void Foam::ReactingParcel<ParcelType>::correctSurfaceValues
return;
}
// Far field gas molar fractions
// Far field carrier molar fractions
scalarField Xinf(Y_.size());
forAll(Xinf, i)
......@@ -135,7 +135,7 @@ void Foam::ReactingParcel<ParcelType>::correctSurfaceValues
// Molar fraction of far field species at particle surface
const scalar Xsff = 1.0 - min(sum(Cs)*specie::RR*this->T_/pc_, 1.0);
// Surface gas total molar concentration
// Surface carrier total molar concentration
const scalar CsTot = pc_/(specie::RR*this->T_);
// Surface carrier composition (molar fraction)
......@@ -171,10 +171,10 @@ void Foam::ReactingParcel<ParcelType>::correctSurfaceValues
cbrt(td.cloud().mcCarrierThermo().speciesData()[i].W());
rhos += Xs[i]*td.cloud().mcCarrierThermo().speciesData()[i].W();
cps += Xs[i]*td.cloud().mcCarrierThermo().speciesData()[i].Cp(T);
mus += Ys[i]*sqrtW*td.cloud().mcCarrierThermo().speciesData()[i].mu(T);
kappa +=
Ys[i]*cbrtW*td.cloud().mcCarrierThermo().speciesData()[i].kappa(T);
cps += Xs[i]*td.cloud().mcCarrierThermo().speciesData()[i].Cp(T);
sumYiSqrtW += Ys[i]*sqrtW;
sumYiCbrtW += Ys[i]*cbrtW;
......@@ -417,7 +417,7 @@ void Foam::ReactingParcel<ParcelType>::calcPhaseChange
const scalarField& YComponents,
scalarField& dMassPC,
scalar& Sh,
scalar& dhsTrans,
scalar& dhsTrans, // TODO: not used
scalar& N,
scalar& NCpW,
scalarField& Cs
......
......@@ -233,7 +233,7 @@ Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer
if (mag(htc) < ROOTVSMALL && !td.cloud().radiation())
{
return T + dt*Sh/(this->volume(d)*rho*cp);
return max(T + dt*Sh/(this->volume(d)*rho*cp), td.constProps().TMin());
}
const scalar As = this->areaS(d);
......@@ -256,9 +256,11 @@ Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer
IntegrationScheme<scalar>::integrationResult Tres =
td.cloud().TIntegrator().integrate(T, dt, ap, bp);
dhsTrans += dt*htc*As*(Tres.average() - Tc_);
scalar Tnew = max(Tres.value(), td.constProps().TMin());
return Tres.value();
dhsTrans += dt*htc*As*(0.5*(T + Tnew) - Tc_);
return Tnew;
}
......
......@@ -71,15 +71,12 @@ bool Foam::Rebound<CloudType>::correct
nw /= mag(nw);
scalar Un = U & nw;
vector Ut = U - Un*nw;
if (Un > 0.0)
{
U -= UFactor_*2.0*Un*nw;
}
U -= Ut;
return true;
}
......
......@@ -7,10 +7,10 @@ fieldMinMax/fieldMinMax.C
fieldMinMax/fieldMinMaxFunctionObject.C
fieldValues/fieldValue/fieldValue.C
fieldValues/face/faceSource.C
fieldValues/face/faceSourceFunctionObject.C
fieldValues/cell/cellSource.C
fieldValues/cell/cellSourceFunctionObject.C
fieldValues/faceSource/faceSource.C
fieldValues/faceSource/faceSourceFunctionObject.C
fieldValues/cellSource/cellSource.C
fieldValues/cellSource/cellSourceFunctionObject.C
streamLine/streamLine.C
streamLine/streamLineParticle.C
......
......@@ -50,10 +50,13 @@ namespace Foam
fieldValues::faceSource::sourceTypeNames_;
template<>
const char* NamedEnum<fieldValues::faceSource::operationType, 4>::
names[] = {"none", "sum", "areaAverage", "areaIntegrate"};
const char* NamedEnum<fieldValues::faceSource::operationType, 5>::
names[] =
{
"none", "sum", "areaAverage", "areaIntegrate", "weightedAverage"
};
const NamedEnum<fieldValues::faceSource::operationType, 4>
const NamedEnum<fieldValues::faceSource::operationType, 5>
fieldValues::faceSource::operationTypeNames_;
}
......@@ -68,7 +71,9 @@ void Foam::fieldValues::faceSource::setFaceZoneFaces()
if (zoneId < 0)
{
FatalErrorIn("faceSource::faceSource::setFaceZoneFaces()")
<< "Unknown face zone name: " << sourceName_
<< type() << " " << name_ << ": "
<< sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl
<< " Unknown face zone name: " << sourceName_
<< ". Valid face zones are: " << mesh().faceZones().names()
<< nl << exit(FatalError);
}
......@@ -164,7 +169,9 @@ void Foam::fieldValues::faceSource::setPatchFaces()
if (patchId < 0)
{
FatalErrorIn("faceSource::constructFaceAddressing()")
<< "Unknown patch name: " << sourceName_
<< type() << " " << name_ << ": "
<< sourceTypeNames_[source_] << "(" << sourceName_ << "):" << nl
<< " Unknown patch name: " << sourceName_
<< ". Valid patch names are: "
<< mesh().boundaryMesh().names() << nl
<< exit(FatalError);
......@@ -197,7 +204,7 @@ void Foam::fieldValues::faceSource::setPatchFaces()
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
void Foam::fieldValues::faceSource::initialise()
void Foam::fieldValues::faceSource::initialise(const dictionary& dict)
{
switch (source_)
{
......@@ -214,15 +221,40 @@ void Foam::fieldValues::faceSource::initialise()
default:
{
FatalErrorIn("faceSource::constructFaceAddressing()")
<< "Unknown source type. Valid source types are:"
<< type() << " " << name_ << ": "
<< sourceTypeNames_[source_] << "(" << sourceName_ << "):"
<< nl << " Unknown source type. Valid source types are:"
<< sourceTypeNames_ << nl << exit(FatalError);
}
}
Info<< type() << " " << name_ << ":" << nl
<< " total faces = " << faceId_.size() << nl
<< " total area = " << sum(filterField(mesh().magSf()))
<< nl << endl;
<< " total faces = " << faceId_.size() << nl
<< " total area = " << sum(filterField(mesh().magSf())) << nl;
if (operation_ == opWeightedAverage)
{
dict.lookup("weightField") >> weightFieldName_;
if
(
obr().foundObject<volScalarField>(weightFieldName_)
|| obr().foundObject<surfaceScalarField>(weightFieldName_)
)
{
Info<< " weight field = " << weightFieldName_;
}
else
{
FatalErrorIn("faceSource::constructFaceAddressing()")
<< type() << " " << name_ << ": "
<< sourceTypeNames_[source_] << "(" << sourceName_ << "):"
<< nl << " Weight field " << weightFieldName_
<< " must be either a " << volScalarField::typeName << " or "
<< surfaceScalarField::typeName << nl << exit(FatalError);
}
}
Info<< nl << endl;
}
......@@ -302,12 +334,13 @@ Foam::fieldValues::faceSource::faceSource
faceId_(),
facePatchId_(),
flipMap_(),
outputFilePtr_(NULL)
outputFilePtr_(NULL),
weightFieldName_("undefinedWeightedFieldName")
{
initialise();
if (active_)
{
initialise(dict);
// Create the output file if not already created
makeFile();
}
......@@ -327,7 +360,7 @@ void Foam::fieldValues::faceSource::read(const dictionary& dict)
if (active_)
{
fieldValue::read(dict);
initialise();
initialise(dict);
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment