ENH: Updated cloud sources for steady analyses

This commit is contained in:
andy
2010-10-25 12:10:13 +01:00
parent 53c46ba574
commit a434750722
3 changed files with 85 additions and 14 deletions

View File

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

View File

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

View File

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