CFD Online Discussion Forums

CFD Online Discussion Forums (
-   OpenFOAM Running, Solving & CFD (
-   -   Inlet reading from a different case.. (

vishwa September 25, 2009 12:44

Inlet reading from a different case..
I have ran a case for a flow in channel. and I would like to use the outlet velocity as the inlet velocity in another case.

The mesh is exactly the same in that plane for both cases. How do i do that?
I am very new to OpenFoam so have no idea how to accomplish this task.


gricci October 1, 2009 06:39

:) I've been fiddling with it for a very long time! You need to use timeVaryingMappedFixedValue as boundary condition on the inlet of the target case. Look at the pitzDailyExptInlet tutorial (for OF-1.6) for an example. The field is mapped from the data under constant/boundaryData

You have to write a sampleDict to sample the field from the outlet patch of the source case. Choose foamFile as output.
(use the command

find -name sampleDict
under $WM_PROJECT_DIR/applications to find a commented example)

Give the command

sample -latestTime
this will produce a new directory named surface.

Eventually, you'll have to modify the coordinates in the file named points to make it agree with the coordinates of the target patch. You can use these values to map the field on your inlet.

As someone says... enjoy!

vishwa October 1, 2009 11:06

Thanks a lot for the info..I will try it out.. is there any way that I could also add some fluctuations to this field? for turbulence simulation..


gricci October 1, 2009 11:31

i've read about it several times but you 'd better wait for someone more experienced

maddalena February 12, 2010 11:03

inlet velocity from an inner surface velocity field
Hi FOAMers,

I would like to study more in detail the velocity field on a subdomain taken from a converged OF simulation. Since the overall velocity field of the source case influences the inlet velocity of the target domain, I was thinking about sampling data on an inner plane on the source case and use them as the inlet of the target case. Note that mesh and geometry of the target case is different from the source case.

I am able to sample data from the source case using sampleDict and obtaining the wanted surface, but I do not know how to put them on the inlet of the target case.Should I edit the cells coordinates manually as suggested above or is there a faster way to do this mapping? I also guess that mapFields is not an option in my case, since there is not a defined mesh or geometry correspondence between the source and target domain.

Any suggestion?



AlanR February 12, 2010 14:38

You can use timeVaryingMappedFixedValue for turbulence parameters like k and epsilon as well as velocity. Once you get gricci's suggestion working for velocity, try the same method for turbulence.


maddalena February 19, 2010 03:29

Thank you!
Thanks Alan, after some modifications on the initial surface data, I get timeVaryingMappedFixedValue working!

val46 February 18, 2011 08:55

2 Attachment(s)
Hi mad,

I used the sample command and changed the points by hand.
At time 0 my new case looks like this at the inlet (see attached picture 1).

Oh, by the way: It should look like picture 2


maddalena February 18, 2011 09:53

Hi Toni,
I do not know what is happening there... I think there is something wrong with your data interpolation on the new face...Why don't you try to sample only some lines on the original mesh and create a sort of interpolation by hand? It worked for me; however I had a pretty simple geometry...


val46 February 18, 2011 11:49

Oh, you mean you didn't sample the whole surface?

maddalena February 21, 2011 03:26


Originally Posted by val46 (Post 295956)
Oh, you mean you didn't sample the whole surface?

In the beginning I sampled the whole surface, but then I preferred to sample only some points and interpolate by hand..


mgg May 26, 2014 10:10


Originally Posted by val46 (Post 295956)
Oh, you mean you didn't sample the whole surface?

Hi val46,

Did you get your case working? With timevaryingmappedfixedvalue, I have also problem, the mapped results does not math the sampled field, even they have the same mesh geometry. It looks also ugly. Can you give me some tips?

All times are GMT -4. The time now is 17:15.