CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Running, Solving & CFD

mapFields - outlet to inlet BC

Register Blogs Community New Posts Updated Threads Search

Like Tree4Likes
  • 1 Post By rezaeimahdi
  • 3 Post By rezaeimahdi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   January 29, 2019, 08:28
Default mapFields - outlet to inlet BC
  #1
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10
gu1 is on a distinguished road
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).
Attached Images
File Type: jpg error.jpg (20.9 KB, 79 views)
gu1 is offline   Reply With Quote

Old   January 29, 2019, 10:26
Default
  #2
Member
 
rezaeimahdi's Avatar
 
mahdi
Join Date: Nov 2015
Location: Paris, France
Posts: 32
Rep Power: 11
rezaeimahdi is on a distinguished road
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
anaspauzi likes this.
rezaeimahdi is offline   Reply With Quote

Old   January 30, 2019, 14:50
Default
  #3
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10
gu1 is on a distinguished road
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.
gu1 is offline   Reply With Quote

Old   January 31, 2019, 10:36
Default
  #4
Member
 
rezaeimahdi's Avatar
 
mahdi
Join Date: Nov 2015
Location: Paris, France
Posts: 32
Rep Power: 11
rezaeimahdi is on a distinguished road
Quote:
Originally Posted by gu1 View Post
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
Attached Files
File Type: gz printPatchFaces.tar.gz (16.9 KB, 31 views)
gu1, lukasf and anaspauzi like this.
rezaeimahdi is offline   Reply With Quote

Old   January 31, 2019, 11:30
Default
  #5
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10
gu1 is on a distinguished road
Quote:
Originally Posted by rezaeimahdi View Post

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 is offline   Reply With Quote

Old   January 31, 2019, 11:33
Default
  #6
gu1
Senior Member
 
Guilherme
Join Date: Apr 2017
Posts: 245
Rep Power: 10
gu1 is on a distinguished road
I forgot the print...
Attached Images
File Type: jpg print.jpg (199.2 KB, 71 views)
gu1 is offline   Reply With Quote

Reply

Tags
mapfields, mapfieldsdict, openfoam 5.0


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 Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
MapFields help (inlet, outlet) iostam OpenFOAM Running, Solving & CFD 5 February 21, 2021 05:34
outlet pressure Boundary settings -velocity streamline under ambient temp.conditions Vishnu_bharathi CFX 12 November 21, 2017 07:56
pump outlet pressure higher than inlet pressure jstan3 FLUENT 14 February 14, 2014 00:44
Inlet and Outlet b.c. based on mass flux Hale OpenFOAM Pre-Processing 2 August 9, 2013 03:26
ATTENTION! Reliability problems in CFX 5.7 Joseph CFX 14 April 20, 2010 16:45


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