CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Pre-Processing

Modified mapFields?

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   January 4, 2012, 17:56
Default Modified mapFields?
  #1
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 725
Rep Power: 18
mturcios777 will become famous soon enough
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 .
mturcios777 is offline   Reply With Quote

Old   January 9, 2012, 18:47
Default Some progress
  #2
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 725
Rep Power: 18
mturcios777 will become famous soon enough
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?
mturcios777 is offline   Reply With Quote

Old   October 18, 2012, 15:58
Default
  #3
Member
 
Robert Castilla
Join Date: Apr 2009
Location: Spain
Posts: 79
Rep Power: 8
rcastilla is on a distinguished road
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
rcastilla is offline   Reply With Quote

Old   October 31, 2012, 06:26
Default
  #4
Member
 
Robert Castilla
Join Date: Apr 2009
Location: Spain
Posts: 79
Rep Power: 8
rcastilla is on a distinguished road
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:
forAll(mesh.cellCells()[cellI],cellII)
{
label cellId = mesh.cellCells()[cellI][cellII];
..........
your code here
cellId is the global identifier for the neighbour cell
............
}
Hope it will help you, if you have not already found the solution by your means...

Regards

Robert
rcastilla is offline   Reply With Quote

Old   October 31, 2012, 12:33
Default
  #5
Senior Member
 
mturcios777's Avatar
 
Marco A. Turcios
Join Date: Mar 2009
Location: Vancouver, BC, Canada
Posts: 725
Rep Power: 18
mturcios777 will become famous soon enough
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.
mturcios777 is offline   Reply With Quote

Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Issues with mapFields BlackBoatNavArch OpenFOAM Pre-Processing 31 March 31, 2015 11:37
Running mapFields with Parallel Source and Parallel Target RDanks OpenFOAM Mesh Utilities 2 June 6, 2011 07:56
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 10:38
Modified Equation for CFX algorithm Craig Johansen CFX 0 August 27, 2004 23:02


All times are GMT -4. The time now is 00:41.