Writing the old 'positions' file in Lagrangian solvers as of OpenFOAM 5.x
I've seen this asked here on the forum at least a couple of times in the past, but I haven't gone looking for those threads yet.
Essentially the problem is that ever since the barycentric positions were implemented in OpenFOAM-dev and released in OpenFOAM 5.x (OpenFOAM Foundation), it hasn't been possible to load the Lagrangian data into ParaView when using the internal reader, namely with the file extension ".foam", for example if you open the case with this command: Code:
paraFoam -builtin
|
Quote:
Hi Bruno, I am facing a problem with your tool (this is the same post I wrote in blueCFD github). I am tryingto use the function with coalChemistryFoam (OF8), so maybe this coalCloud class is not recognised in the script (only MPPIC, colliding, spray and reacting multiphase). But actually this latter is included to form the coalCloud. In my case positions.orig are properly written in processorx/lagrangian/coalCloud1 but when reconstructing they do not reconstruct. Trying to reconstruct and then running postProcess -dict system/positionConvertDict gives me this error: Code:
Executing functionObjects --> FOAM FATAL ERROR: |
position conversion accuracy
2 Attachment(s)
Hi Bruno,
I am trying to use your function object on OF7 to convert barycentric to old positions for a coaxial nozzle flow. The code has compiled with no error but when I do the postprocessing the conversion moves the particle elsewhere. AS you can see the particles are injected in the core nozzle but in the converted position visualization there are particles in the secondary exhaust. Attachment 84987 Attachment 84988 So I'm trying to see what causes the deviation from the exact positions. Thanks Negar |
Quote:
I have the same problem when I want to generate the positions.orig file as post-processing with the sprayFoam solver. It's frustrating because parallelization accelerates my simulations with droplets. I think the program is not detecting the cloud type and using kinematicCloud as default. If anyone knows a solution about this, it would be great, please let us know. Thanks, Luis. |
Quote:
Is running with one of the openfoam.com versions an option? There you continue to have positions (xyz) and coordinates (barycentric), which makes it simple to post-process in paraview. |
Quote:
Unfortunately, the server I use and my custom solver are in OF5 (.org), so it would be difficult to change it. Despite this, I solved the problem by adding the following text in file "OpenFOAM-5.x/src/lagrangian/intermediate/parcels/Templates/KinematicParcel/KinematicParcelIO.C" in these lines: Line 222: Code:
IOField<vector> positions_orig(c.fieldIOobject("positions_orig", IOobject::NO_READ), np); Code:
positions_orig[i] = p.position(); Code:
positions_orig.write(valid); Code:
find -name positions | while read line; do mv $line $line.coord; mv $line_orig $line; done |
All times are GMT -4. The time now is 22:38. |