CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   mapFields - outlet to inlet BC (https://www.cfd-online.com/Forums/openfoam-solving/214375-mapfields-outlet-inlet-bc.html)

gu1 January 29, 2019 07:28

mapFields - outlet to inlet BC
 
1 Attachment(s)
Hi,

I'm trying to map the velocity profile that has developed into a geometry (channel - cyclic domain) for inlet of a new geometry (backward facing step) and I'm having difficulties.

I added the mapFieldsDict file with the following configuration:
Code:

patchMap        (cyclic inlet);
When I run the command inside the destination folder:
Code:

mapFields ../Folder that will yield the velocity profile/ -sourceTime latestTime
I am not succeeding, by image below. Can anybody help me?
There is a mapping of the whole domain and not just the inlet as I would like, not to mention that it is not location in the inlet of the new geometry.

The simulation is in RANS and therefore the channel domain is small (cyclic).

rezaeimahdi January 29, 2019 09:26

Hello

Just one idea,

export the velocity profile in the boundary that you want (for example in Paraview)

then using printPatchFaces (I compiled it in OpenFOAM 4.1 and it worked) to export mesh data in the inlet of new geometry

and finally, do the interpolation (in Matlab for example) to have correct value in each mesh

Hope it helps you

gu1 January 30, 2019 13:50

Hi,

Could you explain in more detail how you did it?
I tried it today, but I lost it to exhaustion... I could not succeed and I think it's something simple to do, even using mapFields.

rezaeimahdi January 31, 2019 09:36

1 Attachment(s)
Quote:

Originally Posted by gu1 (Post 723388)
Hi,

Could you explain in more detail how you did it?
I tried it today, but I lost it to exhaustion... I could not succeed and I think it's something simple to do, even using mapFields.

Hello

This is a method I have used a few years ago on OpenFOAM 2.3 to implement some experimental data as an inlet in my simulation. Let me explain step by step:

1) Export the velocity profile you need from the outlet of the last simulation. You can do it in Paraview for example and it is easy to do.

2) Compile printPatchFaces code (in attached) on your OpenFOAM and run it in new case directory (Don't forget to modify the exist Boundary name in printPatchFaces.C file. By default its "inlet"). This will extract the cell centers in the inlet of new geometry which you would like to impose the new data.

3) To find the exact value in each cell, now you have to do interpolation (on Matlab or octave) between the velocity profile (U,x) and new mesh cell centers.

Finally, you can use these results as new BC for the new case.

Let me know if you have any further questions.

Hope it helps you

Good luck

gu1 January 31, 2019 10:30

Quote:

Originally Posted by rezaeimahdi (Post 723455)

Let me know if you have any further questions.

Hello,
Thanks for your response.

1) In step one I used the sampleDict tool to pick up the velocity field in the center of the cells. Check.

2) I did what you recommended, I compiled the file in OpenFOAM 5.0 and I used the tool in both my two geometries (...the one that will export the velocity profile "OLD" and the one that will receive this velocity profile "NEW"). I attached a print below for the effect of curiosity.
DETAIL: They have the same center, and consequently would not require interpolation of the values (I think not) because the input of one is equal to another and consequently I used the same number of divisions. Pay attention to the values of Y. Check.

3) What I have to do now?
I do not know what to do with the information. How do I tell OpenFOAM the value in the center of these cells? Would you have an example?!

OBS: It's a 2D geometry, I just extract the Ux values, will I have problems with that?

Best.

gu1 January 31, 2019 10:33

1 Attachment(s)
I forgot the print...


All times are GMT -4. The time now is 20:34.