CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Mirror results (https://www.cfd-online.com/Forums/openfoam/96543-mirror-results.html)

MasterCooler January 25, 2012 09:52

Mirror results
 
Good afternoon,

I am looking for a way to mirror an existing solution for further processing on it.

I have found "mirrorMesh", but it doesn't do what I want as only the cells are mirrored not the boundary fields (at least if they are nonuniform). Mirroring in paraView is known to me as well but didn't work.

Can anybody provide some help?

Thanks in advance.

Cheers
MasterCooler

wyldckat January 28, 2012 03:34

Greetings MasterCooler,

Quote:

Originally Posted by MasterCooler (Post 341109)
Mirroring in paraView is known to me as well but didn't work.

Can you specify what didn't work with the reflect filter on ParaView?

Best regards,
Bruno

MasterCooler January 30, 2012 02:27

Problems with reflect-option in paraView
 
Good morning,

for a better understanding let me explain the background of my question a little further:
I have done a simulation with a model which is symmetric why I have simulated it by a half only. Now I want to use that model for derive the boundary conditions of a submodel which is not symmetric anymore. Therefore I looked to mirror the first solution before mapFields is used.

The problem is that mapFields operates on the time folders and I can't save the reflected solution as a new timefolder, isn't it?

Thanks for further advice.

Cheers
MasterCooler

wyldckat January 30, 2012 06:16

Hi MasterCooler,

Mmm... I suppose the quickest solution, without looking deeper into this, is to load one patch at a time:
  1. Load your symmetric case in ParaView.
  2. Apply the Reflect filter. (I know, but keep reading.)
  3. In the "Object Inspector -> Properties" on the first open case file, you should see a small list box that lists all of the regions, including internal mesh, patches and some other things, such as zones. De-select the internal mesh and select a patch.
  4. Extract the info you need and perhaps export it if necessary (File -> Save Data).
  5. Go back to the first file and choose another patch. Hit the "Apply" button and it will auto-update the reflection.
If you have gazillions of patches, then use the Python macro system: Tools -> Start Trace

Good luck!
Bruno

MasterCooler January 30, 2012 06:50

Hey Bruno,

so far so good. I have done it in the similar way before. But how can I process the exported data further?

I tried to mirror the halve mesh by mirrorMesh and applying the exported data on it, so that a complete new time folder is created. But it doesn't work obviously as the numbering of the mirrored Mesh and the exported data don't fit to each other.

Further I explicitly need the internalMesh for further processing what caused other problems as the number of cells of the mirrored mesh and exported data from the reflected mesh don't fit to each other.

Many thanks for your advice.

Cheers
Ben

wyldckat January 31, 2012 16:02

Hi Ben,

I don't if you're going to like this answer, but it's the best I can figure out: you will have to create a hybrid application that merges mirrorMesh with mapFields.

Basically:
  • mirrorMesh was designed for only mirroring the mesh itself.
  • mapFields was designed for only interpolating/copying values from one mesh to another, where both meshes represent the same exact volume.
The simplest solution might a half-way merger, where:
  • Still use mirrorMesh for creating the mirrored mesh.
  • Then create a mapMirroredFields, where the fields are interpolated/copied onto both sides of the mesh.
Good luck!
Bruno

MasterCooler February 1, 2012 02:11

Good morning Bruno,

your comments according mirrorMesh and mapFields fit exactly to my experience.

Currently my programming ability is still weak but I will take the opportunity and try to create that mapMirroredFields soon and provide it here afterwards.

In advance thanks a lot for your time and help.

Have a nice day.

Cheers
Ben

CFD-Cat December 4, 2014 12:38

mapMirroredFields
 
Hi,
I'm facing the same problem. Did you create the mapMirroredFields application?
Cheers

Quote:

Originally Posted by MasterCooler (Post 342209)
Good morning Bruno,

your comments according mirrorMesh and mapFields fit exactly to my experience.

Currently my programming ability is still weak but I will take the opportunity and try to create that mapMirroredFields soon and provide it here afterwards.

In advance thanks a lot for your time and help.

Have a nice day.

Cheers
Ben


dpg August 4, 2016 18:09

Hi,

I am also facing the same issue. Is there a way to map the mesh and results of a symmetric case(1/4th of original geometry) to the entire geometry and ensuring that the resulting mesh and results are consistent

gtarang May 19, 2018 10:44

Hi,
any update on mirrormeshfield application?

lukasf June 11, 2018 11:00

I tried this approach and it is not giving me what I need.

My aim is to mirror an existing mesh and mirror the boundary / initial conditions as well.
I used mirrorMesh to mirror the mesh. The next step would be to mirror the boundary conditions (which are not constant and are therefore given by a list) because the cell size has doubled due to the mirrored mesh.
I used paraview and opened the old mesh (which is not mirrored). I used the Reflect filter copy the input. As you said I have only chosen one patch (e.g. the inlet of a pipe). The filter worked and mirroed the mesh and the data. When I opened a spreadsheet in paraview I could chose cell data and exported the needed data to a .csv file.
My idea was to take this list and exchange it with the old (not mirrored) cell data in the mirrored CFD case. Due to the mirroring of the mesh the cell numbering or whatever is changed. Therefore the new list did not result in mirrored values.
By closer inspection I could see that the Reflect filter from paraview only copied the list and appended it to the end of the list.
What I obviously need is a list which has the correct order.


Quote:

Originally Posted by wyldckat (Post 341871)
Hi MasterCooler,

Mmm... I suppose the quickest solution, without looking deeper into this, is to load one patch at a time:
  1. Load your symmetric case in ParaView.
  2. Apply the Reflect filter. (I know, but keep reading.)
  3. In the "Object Inspector -> Properties" on the first open case file, you should see a small list box that lists all of the regions, including internal mesh, patches and some other things, such as zones. De-select the internal mesh and select a patch.
  4. Extract the info you need and perhaps export it if necessary (File -> Save Data).
  5. Go back to the first file and choose another patch. Hit the "Apply" button and it will auto-update the reflection.
If you have gazillions of patches, then use the Python macro system: Tools -> Start Trace

Good luck!
Bruno


MazenDraw October 2, 2019 08:44

I have found a way around this if anyone is interested:
- copy the original case with the wanted results
- in the copied case, excute rotateMesh on the time folder with the wanted results. This will rotate the results with the mesh to create a symmetric case of your original one
- in the combined case, excute mapFields twice. Once for the original case and once for the copied symmetric case. This should combine both results in one time folder.


I hope this would help someone someday!


All times are GMT -4. The time now is 14:11.