CFD Online URL
[Sponsors]
Home > Forums > OpenFOAM Running, Solving & CFD

Mapping a boundary condition from file

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

Reply
 
LinkBack Thread Tools Display Modes
Old   February 23, 2007, 16:16
Default I'm simulating a non-periodic
  #1
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,891
Rep Power: 25
alberto will become famous soon enoughalberto will become famous soon enough
I'm simulating a non-periodic channel and I need to impose a velocity at the inlet BC which is read from a file at each time step. Each file contains the whole velocity field on the face from a previous simulation.

How can I do this in OF?

Regards,
Alberto
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   February 24, 2007, 06:46
Default This is indeed a very interest
  #2
Member
 
stefan
Join Date: Mar 2009
Posts: 96
Rep Power: 7
stefanke is on a distinguished road
This is indeed a very interesting question!

Does anyone know how to do this in a "smart" way?
stefanke is offline   Reply With Quote

Old   February 24, 2007, 07:21
Default Hi, Good day! There exis
  #3
Senior Member
 
Philippose Rajan
Join Date: Mar 2009
Location: Germany
Posts: 527
Rep Power: 15
philippose will become famous soon enough
Hi,
Good day!

There exists a boundary condition in OpenFOAM called:

timeVaryingUniformFixedValue

This basically reads the values of the patch for each time step from a given data file, complete with interpolation for timesteps not explicitly specified in the data file.

The limitation of this boundary condition is, that it reads in one "uniform fixed Value" and not a field, which is then applied to the entire patch.

For more information on this BC, run a search through the forum for "timeVaryingUniformFixedValue". There was quite a bit of discussion regarding the topic some time back.

You might also want to search for "parabolic inlet velocity profile" in the forum... this might give you pointers on how to modify the code for reading in complete fields from data-files rather than just a uniform fixed value.

Since openFOAM is so vast, it might also be possible that there already exists some form of boundary condition which lets you read in fields from files too :-)!

Enjoy!

Philippose
philippose is offline   Reply With Quote

Old   February 24, 2007, 09:20
Default I think it is quite useful to
  #4
Member
 
stefan
Join Date: Mar 2009
Posts: 96
Rep Power: 7
stefanke is on a distinguished road
I think it is quite useful to have such a BC in OpenFOAM.

Is there anyone out there who has already implemented such a BC?
stefanke is offline   Reply With Quote

Old   February 24, 2007, 11:19
Default Thanks you both. I know ab
  #5
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,891
Rep Power: 25
alberto will become famous soon enoughalberto will become famous soon enough
Thanks you both.

I know about the timeVaryingUniformFixedValue BC. My main issue is how can I read and map the field extracted from a face in one case, onto my inlet patch.

In other words, how can I be sure the values in a cell of the "source face" are assigned to the right one on the inlet face?

Regards,
Alberto
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   February 25, 2007, 07:21
Default Hello, I have implemented a
  #6
Member
 
Hannes Kröger
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 92
Rep Power: 8
hannes is on a distinguished road
Hello,

I have implemented a boundary condition called "timeVaryingNonuniformFixedValue" which does what you want.
It reads the boundary fields at some time instants from files and interpolates the fields in time to the current time step.

You can get it here:
http://palamedes.fms.uni-rostock.de/...FixedValue.tgz

I think, I will put it into the wiki and describe it there in more detail.

Regards, Hannes
hannes is offline   Reply With Quote

Old   February 25, 2007, 13:19
Default Thanks Hannes! I'll try it
  #7
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,891
Rep Power: 25
alberto will become famous soon enoughalberto will become famous soon enough
Thanks Hannes!

I'll try it immediately :-)

Regards,
Alberto
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   February 26, 2007, 04:53
Default If you can afford to wait a li
  #8
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 15
mattijs is on a distinguished road
If you can afford to wait a little bit longer: 1.4 will have a timeVaryingMappedFixedValue which does interpolation in time and space (by triangulating data points).
mattijs is offline   Reply With Quote

Old   February 26, 2007, 06:23
Default Thanks Mattijs. I lost it read
  #9
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,891
Rep Power: 25
alberto will become famous soon enoughalberto will become famous soon enough
Thanks Mattijs. I lost it reading the release notes :-)

Could you please give to me a rough estimate of the release date?

Regards,
Alberto
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   February 26, 2007, 11:14
Default Hello Alberto, I'm sorry fo
  #10
Member
 
Hannes Kröger
Join Date: Mar 2009
Location: Rostock, Germany
Posts: 92
Rep Power: 8
hannes is on a distinguished road
Hello Alberto,

I'm sorry for the lack of informative error messages, I haven't found the time for making the code comfortable (And it seems to get superfluous soon, as I read).

