View Issue Details

IDProjectCategoryView StatusLast Update
0000464OpenFOAM[All Projects] Bugpublic2012-08-13 10:43
Reporteruser331Assigned Touser2 
Status resolvedResolutionfixed 
PlatformLinuxOSOpenSUSEOS Version11.4
Product Version 
Fixed in Version 
Summary0000464: implementation of mapping for clouds (and possibly parcels/particles)
DescriptionI've been trying to work with dynamic meshes and lagrangrian sprays and I keep getting the following error that crashes my simulation:

Not implemented

    From function cloud::autoMap(const mapPolyMesh&)
    in file fields/cloud/cloud.C at line 65.

FOAM aborting

It would be really helpful to include a mapper for clouds as this would open up a lot of functionality.
Steps To Reproduce1. Compile the attached solver sprayFoamDynamicMesh (included in the tarball)
2. Run sprayFoamDynamicMesh on the attached case aachenBombDynamicMesh (based on the regular tutorial, also included in the tarball)
Additional InformationThe attached solver and case are based on the following discussion on the forum:

See also the following report:

I'm also including the stack trace from the debug version when the refinement begins:

#0 Foam::error::printStack(Foam::Ostream&) at ~/OpenFOAM/OpenFOAM-2.1.x/src/OSspecific/POSIX/printStack.C:201
#1 Foam::error::abort() at ~/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/error.C:249
#2 Foam::Ostream& Foam::operator<< <Foam::error>(Foam::Ostream&, Foam::errorManip<Foam::error>) at ~/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/errorManip.H:85
#3 Foam::cloud::autoMap(Foam::mapPolyMesh const&) at ~/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/fields/cloud/cloud.C:66
#4 Foam::mapClouds(Foam::objectRegistry const&, Foam::mapPolyMesh const&) at ~/OpenFOAM/OpenFOAM-2.1.x/src/OpenFOAM/lnInclude/mapClouds.H:52
#5 Foam::fvMesh::mapFields(Foam::mapPolyMesh const&) at ~/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/fvMesh/fvMesh.C:489
#6 Foam::fvMesh::updateMesh(Foam::mapPolyMesh const&) at ~/OpenFOAM/OpenFOAM-2.1.x/src/finiteVolume/fvMesh/fvMesh.C:674
#7 Foam::dynamicRefineFvMesh::refine(Foam::List<int> const&) at ~/OpenFOAM/OpenFOAM-2.1.x/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C:264
#8 Foam::dynamicRefineFvMesh::update() at ~/OpenFOAM/OpenFOAM-2.1.x/src/dynamicFvMesh/dynamicRefineFvMesh/dynamicRefineFvMesh.C:1186
 at ~/OpenFOAM/OpenFOAM-2.1.x/applications/solvers/lagrangian/sprayFoamDynamicMesh/sprayFoam.C:80
#10 __libc_start_main in "/lib/"
 at /usr/src/packages/BUILD/glibc-2.11.3/csu/../sysdeps/i386/elf/start.S:122
TagsNo tags attached.



2012-03-16 20:12


sprayFoamDynamic.tar.gz (9,088 bytes)


2012-07-26 00:01


It would be nice to get feedback on this bug, but I realize I have to give before I can get ;)

Looking at the lagrangian libraries, there is an autoMap function in $FOAM_SRC/lagrangian/basic/Cloud that should be called when autoMap is called from here $FOAM_SRC/OpenFOAM/fields/cloud. Or at least it was in the older versions of OpenFOAM when Foam::cloud::autoMap was a pure virtual function.

I tried changing Foam::cloud::autoMap to a pure virtual but that didn't work. So there is likely more to the linking/templates than I can see.


2012-07-26 10:26


The cloud::autoMap is the fall-back version. Your cloud class should define its own virtual autoMap function which then can call the

Cloud::autoMap(trackData&, const mapPolyMesh&)

to do the particles and any additional stuff. The key is that the Cloud::autoMap needs trackData argument so you have to supply that somehow.


2012-07-26 12:27


This is already implemented in our internal development line - however, there are additional changes still required that relate to the improved tracking algorithm introduced in version 2.0.


2012-07-26 18:02


Last edited: 2012-07-27 00:31

View 2 revisions

Great news on the impending release. Are there major issues with just making the substitution (similar to your development line)? I'd like to test the change myself, as this is some functionality I'd like to try out, so that when the real version hits I can be ready to use it right away. Or if you need testers I would also be happy to assist :)

Because of the amount of templatization involved, an example would be instructive. Keep up the great work!


2012-08-02 12:25


I've pushed a couple of commits 0ffb024 and 9c8ce25 that add the autoMap functionality to the clouds and clear the tets used by the tracking algorithm when the mesh is updated - hopefully these should help


2012-08-02 17:16


Awesome! I'll pull them now and give them a test. Should I report anything under here or file a new issue?


