particle tracking & topo changes -> simulation crashes in 1.6-ext
Hi,
I try to track particles is a domain with changing topology in OpenFOAM-1.6-ext. Therefore i use a small test case where i add a single kinematic parcel in a cylindrical domain with increasing length in axial direction. Running the case gives Code:
/*---------------------------------------------------------------------------*\ After some debugging i found that the exception occurs during the topo change in the makeWeights() member function of the class volPointInterpolation Code:
// Calculate inverse distances between cell centres and points I have no idea how to fix this issue, maybe someone can help me with that. I put the solver (based on the transientSimpleDyMFoam, added particle tracking) and the test case in my dropbox solver: https://dl.dropbox.com/u/86131187/ip...pleDyMFoam.zip test case: https://dl.dropbox.com/u/86131187/mo...DBlockMesh.zip Have a nice day, Klaus |
Hi,
any ideas about this topic? Best Klaus |
Klaus,
I have same troubles with dieselEngineDyMFoam in 1.6-ext. Look at here http://www.cfd-online.com/Forums/ope...tml#post398168 Did you solve a problem? Any ideas? |
Hi,
as far as i understand the topo change procedure is the following: 1.) Detect if a new cell layer have to be created. 2.) If yes create the layer. At this time the new cell have a volume equal to zero. 3.) perform mesh movement, this means "extrude" the new cell layer in movement direction. After this step the cells of the new layer have a well defined volume > 0. I think the problem is that after step (2) the volPointInterpolation is performed. But as mentioned above the cells are not well defined at this time (how to calculate the cell centre of a cell with V=0?). Thus volPointInterpolation may crash with a FPE. My workaround is to call the makeWeights() member function of the volPointInterpolation (volPointInterpolation.C) only if all cell centres are within the mesh bounding box. This should not be a problem in layer addition/removal topo changes as the volPointInterpolation is called again in step 3 where the cell centres are correctly defined. If you have comments on that solution please tell me, maybe (or i'm sure) there is a better way to solve the problem. Best, Klaus |
Thanks for comments, Klaus.
I also suspect that what you're saying. But unfortunately I'm not good in the OpenFOAM code. How your idea will look in C++? What files needed to modify? |
HI,
in the file volPointInterpolation.C /OpenFOAM/OpenFOAM-1.6-ext/src/finiteVolume/interpolation/volPointInterpolation i mofified the updateMesh() member function Code:
... This is a quick and dirty hack, but i have not thought about a better solution :eek: It may also be not very efficient to check all cell centres - as i said, it's a hack ;) best, Klaus |
Thank you, Klaus.
It really works! Quote:
|
Hi, I am having the same problem in OpenFOAM-2.0.x.
The member function has changed since 1.6-ext, so I try to pull something very similar. Old code is: void volPointInterpolation::updateMesh() { makeWeights(); makePatchPatchAddressing(); } changed to: void volPointInterpolation::updateMesh() { const boundBox &bb = mesh().bounds(); const vectorField& cellCentres = mesh().cellCentres(); bool updateWeights = true; forAll(cellCentres,celli) { if (!bb.contains(cellCentres[celli])) { updateWeights = false; } } if (updateWeights){ makeWeights(); makePatchPatchAddressing(); } } But the problem is still there. I would still run into makeWeight error. Did I understand the idea wrong? any help is appreciated. Thanks, J |
HI,
sorry no idea, code looks fine. Have you tried to put debug statements into the code to ensure everything runs fine? By the way, i tried particle tracking and topo changes in OF2.1.x and didn't recognize above mentioned problems. Best, Klaus |
All times are GMT -4. The time now is 19:08. |