mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
tidy-up of constrain functions for pos and U
This commit is contained in:
@ -229,24 +229,6 @@ Foam::scalar Foam::InjectionModel<CloudType>::setNumberOfParticles
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::InjectionModel<CloudType>::geometryCorrection(vector& pos) const
|
||||
{
|
||||
meshTools::constrainToMeshCentre(owner_.mesh(), pos);
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::InjectionModel<CloudType>::velocityCorrection(vector& U) const
|
||||
{
|
||||
meshTools::constrainDirection
|
||||
(
|
||||
owner_.mesh(),
|
||||
owner_.mesh().solutionD(),
|
||||
U
|
||||
);
|
||||
}
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::InjectionModel<CloudType>::postInjectCheck()
|
||||
{
|
||||
@ -269,6 +251,7 @@ void Foam::InjectionModel<CloudType>::postInjectCheck()
|
||||
// Reset added parcels counter
|
||||
parcelsAdded_ = 0;
|
||||
|
||||
// Write current state to properties file
|
||||
writeProps();
|
||||
}
|
||||
|
||||
@ -425,8 +408,13 @@ void Foam::InjectionModel<CloudType>::inject(TrackData& td)
|
||||
scalar dt = time - timeInj;
|
||||
|
||||
// Apply corrections for 2-D cases
|
||||
geometryCorrection(pos);
|
||||
velocityCorrection(U);
|
||||
meshTools::constrainToMeshCentre(owner_.mesh(), pos);
|
||||
meshTools::constrainDirection
|
||||
(
|
||||
owner_.mesh(),
|
||||
owner_.mesh().solutionD(),
|
||||
U
|
||||
);
|
||||
|
||||
// Add the new parcel
|
||||
td.cloud().addNewParcel(pos, cellI, d, U, nP, dt);
|
||||
|
||||
@ -88,12 +88,6 @@ private:
|
||||
//- Write injector properties
|
||||
void writeProps();
|
||||
|
||||
//- Geometry correction for 2-D cases
|
||||
void geometryCorrection(vector& pos) const;
|
||||
|
||||
//- Velocity correction for 2-D cases
|
||||
void velocityCorrection(vector& U) const;
|
||||
|
||||
|
||||
protected:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user