2012-08-02 18:05


I'll leave the thread open for now for anything directly related to the recent commits


2012-08-02 21:56


Last edited: 2012-08-02 22:10

View 2 revisions

The mapping looks like its working well, there are some issues with the tets after a refine operation (using dynamicRefineFvMesh). liquidSpray0 is a basicSprayCloud and a gasSpray0 is a coalCloud.

The error I get is:

Courant Number mean: 0.000213884 max: 0.0845929
deltaT = 1.36242e-06
Time = 9.86376e-05 s
Selected 24 cells for refinement out of 168100.
Refined from 168100 to 168268 cells.
Cloud<ParticleType>::autoMap(TrackData&, const mapPolyMesh&) for lagrangian cloud gasSpray0
Cloud<ParticleType>::autoMap(TrackData&, const mapPolyMesh&) for lagrangian cloud liquidSpray0

cell, tetFace and tetPt search failure at position (0.000108393 0.0550254 0.000119704)
for requested cell 93295

    From function void Foam::particle::initCellFacePt()
    in file /home/gandalf/OpenFOAM/OpenFOAM-2.1.x/src/lagrangian/basic/lnInclude/particleI.H at line 758.

My guess is the problem is with the liquid spray, as at this point there are only parcels from the liquidSpray0. I have a debug version running that I will upload the log for if you want it.


2012-08-03 15:37


Thanks - the log file would be useful


2012-08-03 17:15


foam.log (58,048 bytes)


2012-08-03 17:15


sprayCloud_positions.obj (33,097 bytes)


2012-08-03 17:16


I've uploaded the logfile as well as the sprayCloud_positions.obj file that was spat out. Hope this is useful.


2012-08-03 17:34


Have you recompiled the OpenFOAM library after pulling commit 9c8ce25?


2012-08-03 18:48


I did an Allwmake, but I just noticed that the OpenFOAM library didn't fully recompile because of the polynomial commit. Did a full clean and compile and it appears that helped. The mapping appears to work, though there is still a subsequent crash that I'm not sure if its linked to the lagrangian or not. I'll run some more tests and get back to you.


2012-08-03 21:25


I'm going to leave the cases running over the weekend, as lagrangian stuff in debug always takes forever to run. This is what the optimized version gave:

Courant Number mean: 3.54942e-05 max: 0.0897122
deltaT = 1.08285e-06
Time = 4.67515e-05

Selected 66 cells for refinement out of 168100.
Refined from 168100 to 168562 cells.
Selected 0 split points out of a possible 66.
DICPCG: Solving for pcorr, Initial residual = 0.987988, Final residual = 5.1753e-07, No Iterations 11
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0

Solving cloud sprayCloud
#0 Foam::error::printStack(Foam::Ostream&) in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/lib/"
#1 Foam::sigSegv::sigHandler(int) in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/lib/"
#2 Uninterpreted:
 in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/sprayDyMFoam"
 in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/sprayDyMFoam"
 in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/sprayDyMFoam"
 in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/sprayDyMFoam"
 in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/sprayDyMFoam"
 in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/sprayDyMFoam"
 in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/sprayDyMFoam"
#10 __libc_start_main in "/lib/"
 at /usr/src/packages/BUILD/glibc-2.11.3/csu/../sysdeps/i386/elf/start.S:122
Segmentation fault


2012-08-06 09:47


Last edited: 2012-08-06 09:48

View 2 revisions

It's likely that this relates to the injection model as they generally cache the injection cell/tet/tet-face - which injection model are you using? this has been updated in our internal line, but not pushed to 2.1.x (as yet)


2012-08-07 18:42


For this simulation I was using the coneNozzle. The simulation hangs when solving for the sprayCloud when I'm running the code in debug mode, so unfortunately I haven't got a debug stack trace for you yet. Any advice for this, I know there is something to do with the array bounds checking that does odd things to lagrangian solving...


2012-08-08 12:47


You could try using the 'disc' injectionMethod (if not already doing so) as this will re-calculate the injection cell/tet addressing information


2012-08-08 17:43


Last edited: 2012-08-08 18:20

View 3 revisions

Under coneNozzleCoeffs, the injection method is listed as disc. Is there another setting I should change, or try another injectionModel?

EDIT: I tried the injectionMethod = point, and I didn't crash but the code hangs at evolving the spray.


2012-08-08 22:21


I increased the refinement frequency to each iteration, and the cloud evolution can at least move to after parcel injection (I get similar results by changing the distribution model to uniform).

Selected 12 cells for refinement out of 168100.
Refined from 168100 to 168184 cells.
Selected 0 split points out of a possible 12.

Solving cloud sprayCloud

--> Cloud: sprayCloud
    Added 30 new parcels

