|
[Sponsors] |
March 31, 2009, 11:59 |
Mapping Lagrangian particles
|
#1 |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Version: 1.5.x
Description: when mapping a case with lagrangian particles to a smaller mesh some of the particles keep the cell number (in the positions-file) from the old mesh which are a) wrong b) may be outside of the range of the new mesh which causes all kinds of trouble (during decomposePar, trackToFace etc) Fix: the attached patch. For the particles in question it overwrites the celli_ with the index of the found cell (which was calculated anyway). In order to do this a write-access-method for celli_ had to be introduced mapLagrangian.patch.txt |
|
April 1, 2009, 06:05 |
|
#2 |
Senior Member
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,419
Rep Power: 26 |
Nice one. I put it in.
|
|
March 26, 2017, 14:55 |
|
#3 | |
New Member
Ebrahim
Join Date: Mar 2010
Posts: 28
Rep Power: 16 |
Quote:
I have faced an issue for lagrangian interpolation in parallel simulation and I will be thankful if you can help me with that. I use 2 meshes during simulation, a coarse mesh and a fine mesh and I need to transfer my particles between the meshes during the simulation. To do this, I used the same functions that are implemented in mapFields / mapFieldsPar. The major difference between the interpolation function of mapFields and the revised one in my solver is in the lagrangian interpolation part. In mapFields the particle clouds (here passiveParticleCloud) are constructed by reading the cloud directories (objects) in the case time directory, but in my solver the particle clouds (both source and target) are constructed in the solver main loop (as I need the particle data during the solution before they are written in the time directories). Everything works fine for serial case. Even in the parallel case the Eulerian fields (e.g. velocity, pressure, etc) are interpolated correctly. But just for lagrangian interpolation of particles in parallel, I cannot get the right result. It seems that the host cell of the particle in the target mesh cannot be found in the function: Code:
autoPtr<passiveParticle> newPtr ( new passiveParticle ( meshTarget, targetCc[targetCells[i]], targetCells[i] ) ); (When I forced the decomposition to be similar in both meshes, the interpolation works fine, but I cannot do such a decomposition in general case of unstructured meshes I think.) I'm wondering how mapFields can do parallel interpolations for Eulerian field values but not for lagrangian particles. Thank you in advance /Ebrahim |
||
March 28, 2017, 06:57 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Anyway: I haven't worked on this for a long time (you'll notice that my posts in this threads are more than a couple of weeks ago) so I can't comment on this. Anyway: when looking at the sources for mapFieldsPar in v1612+ and 4.1 there are source files called "mapLagrangian" so something IS there (but I don't have time to go through the source to see WHAT. You'll have to do this yourself)
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
March 28, 2017, 12:08 |
|
#5 | |
New Member
Ebrahim
Join Date: Mar 2010
Posts: 28
Rep Power: 16 |
Quote:
Yes, A mapping function called "mapLagrangian" is defined there which can find the host cell of the particle in the target mesh, but the function that I mentioned in the previous post cannot be executed in the parallel case without using the time directories (cloudDirs[cloudI]). Thanks, Ebrahim |
||
March 28, 2017, 17:58 |
|
#6 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
March 31, 2017, 11:56 |
|
#7 | |
New Member
Ebrahim
Join Date: Mar 2010
Posts: 28
Rep Power: 16 |
Quote:
Finally I decided to use the approach that you mentioned and this works for a simple test case. I hope It wouldn't be an expensive approach for complex cases with a lot of particles and fine grids. The only point that I want to say here is that I guess its more efficient to make separate list for different particle properties (i.e. a list for diameters, another one for positions, etc) and distribute them among all processors rather than distributing a list of particles themselves. Thank you again, Ebrahim |
||
December 20, 2023, 09:45 |
|
#8 |
Member
Uttam
Join Date: May 2020
Location: Southampton, United Kingdom
Posts: 35
Rep Power: 6 |
Hi Ebrahim
OpenFOAM version v1812 I am trying to use mapFields to interpolate Eulerian fields between two meshes (specifically from a larger mesh to a smaller one) using the functions defined in mapFields. I notice that there are two such mapFields source files - a pre-processing one (that can be called from the command line) and a functionObject. I am using the source code of the functionObject. I have instantiated the class nd I get a message that the cell addressing is done but I am not able to interpolate the field of my choice. Could you please share a rough workflow on the functions that you used to do the interpolation of the Eulerian fields as it would be very helpful to me!
__________________
Best Regards Uttam ----------------------------------------------------------------- “When everything seem to be going against you, remember that the airplane takes off against the wind, not with it.” – Henry Ford. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Lagrangian particles and ParaFoam | lucchini | OpenFOAM Running, Solving & CFD | 11 | April 4, 2011 16:04 |
Creating Lagrangian particles for postprocessing | hjasak | OpenFOAM Post-Processing | 6 | July 2, 2008 11:59 |
maximum particles' volume fraction for Lagrangian | Itchie | CFX | 0 | March 19, 2008 11:06 |
[Gmsh] Import gmsh msh to Foam | adorean | OpenFOAM Meshing & Mesh Conversion | 24 | April 27, 2005 09:19 |
lagrangian particles | allan | Siemens | 1 | August 18, 2004 06:01 |