mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
ENH: further updates to semi-implicit cloud source calcs
This commit is contained in:
@ -218,10 +218,10 @@ void Foam::KinematicCloud<CloudType>::evolveCloud(TrackData& td)
|
|||||||
{
|
{
|
||||||
// this->surfaceFilm().injectSteadyState(td);
|
// this->surfaceFilm().injectSteadyState(td);
|
||||||
|
|
||||||
this->injection().injectSteadyState(td, solution_.deltaT());
|
this->injection().injectSteadyState(td, solution_.deltaTValue());
|
||||||
|
|
||||||
td.part() = TrackData::tpLinearTrack;
|
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
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
mesh_,
|
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();
|
parcel.rho() = constProps_.rho0();
|
||||||
}
|
}
|
||||||
|
|
||||||
const scalar carrierDt = solution_.deltaT();
|
const scalar carrierDt = solution_.deltaTValue();
|
||||||
parcel.stepFraction() = (carrierDt - lagrangianDt)/carrierDt;
|
parcel.stepFraction() = (carrierDt - lagrangianDt)/carrierDt;
|
||||||
parcel.typeId() = constProps_.parcelTypeId();
|
parcel.typeId() = constProps_.parcelTypeId();
|
||||||
}
|
}
|
||||||
@ -582,7 +582,7 @@ template<class TrackData>
|
|||||||
void Foam::KinematicCloud<CloudType>::motion(TrackData& td)
|
void Foam::KinematicCloud<CloudType>::motion(TrackData& td)
|
||||||
{
|
{
|
||||||
td.part() = TrackData::tpLinearTrack;
|
td.part() = TrackData::tpLinearTrack;
|
||||||
CloudType::move(td, solution_.deltaT());
|
CloudType::move(td, solution_.deltaTValue());
|
||||||
|
|
||||||
updateCellOccupancy();
|
updateCellOccupancy();
|
||||||
}
|
}
|
||||||
|
|||||||
@ -332,10 +332,10 @@ Foam::KinematicCloud<CloudType>::SU(volVectorField& U) const
|
|||||||
{
|
{
|
||||||
if (solution_.semiImplicit("U"))
|
if (solution_.semiImplicit("U"))
|
||||||
{
|
{
|
||||||
return
|
const DimensionedField<scalar, volMesh>
|
||||||
UTrans()/(mesh_.V()*this->db().time().deltaT())
|
Vdt(mesh_.V()*this->db().time().deltaT());
|
||||||
- fvm::Sp(UCoeff()/mesh_.V(), U)
|
|
||||||
+ UCoeff()/mesh_.V()*U;
|
return UTrans()/Vdt - fvm::Sp(UCoeff()/Vdt, U) + UCoeff()/Vdt*U;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -169,7 +169,10 @@ public:
|
|||||||
inline label nextIter();
|
inline label nextIter();
|
||||||
|
|
||||||
//- Return the time step
|
//- 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
|
//- Return const access to the coupled flag
|
||||||
inline const Switch coupled() const;
|
inline const Switch coupled() const;
|
||||||
|
|||||||
@ -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_;
|
return deltaT_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline const Foam::dimensionedScalar Foam::cloudSolution::deltaT() const
|
||||||
|
{
|
||||||
|
return dimensionedScalar("cloudSolution::deltaT", dimTime, deltaT_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline const Foam::Switch Foam::cloudSolution::coupled() const
|
inline const Foam::Switch Foam::cloudSolution::coupled() const
|
||||||
{
|
{
|
||||||
return coupled_;
|
return coupled_;
|
||||||
|
|||||||
@ -114,7 +114,7 @@ inline Foam::tmp<Foam::fvScalarMatrix> Foam::ReactingCloud<CloudType>::SYi
|
|||||||
volScalarField& sourceField = trhoTrans();
|
volScalarField& sourceField = trhoTrans();
|
||||||
|
|
||||||
sourceField.internalField() =
|
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);
|
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));
|
tmp<fvScalarMatrix> tfvm(new fvScalarMatrix(Yi, dimMass/dimTime));
|
||||||
fvScalarMatrix& fvm = tfvm();
|
fvScalarMatrix& fvm = tfvm();
|
||||||
|
|
||||||
fvm.source() = -rhoTrans_[i]/this->db().time().deltaT();
|
fvm.source() = -rhoTrans_[i]/this->db().time().deltaTValue();
|
||||||
|
|
||||||
return tfvm;
|
return tfvm;
|
||||||
}
|
}
|
||||||
@ -167,7 +167,7 @@ Foam::ReactingCloud<CloudType>::Srho(const label i) const
|
|||||||
if (this->solution().coupled())
|
if (this->solution().coupled())
|
||||||
{
|
{
|
||||||
scalarField& rhoi = tRhoi();
|
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;
|
return tRhoi;
|
||||||
@ -209,7 +209,7 @@ Foam::ReactingCloud<CloudType>::Srho() const
|
|||||||
sourceField += rhoTrans_[i];
|
sourceField += rhoTrans_[i];
|
||||||
}
|
}
|
||||||
|
|
||||||
sourceField /= this->db().time().deltaT()*this->mesh().V();
|
sourceField /= this->db().time().deltaTValue()*this->mesh().V();
|
||||||
}
|
}
|
||||||
|
|
||||||
return trhoTrans;
|
return trhoTrans;
|
||||||
@ -249,7 +249,7 @@ Foam::ReactingCloud<CloudType>::Srho(volScalarField& rho) const
|
|||||||
{
|
{
|
||||||
sourceField += rhoTrans_[i];
|
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);
|
return fvm::SuSp(trhoTrans()/rho, rho);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -127,7 +127,7 @@ Foam::ThermoCloud<CloudType>::ThermoCloud
|
|||||||
IOobject::AUTO_WRITE
|
IOobject::AUTO_WRITE
|
||||||
),
|
),
|
||||||
this->mesh(),
|
this->mesh(),
|
||||||
dimensionedScalar("zero", dimEnergy/dimTime/dimTemperature, 0.0)
|
dimensionedScalar("zero", dimEnergy/dimTemperature, 0.0)
|
||||||
)
|
)
|
||||||
)
|
)
|
||||||
|
|
||||||
|
|||||||
@ -138,11 +138,13 @@ Foam::ThermoCloud<CloudType>::Sh(volScalarField& hs) const
|
|||||||
if (this->solution().semiImplicit("hs"))
|
if (this->solution().semiImplicit("hs"))
|
||||||
{
|
{
|
||||||
const volScalarField Cp(thermo_.thermo().Cp());
|
const volScalarField Cp(thermo_.thermo().Cp());
|
||||||
|
const DimensionedField<scalar, volMesh>
|
||||||
|
Vdt(this->mesh().V()*this->db().time().deltaT());
|
||||||
|
|
||||||
return
|
return
|
||||||
hsTrans()/(this->mesh().V()*this->db().time().deltaT())
|
hsTrans()/Vdt
|
||||||
- fvm::Sp(hsCoeff()/(Cp*this->mesh().V()), hs)
|
- fvm::Sp(hsCoeff()/(Cp*Vdt), hs)
|
||||||
+ hsCoeff()/(Cp*this->mesh().V())*hs;
|
+ hsCoeff()/(Cp*Vdt)*hs;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -202,7 +202,7 @@ const Foam::vector Foam::KinematicParcel<ParcelType>::calcVelocity
|
|||||||
const vector abp = (Feff.Sp()*Uc_ + (Feff.Su() + Su))/mass;
|
const vector abp = (Feff.Sp()*Uc_ + (Feff.Su() + Su))/mass;
|
||||||
const scalar bp = Feff.Sp()/mass;
|
const scalar bp = Feff.Sp()/mass;
|
||||||
|
|
||||||
Spu = Feff.Sp()*dt/td.cloud().solution().deltaT();
|
Spu = dt*Feff.Sp();
|
||||||
|
|
||||||
IntegrationScheme<vector>::integrationResult Ures =
|
IntegrationScheme<vector>::integrationResult Ures =
|
||||||
td.cloud().UIntegrator().integrate(U, dt, abp, bp);
|
td.cloud().UIntegrator().integrate(U, dt, abp, bp);
|
||||||
|
|||||||
@ -339,7 +339,7 @@ Foam::scalar Foam::ThermoParcel<ParcelType>::calcHeatTransfer
|
|||||||
|
|
||||||
dhsTrans += dt*htc*As*(0.5*(T + Tnew) - Tc_);
|
dhsTrans += dt*htc*As*(0.5*(T + Tnew) - Tc_);
|
||||||
|
|
||||||
Cuh = bp*dt/td.cloud().solution().deltaT();
|
Cuh = dt*bp;
|
||||||
|
|
||||||
return Tnew;
|
return Tnew;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -520,7 +520,7 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
|
|||||||
}
|
}
|
||||||
|
|
||||||
const scalar time = this->owner().db().time().value();
|
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();
|
const polyMesh& mesh = this->owner().mesh();
|
||||||
|
|
||||||
// Prepare for next time step
|
// Prepare for next time step
|
||||||
|
|||||||
@ -290,7 +290,7 @@ void Foam::PatchInteractionModel<CloudType>::patchData
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
Up = (Cf - Cf00)/this->owner().solution().deltaT();
|
Up = (Cf - Cf00)/this->owner().time().deltaTValue();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (mag(dn) > SMALL)
|
if (mag(dn) > SMALL)
|
||||||
@ -314,7 +314,7 @@ void Foam::PatchInteractionModel<CloudType>::patchData
|
|||||||
// angle/dt to give the correct angular velocity vector.
|
// angle/dt to give the correct angular velocity vector.
|
||||||
omega *=
|
omega *=
|
||||||
Foam::asin(magOmega)
|
Foam::asin(magOmega)
|
||||||
/(magOmega*this->owner().solution().deltaT());
|
/(magOmega*this->owner().time().deltaTValue());
|
||||||
|
|
||||||
// Project position onto face and calculate this position
|
// Project position onto face and calculate this position
|
||||||
// relative to the face centre.
|
// relative to the face centre.
|
||||||
|
|||||||
Reference in New Issue
Block a user