#0 Foam::error::printStack(Foam::Ostream&) in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/lib/"
#1 Foam::sigSegv::sigHandler(int) in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/lib/"
#2 Uninterpreted:
 in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/sprayDyMFoam"
 in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/sprayDyMFoam"
 in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/sprayDyMFoam"
 in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/sprayDyMFoam"
 in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/sprayDyMFoam"
 in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/sprayDyMFoam"
 in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/sprayDyMFoam"
 in "/home/gandalf/OpenFOAM/OpenFOAM-2.1.x/platforms/linuxGccDPOpt/bin/sprayDyMFoam"
#11 __libc_start_main in "/lib/"
 at /usr/src/packages/BUILD/glibc-2.11.3/csu/../sysdeps/i386/elf/start.S:122
Segmentation fault

Still trying to get some better debug info. Will keep posting interesting results.


2012-08-09 10:37


The final piece appears to be the mapping of the cloud source fields - this is now working in our development line, and I'll look to push similar changes into 2.1.x soon


2012-08-09 15:49


I've pushed the field mapping under commit 8ee747a - there may be some issues to do with the cell unrefinement, but this may need to be put on hold as an item for the next release.


2012-08-09 20:42


Thanks for the commits! Good news is that the code stops crashing, but its hangs right after parcels are added. Not sure if this is an issue with setup, will do my best to narrow the factors. Do you have an internal tutorial case that you have been testing against that works? If so could I try it out?


2012-08-10 09:47


sprayFoamDynamic_2.tgz (8,590 bytes)


2012-08-10 09:58


I've been running a slightly modified version of your original attachments (sprayFoamDynamic_2.tgz) - all should work well based on commit bfe8c6e.


2012-08-10 18:20


Very nice, the new version is working on my machine as well. Great job! One question I have is if this will work for moving meshes as well? In solvers like pimpleDyMFoam, there is a flux correction step that occurs (usually involving calls to meshPhi). But in compressible solvers I haven't seen one that does this.

This may not be the best place to continue discussion, so please feel free to email me: mturcios (at) westport (dot) com.

I don't know if this issue counts as fixed/resolved. I'll start testing this on some real world cases and give some feedback, if unrefinement is an issue I can run some tests for you if you'd like.

Once again, thanks for being so responsive to these reports!


2012-08-13 10:42


No problem - the mapping feature was lost in some of the upgrades to version 2.0 and it's good to get it up and running again.

These updates should work for moving mesh cases; however, there is still the limitation that not all injection models have been updated to accommodate the mapping, which will be resolved in the future.

Issue History

Date Modified Username Field Change
2012-03-16 20:12 user331 New Issue
2012-03-16 20:12 user331 File Added: sprayFoamDynamic.tar.gz
2012-07-26 00:01 user331 Note Added: 0001504
2012-07-26 10:26 user4 Note Added: 0001506
2012-07-26 12:27 user2 Note Added: 0001507
2012-07-26 18:02 user331 Note Added: 0001509
2012-07-27 00:31 user331 Note Edited: 0001509 View Revisions
2012-08-02 12:25 user2 Note Added: 0001537
2012-08-02 17:16 user331 Note Added: 0001542
2012-08-02 18:05 user2 Note Added: 0001543
2012-08-02 21:56 user331 Note Added: 0001544
2012-08-02 22:10 user331 Note Edited: 0001544 View Revisions
2012-08-03 15:37 user2 Note Added: 0001551
2012-08-03 17:15 user331 File Added: foam.log
2012-08-03 17:15 user331 File Added: sprayCloud_positions.obj
2012-08-03 17:16 user331 Note Added: 0001552
2012-08-03 17:34 user2 Note Added: 0001553
2012-08-03 18:48 user331 Note Added: 0001554
2012-08-03 21:25 user331 Note Added: 0001555
2012-08-06 09:47 user2 Note Added: 0001556
2012-08-06 09:48 user2 Note Edited: 0001556 View Revisions
2012-08-07 18:42 user331 Note Added: 0001569
2012-08-08 12:47 user2 Note Added: 0001576
2012-08-08 17:43 user331 Note Added: 0001577
2012-08-08 17:48 user331 Note Edited: 0001577 View Revisions
2012-08-08 18:20 user331 Note Edited: 0001577 View Revisions
2012-08-08 22:21 user331 Note Added: 0001578
2012-08-09 10:37 user2 Note Added: 0001579
2012-08-09 15:49 user2 Note Added: 0001580
2012-08-09 20:42 user331 Note Added: 0001582
2012-08-10 09:47 user2 File Added: sprayFoamDynamic_2.tgz
2012-08-10 09:58 user2 Note Added: 0001583
2012-08-10 18:20 user331 Note Added: 0001584
2012-08-13 10:42 user2 Note Added: 0001585
2012-08-13 10:43 user2 Status new => resolved
2012-08-13 10:43 user2 Fixed in Version => 2.1.x
2012-08-13 10:43 user2 Resolution open => fixed
2012-08-13 10:43 user2 Assigned To => user2