diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C index 3e49d29cd5..26cae658c6 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C @@ -218,10 +218,10 @@ void Foam::KinematicCloud::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::KinematicCloud IOobject::AUTO_WRITE ), mesh_, - dimensionedScalar("zero", dimMass/dimTime, 0.0) + dimensionedScalar("zero", dimMass, 0.0) ) ) { @@ -504,7 +504,7 @@ void Foam::KinematicCloud::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 void Foam::KinematicCloud::motion(TrackData& td) { td.part() = TrackData::tpLinearTrack; - CloudType::move(td, solution_.deltaT()); + CloudType::move(td, solution_.deltaTValue()); updateCellOccupancy(); } diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H index 681712f6e4..5987192bfd 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloudI.H @@ -332,10 +332,10 @@ Foam::KinematicCloud::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 + Vdt(mesh_.V()*this->db().time().deltaT()); + + return UTrans()/Vdt - fvm::Sp(UCoeff()/Vdt, U) + UCoeff()/Vdt*U; } else { diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/cloudSolution/cloudSolution.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/cloudSolution/cloudSolution.H index 1162df6506..cb1c8330b3 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/cloudSolution/cloudSolution.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/cloudSolution/cloudSolution.H @@ -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; diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/cloudSolution/cloudSolutionI.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/cloudSolution/cloudSolutionI.H index 37aad4dbdf..a5da04150d 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/cloudSolution/cloudSolutionI.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/cloudSolution/cloudSolutionI.H @@ -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_; diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H index 79b66f87ff..52c33017f3 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloudI.H @@ -114,7 +114,7 @@ inline Foam::tmp Foam::ReactingCloud::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::ReactingCloud::SYi tmp 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::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::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::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); } diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C index 2dbe453580..e0365b54e2 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C @@ -127,7 +127,7 @@ Foam::ThermoCloud::ThermoCloud IOobject::AUTO_WRITE ), this->mesh(), - dimensionedScalar("zero", dimEnergy/dimTime/dimTemperature, 0.0) + dimensionedScalar("zero", dimEnergy/dimTemperature, 0.0) ) ) diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H index c774133cb0..6889385431 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloudI.H @@ -138,11 +138,13 @@ Foam::ThermoCloud::Sh(volScalarField& hs) const if (this->solution().semiImplicit("hs")) { const volScalarField Cp(thermo_.thermo().Cp()); + const DimensionedField + 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 { diff --git a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C index 0a3e05d200..40e3efcb73 100644 --- a/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcel.C @@ -202,7 +202,7 @@ const Foam::vector Foam::KinematicParcel::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::integrationResult Ures = td.cloud().UIntegrator().integrate(U, dt, abp, bp); diff --git a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C index 9df054c2d0..53a8e5545e 100644 --- a/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C +++ b/src/lagrangian/intermediate/parcels/Templates/ThermoParcel/ThermoParcel.C @@ -339,7 +339,7 @@ Foam::scalar Foam::ThermoParcel::calcHeatTransfer dhsTrans += dt*htc*As*(0.5*(T + Tnew) - Tc_); - Cuh = bp*dt/td.cloud().solution().deltaT(); + Cuh = dt*bp; return Tnew; } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C index 5bf1c140c3..fb077dba51 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/InjectionModel/InjectionModel.C @@ -520,7 +520,7 @@ void Foam::InjectionModel::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 diff --git a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C index 3236774c18..70e440b0c3 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/PatchInteractionModel/PatchInteractionModel/PatchInteractionModel.C @@ -290,7 +290,7 @@ void Foam::PatchInteractionModel::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::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.