diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C index c350d21017..3ca019fa4e 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.C @@ -816,6 +816,13 @@ void Foam::KinematicCloud::patchData } +template +void Foam::KinematicCloud::updateMesh() +{ + injectors_.updateMesh(); +} + + template void Foam::KinematicCloud::autoMap(const mapPolyMesh& mapper) { @@ -824,6 +831,8 @@ void Foam::KinematicCloud::autoMap(const mapPolyMesh& mapper) tdType td(*this); Cloud::template autoMap(td, mapper); + + updateMesh(); } diff --git a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H index ed373d0f6b..321fba33ad 100644 --- a/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H +++ b/src/lagrangian/intermediate/clouds/Templates/KinematicCloud/KinematicCloud.H @@ -566,8 +566,12 @@ public: vector& Up ) const; + // Mapping + //- Update mesh + void updateMesh(); + //- Remap the cells of particles corresponding to the // mesh topology change with a default tracking data object virtual void autoMap(const mapPolyMesh&); diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C index 00fb7b5a96..0f98e8b935 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingCloud/ReactingCloud.C @@ -345,6 +345,8 @@ void Foam::ReactingCloud::autoMap(const mapPolyMesh& mapper) tdType td(*this); Cloud::template autoMap(td, mapper); + + this->updateMesh(); } diff --git a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C index 8cab7d3f85..31bc4c3222 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ReactingMultiphaseCloud/ReactingMultiphaseCloud.C @@ -264,6 +264,8 @@ void Foam::ReactingMultiphaseCloud::autoMap tdType td(*this); Cloud::template autoMap(td, mapper); + + this->updateMesh(); } diff --git a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C index 874936990a..c7e5c9814d 100644 --- a/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C +++ b/src/lagrangian/intermediate/clouds/Templates/ThermoCloud/ThermoCloud.C @@ -487,6 +487,8 @@ void Foam::ThermoCloud::autoMap(const mapPolyMesh& mapper) tdType td(*this); Cloud::template autoMap(td, mapper); + + this->updateMesh(); } diff --git a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/CellZoneInjection/CellZoneInjection.C b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/CellZoneInjection/CellZoneInjection.C index 4764de1af6..ec9f1c0139 100644 --- a/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/CellZoneInjection/CellZoneInjection.C +++ b/src/lagrangian/intermediate/submodels/Kinematic/InjectionModel/CellZoneInjection/CellZoneInjection.C @@ -185,60 +185,7 @@ Foam::CellZoneInjection::CellZoneInjection ) ) { - const fvMesh& mesh = owner.mesh(); - const label zoneI = mesh.cellZones().findZoneID(cellZoneName_); - - if (zoneI < 0) - { - FatalErrorIn - ( - "Foam::CellZoneInjection::CellZoneInjection" - "(" - "const dictionary&, " - "CloudType&" - ")" - ) << "Unknown cell zone name: " << cellZoneName_ - << ". Valid cell zones are: " << mesh.cellZones().names() - << nl << exit(FatalError); - } - - const labelList& cellZoneCells = mesh.cellZones()[zoneI]; - const label nCells = cellZoneCells.size(); - const scalar nCellsTotal = returnReduce(nCells, sumOp