BUGFIX: Mesh update in lagrangian
This commit is contained in:
parent
c001bc33b7
commit
a9c7a176e3
21 changed files with 170 additions and 53 deletions
|
@ -278,13 +278,9 @@ void Foam::KinematicCloud<CloudType>::updateMesh()
|
|||
template<class CloudType>
|
||||
void Foam::KinematicCloud<CloudType>::autoMap(const mapPolyMesh& mapper)
|
||||
{
|
||||
//typedef typename particle::TrackingData<KinematicCloud<CloudType>> tdType;
|
||||
Cloud<parcelType>::autoMap(mapper);
|
||||
|
||||
//tdType td(*this);
|
||||
|
||||
//Cloud<parcelType>::template autoMap<tdType>(td, mapper);
|
||||
|
||||
updateMesh();
|
||||
this->updateMesh();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -278,6 +278,15 @@ void Foam::ReactingCloud<ParcelType>::evolve()
|
|||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ReactingCloud<CloudType>::autoMap(const mapPolyMesh& mapper)
|
||||
{
|
||||
Cloud<parcelType>::autoMap(mapper);
|
||||
|
||||
this->updateMesh();
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
void Foam::ReactingCloud<ParcelType>::info() const
|
||||
{
|
||||
|
|
|
@ -239,6 +239,12 @@ public:
|
|||
|
||||
//- Evolve the spray (inject, move)
|
||||
void evolve();
|
||||
|
||||
// Mapping
|
||||
|
||||
//- Remap the cells of particles corresponding to the
|
||||
// mesh topology change with a default tracking data object
|
||||
virtual void autoMap(const mapPolyMesh&);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -234,6 +234,18 @@ void Foam::ReactingMultiphaseCloud<ParcelType>::evolve()
|
|||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
void Foam::ReactingMultiphaseCloud<ParcelType>::autoMap
|
||||
(
|
||||
const mapPolyMesh& mapper
|
||||
)
|
||||
{
|
||||
Cloud<parcelType>::autoMap(mapper);
|
||||
|
||||
this->updateMesh();
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
void Foam::ReactingMultiphaseCloud<ParcelType>::info() const
|
||||
{
|
||||
|
|
|
@ -202,7 +202,12 @@ public:
|
|||
|
||||
//- Evolve the spray (inject, move)
|
||||
void evolve();
|
||||
};
|
||||
|
||||
// Mapping
|
||||
|
||||
//- Remap the cells of particles corresponding to the
|
||||
// mesh topology change with a default tracking data object
|
||||
virtual void autoMap(const mapPolyMesh&);};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
|
|
@ -225,6 +225,15 @@ void Foam::ThermoCloud<ParcelType>::evolve()
|
|||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
void Foam::ThermoCloud<ParcelType>::autoMap(const mapPolyMesh& mapper)
|
||||
{
|
||||
Cloud<parcelType>::autoMap(mapper);
|
||||
|
||||
this->updateMesh();
|
||||
}
|
||||
|
||||
|
||||
template<class ParcelType>
|
||||
void Foam::ThermoCloud<ParcelType>::info() const
|
||||
{
|
||||
|
|
|
@ -227,6 +227,13 @@ public:
|
|||
|
||||
//- Evolve the spray (inject, move)
|
||||
void evolve();
|
||||
|
||||
|
||||
// Mapping
|
||||
|
||||
//- Remap the cells of particles corresponding to the
|
||||
// mesh topology change with a default tracking data object
|
||||
virtual void autoMap(const mapPolyMesh&);
|
||||
};
|
||||
|
||||
|
||||
|
|
|
@ -182,15 +182,7 @@ Foam::ConeInjectionMP<CloudType>::ConeInjectionMP
|
|||
// Set total volume to inject
|
||||
this->volumeTotal_ = volumeFlowRate_().integrate(0.0, duration_);
|
||||
|
||||
// Set/cache the injector cells
|
||||
forAll(positions_, i)
|
||||
{
|
||||
this->findCellAtPosition
|
||||
(
|
||||
injectorCells_[i],
|
||||
positions_[i]
|
||||
);
|
||||
}
|
||||
this->updateMesh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -210,6 +202,17 @@ bool Foam::ConeInjectionMP<CloudType>::active() const
|
|||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ConeInjectionMP<CloudType>::updateMesh()
|
||||
{
|
||||
// Set/cache the injector cell
|
||||
forAll(positions_, i)
|
||||
{
|
||||
this->findCellAtPosition(injectorCells_[i], positions_[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::ConeInjectionMP<CloudType>::timeEnd() const
|
||||
{
|
||||
|
|
|
@ -162,6 +162,9 @@ public:
|
|||
//- Flag to indicate whether model activates injection model
|
||||
bool active() const;
|
||||
|
||||
//- Set injector locations when mesh is updated
|
||||
virtual void updateMesh();
|
||||
|
||||
//- Return the end-of-injection time
|
||||
scalar timeEnd() const;
|
||||
|
||||
|
|
|
@ -131,15 +131,7 @@ Foam::FieldActivatedInjection<CloudType>::FieldActivatedInjection
|
|||
this->volumeTotal_ =
|
||||
nParcelsPerInjector_*sum(pow3(diameters_))*mathematicalConstant::pi/6.0;
|
||||
|
||||
// Set/cache the injector cells
|
||||
forAll(positions_, i)
|
||||
{
|
||||
this->findCellAtPosition
|
||||
(
|
||||
injectorCells_[i],
|
||||
positions_[i]
|
||||
);
|
||||
}
|
||||
updateMesh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -159,6 +151,17 @@ bool Foam::FieldActivatedInjection<CloudType>::active() const
|
|||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::FieldActivatedInjection<CloudType>::updateMesh()
|
||||
{
|
||||
// Set/cache the injector cell
|
||||
forAll(positions_, i)
|
||||
{
|
||||
this->findCellAtPosition(injectorCells_[i], positions_[i]);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::FieldActivatedInjection<CloudType>::timeEnd() const
|
||||
{
|
||||
|
|
|
@ -152,6 +152,9 @@ public:
|
|||
//- Flag to indicate whether model activates injection model
|
||||
bool active() const;
|
||||
|
||||
//- Set injector locations when mesh is updated
|
||||
virtual void updateMesh();
|
||||
|
||||
//- Return the end-of-injection time
|
||||
scalar timeEnd() const;
|
||||
|
||||
|
|
|
@ -97,10 +97,8 @@ Foam::KinematicLookupTableInjection<CloudType>::KinematicLookupTableInjection
|
|||
{
|
||||
// Set/cache the injector cells
|
||||
injectorCells_.setSize(injectors_.size());
|
||||
forAll(injectors_, i)
|
||||
{
|
||||
this->findCellAtPosition(injectorCells_[i], injectors_[i].x());
|
||||
}
|
||||
|
||||
this->updateMesh();
|
||||
|
||||
// Determine volume of particles to inject
|
||||
this->volumeTotal_ = 0.0;
|
||||
|
@ -128,6 +126,17 @@ bool Foam::KinematicLookupTableInjection<CloudType>::active() const
|
|||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::KinematicLookupTableInjection<CloudType>::updateMesh()
|
||||
{
|
||||
// Set/cache the injector cell
|
||||
forAll(injectors_, i)
|
||||
{
|
||||
this->findCellAtPosition(injectorCells_[i], injectors_[i].x());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::KinematicLookupTableInjection<CloudType>::timeEnd() const
|
||||
{
|
||||
|
|
|
@ -129,6 +129,9 @@ public:
|
|||
//- Flag to indicate whether model activates injection model
|
||||
bool active() const;
|
||||
|
||||
//- Set injector locations when mesh is updated
|
||||
virtual void updateMesh();
|
||||
|
||||
//- Return the end-of-injection time
|
||||
scalar timeEnd() const;
|
||||
|
||||
|
|
|
@ -117,18 +117,7 @@ Foam::PatchInjection<CloudType>::PatchInjection
|
|||
<< nl << exit(FatalError);
|
||||
}
|
||||
|
||||
const polyPatch& patch = owner.mesh().boundaryMesh()[patchId];
|
||||
|
||||
cellOwners_ = patch.faceCells();
|
||||
|
||||
label patchSize = cellOwners_.size();
|
||||
label totalPatchSize = patchSize;
|
||||
reduce(totalPatchSize, sumOp<label>());
|
||||
fraction_ = scalar(patchSize)/totalPatchSize;
|
||||
|
||||
// Set total volume/mass to inject
|
||||
this->volumeTotal_ = fraction_*volumeFlowRate_().integrate(0.0, duration_);
|
||||
this->massTotal_ *= fraction_;
|
||||
updateMesh();
|
||||
}
|
||||
|
||||
|
||||
|
@ -148,6 +137,27 @@ bool Foam::PatchInjection<CloudType>::active() const
|
|||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::PatchInjection<CloudType>::updateMesh()
|
||||
{
|
||||
label patchId =
|
||||
this->owner().mesh().boundaryMesh().findPatchID(patchName_);
|
||||
|
||||
const polyPatch& patch = this->owner().mesh().boundaryMesh()[patchId];
|
||||
|
||||
cellOwners_ = patch.faceCells();
|
||||
|
||||
label patchSize = cellOwners_.size();
|
||||
label totalPatchSize = patchSize;
|
||||
reduce(totalPatchSize, sumOp<label>());
|
||||
fraction_ = scalar(patchSize)/totalPatchSize;
|
||||
|
||||
// Set total volume/mass to inject
|
||||
this->volumeTotal_ = fraction_*volumeFlowRate_().integrate(0.0, duration_);
|
||||
this->massTotal_ *= fraction_;
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::PatchInjection<CloudType>::timeEnd() const
|
||||
{
|
||||
|
|
|
@ -136,6 +136,9 @@ public:
|
|||
//- Flag to indicate whether model activates injection model
|
||||
bool active() const;
|
||||
|
||||
//- Set injector locations when mesh is updated
|
||||
virtual void updateMesh();
|
||||
|
||||
//- Return the end-of-injection time
|
||||
scalar timeEnd() const;
|
||||
|
||||
|
|
|
@ -96,10 +96,8 @@ Foam::ReactingLookupTableInjection<CloudType>::ReactingLookupTableInjection
|
|||
{
|
||||
// Set/cache the injector cells
|
||||
injectorCells_.setSize(injectors_.size());
|
||||
forAll(injectors_, i)
|
||||
{
|
||||
this->findCellAtPosition(injectorCells_[i], injectors_[i].x());
|
||||
}
|
||||
|
||||
this->updateMesh();
|
||||
|
||||
// Determine volume of particles to inject
|
||||
this->volumeTotal_ = 0.0;
|
||||
|
@ -127,6 +125,17 @@ bool Foam::ReactingLookupTableInjection<CloudType>::active() const
|
|||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ReactingLookupTableInjection<CloudType>::updateMesh()
|
||||
{
|
||||
// Set/cache the injector cell
|
||||
forAll(injectors_, i)
|
||||
{
|
||||
this->findCellAtPosition(injectorCells_[i], injectors_[i].x());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::ReactingLookupTableInjection<CloudType>::timeEnd() const
|
||||
{
|
||||
|
|
|
@ -132,6 +132,9 @@ public:
|
|||
//- Flag to indicate whether model activates injection model
|
||||
bool active() const;
|
||||
|
||||
//- Set injector locations when mesh is updated
|
||||
virtual void updateMesh();
|
||||
|
||||
//- Return the end-of-injection time
|
||||
scalar timeEnd() const;
|
||||
|
||||
|
|
|
@ -99,10 +99,8 @@ ReactingMultiphaseLookupTableInjection
|
|||
{
|
||||
// Set/cache the injector cells
|
||||
injectorCells_.setSize(injectors_.size());
|
||||
forAll(injectors_, i)
|
||||
{
|
||||
this->findCellAtPosition(injectorCells_[i], injectors_[i].x());
|
||||
}
|
||||
|
||||
this->updateMesh();
|
||||
|
||||
// Determine volume of particles to inject
|
||||
this->volumeTotal_ = 0.0;
|
||||
|
@ -131,6 +129,17 @@ bool Foam::ReactingMultiphaseLookupTableInjection<CloudType>::active() const
|
|||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ReactingMultiphaseLookupTableInjection<CloudType>::updateMesh()
|
||||
{
|
||||
// Set/cache the injector cell
|
||||
forAll(injectors_, i)
|
||||
{
|
||||
this->findCellAtPosition(injectorCells_[i], injectors_[i].x());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar
|
||||
Foam::ReactingMultiphaseLookupTableInjection<CloudType>::timeEnd() const
|
||||
|
|
|
@ -135,6 +135,9 @@ public:
|
|||
//- Flag to indicate whether model activates injection model
|
||||
bool active() const;
|
||||
|
||||
//- Set injector locations when mesh is updated
|
||||
virtual void updateMesh();
|
||||
|
||||
//- Return the end-of-injection time
|
||||
scalar timeEnd() const;
|
||||
|
||||
|
|
|
@ -97,10 +97,8 @@ Foam::ThermoLookupTableInjection<CloudType>::ThermoLookupTableInjection
|
|||
{
|
||||
// Set/cache the injector cells
|
||||
injectorCells_.setSize(injectors_.size());
|
||||
forAll(injectors_, i)
|
||||
{
|
||||
this->findCellAtPosition(injectorCells_[injectorI], injectors_[i].x());
|
||||
}
|
||||
|
||||
updateMesh();
|
||||
|
||||
// Determine volume of particles to inject
|
||||
this->volumeTotal_ = 0.0;
|
||||
|
@ -128,6 +126,17 @@ bool Foam::ThermoLookupTableInjection<CloudType>::active() const
|
|||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
void Foam::ThermoLookupTableInjection<CloudType>::updateMesh()
|
||||
{
|
||||
// Set/cache the injector cells
|
||||
forAll(injectors_, i)
|
||||
{
|
||||
this->findCellAtPosition(injectorCells_[injectorI], injectors_[i].x());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<class CloudType>
|
||||
Foam::scalar Foam::ThermoLookupTableInjection<CloudType>::timeEnd() const
|
||||
{
|
||||
|
|
|
@ -131,6 +131,9 @@ public:
|
|||
//- Flag to indicate whether model activates injection model
|
||||
bool active() const;
|
||||
|
||||
//- Set injector locations when mesh is updated
|
||||
virtual void updateMesh();
|
||||
|
||||
//- Return the end-of-injection time
|
||||
scalar timeEnd() const;
|
||||
|
||||
|
|
Reference in a new issue