ENH: further updates to semi-implicit cloud source calcs

This commit is contained in:
andy 2011-03-03 15:19:12 +00:00
parent e91bf26503
commit d7ff7c8381
11 changed files with 36 additions and 25 deletions

View File

@ -218,10 +218,10 @@ void Foam::KinematicCloud<CloudType>::evolveCloud(TrackData& td)
{
// this->surfaceFilm().injectSteadyState(td);
this->injection().injectSteadyState(td, solution_.deltaT());
this->injection().injectSteadyState(td, solution_.deltaTValue());
td.part() = TrackData::tpLinearTrack;
CloudType::move(td, solution_.deltaT());
CloudType::move(td, solution_.deltaTValue());
}
}
@ -353,7 +353,7 @@ Foam::KinematicCloud<CloudType>::KinematicCloud
IOobject::AUTO_WRITE
),
mesh_,
dimensionedScalar("zero", dimMass/dimTime, 0.0)
dimensionedScalar("zero", dimMass, 0.0)
)
)
{
@ -504,7 +504,7 @@ void Foam::KinematicCloud<CloudType>::checkParcelProperties
parcel.rho() = constProps_.rho0();
}
const scalar carrierDt = solution_.deltaT();
const scalar carrierDt = solution_.deltaTValue();
parcel.stepFraction() = (carrierDt - lagrangianDt)/carrierDt;
parcel.typeId() = constProps_.parcelTypeId();
}
@ -582,7 +582,7 @@ template<class TrackData>
void Foam::KinematicCloud<CloudType>::motion(TrackData& td)
{
td.part() = TrackData::tpLinearTrack;
CloudType::move(td, solution_.deltaT());
CloudType::move(td, solution_.deltaTValue());
updateCellOccupancy();
}

View File

@ -332,10 +332,10 @@ Foam::KinematicCloud<CloudType>::SU(volVectorField& U) const
{
if (solution_.semiImplicit("U"))
{
return
UTrans()/(mesh_.V()*this->db().time().deltaT())
- fvm::Sp(UCoeff()/mesh_.V(), U)
+ UCoeff()/mesh_.V()*U;
const DimensionedField<scalar, volMesh>
Vdt(mesh_.V()*this->db().time().deltaT());
return UTrans()/Vdt - fvm::Sp(UCoeff()/Vdt, U) + UCoeff()/Vdt*U;
}
else
{

View File

@ -169,7 +169,10 @@ public:
inline label nextIter();
//- Return the time step
inline scalar deltaT() const;
inline scalar deltaTValue() const;
//- Return the time step
inline const dimensionedScalar deltaT() const;
//- Return const access to the coupled flag
inline const Switch coupled() const;

View File

@ -95,12 +95,18 @@ inline Foam::label Foam::cloudSolution::nextIter()
}
inline Foam::scalar Foam::cloudSolution::deltaT() const
inline Foam::scalar Foam::cloudSolution::deltaTValue() const
{
return deltaT_;
}
inline const Foam::dimensionedScalar Foam::cloudSolution::deltaT() const
{
return dimensionedScalar("cloudSolution::deltaT", dimTime, deltaT_);
}
inline const Foam::Switch Foam::cloudSolution::coupled() const
{
return coupled_;

View File

@ -114,7 +114,7 @@ inline Foam::tmp<Foam::fvScalarMatrix> Foam::ReactingCloud<CloudType>::SYi
volScalarField& sourceField = trhoTrans();
sourceField.internalField() =
rhoTrans_[i]/(this->db().time().deltaT()*this->mesh().V());
rhoTrans_[i]/(this->db().time().deltaTValue()*this->mesh().V());
const dimensionedScalar YiSMALL("YiSMALL", dimless, SMALL);
@ -127,7 +127,7 @@ inline Foam::tmp<Foam::fvScalarMatrix> Foam::ReactingCloud<CloudType>::SYi
tmp<fvScalarMatrix> tfvm(new fvScalarMatrix(Yi, dimMass/dimTime));
fvScalarMatrix& fvm = tfvm();
fvm.source() = -rhoTrans_[i]/this->db().time().deltaT();
fvm.source() = -rhoTrans_[i]/this->db().time().deltaTValue();
return tfvm;
}
@ -167,7 +167,7 @@ Foam::ReactingCloud<CloudType>::Srho(const label i) const
if (this->solution().coupled())
{
scalarField& rhoi = tRhoi();
rhoi = rhoTrans_[i]/(this->db().time().deltaT()*this->mesh().V());
rhoi = rhoTrans_[i]/(this->db().time().deltaTValue()*this->mesh().V());
}
return tRhoi;
@ -209,7 +209,7 @@ Foam::ReactingCloud<CloudType>::Srho() const
sourceField += rhoTrans_[i];
}
sourceField /= this->db().time().deltaT()*this->mesh().V();
sourceField /= this->db().time().deltaTValue()*this->mesh().V();
}
return trhoTrans;
@ -249,7 +249,7 @@ Foam::ReactingCloud<CloudType>::Srho(volScalarField& rho) const
{
sourceField += rhoTrans_[i];
}
sourceField /= this->db().time().deltaT()*this->mesh().V();
sourceField /= this->db().time().deltaTValue()*this->mesh().V();
return fvm::SuSp(trhoTrans()/rho, rho);
}

