Commit a4347507 authored by Andrew Heather's avatar Andrew Heather
Browse files

ENH: Updated cloud sources for steady analyses

parent 53c46ba5
......@@ -423,20 +423,23 @@ Foam::KinematicCloud<ParcelType>::SU() const
this->db().time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::AUTO_WRITE
IOobject::NO_WRITE
),
this->mesh(),
dimensionedVector
(
"zero",
dimDensity*dimVelocity/dimTime,
vector::zero
"zero",
dimDensity*dimVelocity/dimTime,
vector::zero
)
)
);
vectorField& SU = tSU().field();
SU = UTrans()/(mesh_.V()*this->db().time().deltaT());
if (solution_.sourceActive())
{
vectorField& SU = tSU().field();
SU = UTrans()/(mesh_.V()*this->db().time().deltaT());
}
return tSU;
}
......
......@@ -69,7 +69,61 @@ template<class ParcelType>
inline Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
Foam::ReactingCloud<ParcelType>::Srho(const label i) const
{
return rhoTrans_[i]/(this->db().time().deltaT()*this->mesh().V());
tmp<volScalarField> tRhoi
(
new volScalarField
(
IOobject
(
this->name() + "rhoTrans",
this->db().time().timeName(),
this->db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh(),
dimensionedScalar
(
"zero",
rhoTrans_[0].dimensions()/dimTime/dimVolume,
0.0
)
)
);
if (this->solution().sourceActive())
{
scalarField& rhoi = tRhoi().internalField();
rhoi = rhoTrans_[i]/(this->db().time().deltaT()*this->mesh().V());
return tRhoi;
}
else
{
return tmp<volScalarField>
(
new volScalarField
(
IOobject
(
this->name() + "rhoTrans",
this->db().time().timeName(),
this->db(),
IOobject::NO_READ,
IOobject::NO_WRITE,
false
),
this->mesh(),
dimensionedScalar
(
"zero",
rhoTrans_[0].dimensions()/dimTime/dimVolume,
0.0
)
)
);
}
}
......@@ -95,13 +149,20 @@ Foam::ReactingCloud<ParcelType>::Srho() const
)
);
scalarField& sourceField = trhoTrans().field();
forAll(rhoTrans_, i)
if (this->solution().sourceActive())
{
sourceField += rhoTrans_[i];
}
scalarField& sourceField = trhoTrans().field();
forAll(rhoTrans_, i)
{
sourceField += rhoTrans_[i];
}
return trhoTrans/(this->db().time().deltaT()*this->mesh().V());
return trhoTrans/(this->db().time().deltaT()*this->mesh().V());
}
else
{
return trhoTrans;
}
}
......
......@@ -111,13 +111,20 @@ Foam::ThermoCloud<ParcelType>::Sh() const
this->db().time().timeName(),
this->mesh(),
IOobject::NO_READ,
IOobject::AUTO_WRITE,
IOobject::NO_WRITE,
false
),
hsTrans_()/(this->mesh().V()*this->db().time().deltaT())
this->mesh(),
dimensionedScalar("zero", dimEnergy/dimVolume/dimTime, 0.0)
)
);
if (this->solution().sourceActive())
{
scalarField& Sh = tSh();
Sh = hsTrans_()/(this->mesh().V()*this->db().time().deltaT());
}
return tSh;
}
......
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