|
[Sponsors] |
January 4, 2012, 17:56 |
Modified mapFields?
|
#1 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
Hello all,
I've been doing some simulations using snappyHexMesh and other tools that requires re-meshing the domain and mapping of fields. I'm finding that the boundaries aren't strictly coincident which leads to problems when mapping. The differences are small, but cause eventual instability with the solver. The picture from the user manual will help explain: http://www.openfoam.org/docs/user/ma...p#x28-17500317. The problem for me occurs when there is a region outside the original geometry. Using a mapFieldsDict I get a mapping, but the grey region is populated with whatever the file residing in the target time directory specifies (which is usually uniform and much different than the surrounding values). What I was thinking of would be a modified (or even new) version of mapFields that does the following: 1) Map the boundary conditions (including values) from the source to the target. For non-coincident patches, there would need to be some interpolation, akin to stretching a balloon onto a rigid surface (this really only matter for patches on the boundary of the gray region; cuttingPlanes work fine for the "internal" boundaries). Perhaps this could be another set of patches in the mapFieldsDict, called interpolatePatches? 2) Map as much of the internal field of the target with data from the source 3) For regions like the gray area, perform some kind of interpolation between the mapped internal region and the interpolated boundary. This won't be perfect, but I hope it will result in a "smoother" field that runs a bit more stably. I'm going to start looking at the code for mapFields and see what I can learn, but I'm wondering if anyone has ever thought of this approach (or similar), or even if there has been any work done. One issue that may come up is when there is a patch in the target that is only partially outside of the source, in which case the behaviour would need to switch from cuttingPlane to interpolatePatch, which means we may have to do this face by face as opposed to patch by patch. Going to start digging, will let you know if I come across any nuggets of wisdom. Please let me know if there are other seams I can mine . |
|
January 9, 2012, 18:47 |
Some progress
|
#2 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
So I've made a modified version of mapFields that writes values to the cells of an inconsistent mesh that are outside the original mesh. I'm copying over the value from the nearest location in the new mesh that has a mapped value (identifying the cells that need values is already implemented.
I'm trying to make the search for the nearest location more efficient than N^2. I was looking at this thread and thought I could use the cellCells(cellI) function to only search the neighbour cells, but it seems list I get starts from 0. Is there a function (or simple piece of code) that give me a list of global cell indices for neighbour cells? |
|
October 18, 2012, 16:58 |
|
#3 |
Senior Member
Robert Castilla
Join Date: Apr 2009
Location: Spain
Posts: 110
Rep Power: 17 |
Hi, Marco,
I have the same problem as you. I am mapping to very similar (but nor identical) meshes and I am experiencing some stability problems due to the 0 values in certain cells. Have you made the modified mapFields to overcome this problem? Is it working? Regards Robert |
|
October 31, 2012, 06:26 |
|
#4 | |
Senior Member
Robert Castilla
Join Date: Apr 2009
Location: Spain
Posts: 110
Rep Power: 17 |
Hi, Marco,
I have programmed an utility that "corrects" the mapped fields with an auxiliary Mark fields, as you suggested. To access the neighbour cells with cellCell() you have to access to the global Id, identified by the local list returned by the function. I used a loop as following: Quote:
Regards Robert |
||
October 31, 2012, 12:33 |
|
#5 |
Senior Member
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 740
Rep Power: 28 |
Thanks Robert! I hadn't optimized the mapFields as there were only a small number of cells to modify, but this will be useful when we run on meshes that have a larger number of unmapped cells.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Issues with mapFields | BlackBoatNavArch | OpenFOAM Pre-Processing | 38 | May 28, 2021 17:29 |
Running mapFields with Parallel Source and Parallel Target | RDanks | OpenFOAM Pre-Processing | 4 | August 2, 2016 06:24 |
transientSimpleDyMFoam, mapFields and decomposePar | pad | OpenFOAM Running, Solving & CFD | 0 | December 3, 2010 06:22 |
mapFields ignores sourceTime for -parallel source | andersking | OpenFOAM Bugs | 2 | September 2, 2009 11:38 |
Modified Equation for CFX algorithm | Craig Johansen | CFX | 0 | August 28, 2004 00:02 |