View File

@ -127,7 +127,7 @@ Foam::ThermoCloud<CloudType>::ThermoCloud
IOobject::AUTO_WRITE
),
this->mesh(),
dimensionedScalar("zero", dimEnergy/dimTime/dimTemperature, 0.0)
dimensionedScalar("zero", dimEnergy/dimTemperature, 0.0)
)
)

View File

@ -138,11 +138,13 @@ Foam::ThermoCloud<CloudType>::Sh(volScalarField& hs) const
if (this->solution().semiImplicit("hs"))
{
const volScalarField Cp(thermo_.thermo().Cp());
const DimensionedField<scalar, volMesh>
Vdt(this->mesh().V()*this->db().time().deltaT());
return
hsTrans()/(this->mesh().V()*this->db().time().deltaT())
- fvm::Sp(hsCoeff()/(Cp*this->mesh().V()), hs)
+ hsCoeff()/(Cp*this->mesh().V())*hs;
hsTrans()/Vdt
- fvm::Sp(hsCoeff()/(Cp*Vdt), hs)
+ hsCoeff()/(Cp*Vdt)*hs;
}
else
{

View File

@ -202,7 +202,7 @@ const Foam::vector Foam::KinematicParcel<ParcelType>::calcVelocity
const vector abp = (Feff.Sp()*Uc_ + (Feff.Su() + Su))/mass;
const scalar bp = Feff.Sp()/mass;
Spu = Feff.Sp()*dt/td.cloud().solution().deltaT();
Spu = dt*Feff.Sp();
IntegrationScheme<vector>::integrationResult Ures =
td.cloud().UIntegrator().integrate(U, dt, abp, bp);

View File

@ -339,7 +339,7 @@ Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer
dhsTrans += dt*htc*As*(0.5*(T + Tnew) - Tc_);
Cuh = bp*dt/td.cloud().solution().deltaT();
Cuh = dt*bp;
return Tnew;
}

View File

@ -520,7 +520,7 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
}
const scalar time = this->owner().db().time().value();
const scalar carrierDt = this->owner().solution().deltaT();
const scalar carrierDt = this->owner().solution().deltaTValue();
const polyMesh& mesh = this->owner().mesh();
// Prepare for next time step

View File

@ -290,7 +290,7 @@ void Foam::PatchInteractionModel<CloudType>::patchData
}
else
{
Up = (Cf - Cf00)/this->owner().solution().deltaT();
Up = (Cf - Cf00)/this->owner().time().deltaTValue();
}
if (mag(dn) > SMALL)
@ -314,7 +314,7 @@ void Foam::PatchInteractionModel<CloudType>::patchData
// angle/dt to give the correct angular velocity vector.
omega *=
Foam::asin(magOmega)
/(magOmega*this->owner().solution().deltaT());
/(magOmega*this->owner().time().deltaTValue());
// Project position onto face and calculate this position
// relative to the face centre.