There was indeed a little bug in the code: it used a relative path. So the code only works if you start the solver from inside the case directory (I almost always start it that way, so I didn't notice the bug)

And the files with the instanteneous fields should start with the number of list entries that they contain (Just the file format, that the "List"-reader expects)

You can download an example-case here:
http://palamedes.fms.uni-rostock.de/~hannes/example.tgz

and a bug-fixed version of the BC:
http://palamedes.fms.uni-rostock.de/...FixedValue.tgz

Hope it works, Hannes
hannes is offline   Reply With Quote

Old   February 26, 2007, 14:26
Default Hello Alberto, I hope we ca
  #11
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 15
mattijs is on a distinguished road
Hello Alberto,

I hope we can release next month. Hannes, seems yours does not do any interpolation so could be more useful when replaying previous simulation data. The 1.4 version will do interpolation so is more suited for e.g. measurement data.

You might want to have the field in the path as well so you can have more than one field.
mattijs is offline   Reply With Quote

Old   February 26, 2007, 16:23
Default Hello Hannes, thanks a lot fo
  #12
Senior Member
 
Alberto Passalacqua
Join Date: Mar 2009
Location: Ames, Iowa, United States
Posts: 1,891
Rep Power: 25
alberto will become famous soon enoughalberto will become famous soon enough
Hello Hannes,
thanks a lot for your help.

I've just tried your new code and it works perfectly :-)

With kind regards,
Alberto
__________________
Alberto Passalacqua

GeekoCFD - A free distribution based on openSUSE 64 bit with CFD tools, including OpenFOAM. Available as live DVD/USB, hard drive image and virtual image.
OpenQBMM - An open-source implementation of quadrature-based moment methods
alberto is offline   Reply With Quote

Old   December 29, 2007, 05:59
Default Hello Mattijs Janssens: what
  #13
New Member
 
Sam Lee
Join Date: Mar 2009
Location: Shanghai, P.R.China
Posts: 4
Rep Power: 7
gameoverli is on a distinguished road
Hello Mattijs Janssens:
what I have now is OpenFoam-1.4.1 which contains the timeVaryingMappedFixedValue BC may do what I need. I have a profile file exported from FLUENT and I need use it as inlet boundary condition in OF. since I can generate a time series based on the FLUENT file, I do not need interpolation in time, but I do need interpolation in space. Does timeVaryingMappedFixedValue BC do this trick, and can you provide some kind of tutorials using this BC?

Thanks a lot
gameoverli is offline   Reply With Quote

Old   December 29, 2007, 09:49
Default From a search for timeVaryingM
  #14
Super Moderator
 
Mattijs Janssens
Join Date: Mar 2009
Posts: 1,416
Rep Power: 15
mattijs is on a distinguished road
From a search for timeVaryingMappedFixedValue:

http://www.cfd-online.com/cgi-bin/Op...6977#POST16977
mattijs is offline   Reply With Quote

Old   April 14, 2008, 15:21
Default Hi Hannes I tried instal
  #15
Senior Member
 
Nishant
Join Date: Mar 2009
Location: Glasgow, UK
Posts: 165
Rep Power: 7
nishant_hull is on a distinguished road
Hi Hannes

I tried installing and recompiling your timeVaryingNonuniformFixedValue patch with my OF-1.4.1 installation. But unfortunately I found some error while recompiling it. Can you tell me, what's going wrong?

The error reported is:
lnInclude/fixedValueFvPatchField.C:41: note: Foam::fixedValueFvPatchField<type>::fixedValueFvPa tchField(const Foam::fvPatch&, const Foam::DimensionedField<type,>&) [with Type = double]
make: *** [Make/linuxGccDPOpt/timeVaryingNonuniformFixedValueFvPatchFields.o] Error 1

regards,
Nishant
__________________
Thanks and regards,

Nishant
nishant_hull is offline   Reply With Quote

Old   May 25, 2009, 12:09
Default
  #16
Member
 
Leonardo Giampani Morita
Join Date: Apr 2009
Location: Paris, France
Posts: 58
Rep Power: 7
leonardo.morita is on a distinguished road
Hello,

My problem is slightly different: I'd like to use a profile obtained from a previous simulation as a boundary condition, which is constant in time. I simulate a jet in cross-flow, so I'll first develop my turbulent jet profile and then use it in the final system.

I searched here in the forum and I found two options already implemented: timeVaryingMappedFixedValue, discussed above, and directMapped. However, I don't know yet if they are appropriate to my case, the reasons are given bellow.

TimeVaryingMappedFixedValue interpolates given data, which is not necessary for me.

- doing so could bring numerical errors, couldn't it?
- assuming then that these errors are negligible: this BC is made for a transient BC case, but even so could I use it for my stationary BC problem?
- and one last question for this BC: since my results would be mapped using mapFields, a priori I wouldn't have position data. Could I use the sample utility to resolve this problem?

Concerning the other BC, directMapped: this one may be more suitable for me, but I still have some questions about it...

- does it work like the cyclic BC, imposing that the inlet (for example) profile is equal to that one at an arbitrary plane?
- in my case, how should I initializate it? Since the BCs in the previous simulation will be cyclic, is it possible to "trick" mapFields mapping all my boundary and internal fields and then changing their type for the final simulation?
- how does the averaging function work (I don't think I'll use it, but...)?

Anyway, I see that both BCs don't do exactly what I need, so I'd like to ask here if anybody know a more suitable way to map a BC. And it would be very nice too if you could give me hints to answer my questions =)

Thank you.

Leonardo
leonardo.morita is offline   Reply With Quote

Old   May 26, 2009, 04:59
Default
  #17
Member
 
Leonardo Giampani Morita
Join Date: Apr 2009
Location: Paris, France
Posts: 58
Rep Power: 7
leonardo.morita is on a distinguished road
After some more research, an update of my questions:

- in the tutorial case, I see that directMapped is used to develop a flow from a uniform internal field, i.e., no mapped solution is applied. In order to save computational time using this BC, is it possible to start with an already developped flow, as I've explained before?
- I've read in the User Guide that mapFields can map different boundary types, but how this works exactly? Should I only mention that the fields are inconsistent and list these patches in the patchMap subdictionary? (I know this question is not related to the subject of this thread, however it's quite simple and linked to my case, so I thought it might be more pratical to post it here anyway...)

Thank you!
leonardo.morita 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
Mapping and patching boundary conditions Ale CD-adapco 1 January 5, 2007 08:59
Mapping the boundary condition pialisen FLUENT 2 December 6, 2006 00:23
Problem setting boundary condition from file Antonis CFX 1 September 11, 2006 17:53
setting boundary condition in journal file Mazyar FLUENT 1 May 3, 2006 20:08
set boundary condition in Neutral file, in Gambit Vito Chow FLUENT 2 April 26, 2005 07:50


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