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

Import data fields for boundary conditions during run time

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By jherb

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 10, 2014, 08:49
Default Import data fields for boundary conditions during run time
  #1
Senior Member
 
Join Date: Nov 2012
Location: Bavaria
Posts: 145
Rep Power: 13
aylalisa is on a distinguished road
Dear Foamers,

Is it possible to import data during run time and map it on the inlet patch?
The data could be the result of another case, from measurements or artificially created and saved in text files.

I would like to periodically read in the prepared data fields during run time.

I did not find a possible approach in swak4foam (funkySetFields, groovyBC), please correct me if I am wrong.

Each answer is appreciated!

Aylalisa
aylalisa is offline   Reply With Quote

Old   April 10, 2014, 20:44
Default
  #2
Member
 
Christian Butcher
Join Date: Jul 2013
Location: Japan
Posts: 85
Rep Power: 12
chrisb2244 is on a distinguished road
You could code a library function to do that. You'd need to pass the field you wanted to change, probably, so that you didn't change the internal field (you want that to remain as it is, right?)

Then you can set boundary values using something like
Code:
field.boundaryField()[patchNumberForInlet] == setOfNewValues
The difficult bit is I guess formatting the new values in a way that OF likes?
What setup do you have for your text files?
Do you have a list of values, one per patch face? If so, should be pretty doable.
If you have a different number of values, I suppose you'll need to reconstruct a new patch face - maybe the mapFields utility could help you here, but I have no idea how it works and haven't used it.

Best,
Christian
chrisb2244 is offline   Reply With Quote

Old   April 11, 2014, 17:37
Default
  #3
Senior Member
 
Join Date: Nov 2012
Location: Bavaria
Posts: 145
Rep Power: 13
aylalisa is on a distinguished road
Dear Christian,

thanks a lot for your reply!

I have minimal programming skills, so please apologize my questions.

Quote:
You'd need to pass the field you wanted to change, probably, so that you didn't change the internal field (you want that to remain as it is, right?)
Do you mean the field in my OF case, e.g. velocity field U at the inlet (of a channel or pipe geometry) that will get the new values (caculated by a function or measurements) ?

I would prefer to do all the data formatting before transfering it to the library function, maybe with Python because it seems to me to be easier to handle it there.
In Python I could probably produce each kind of format. But in which format does OpenFOAM accept the values? My first idea is a *.xy file with one column (according to the cell ordering of the area I want to provide with the data?

Do you think I destroy to much of the field information if I do some kind of interpolation with the field data to finally match the number of patch faces???

mapFields works good to map Fields from a source case to a target case before simulation starts. I need a mapFields function that runs periodically through the source case volume field (with the mapped measurement data) maybe during the run.

At the moment this is still an idea. Yet I am busy with existing utilites (that don't cooperate).

Best regards,
Aylalisa
aylalisa is offline   Reply With Quote

Old   April 12, 2014, 10:24
Default
  #4
Senior Member
 
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 21
jherb is on a distinguished road
Have a look at the coupling boundary condition, e.g. https://github.com/OpenFOAM/OpenFOAM...lCoupledCavity
aylalisa likes this.
jherb is offline   Reply With Quote

Reply


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
Extrusion with OpenFoam problem No. Iterations 0 Lord Kelvin OpenFOAM Running, Solving & CFD 8 March 28, 2016 11:08
Micro Scale Pore, icoFoam gooya_kabir OpenFOAM Running, Solving & CFD 2 November 2, 2013 13:58
same geometry,structured and unstructured mesh,different behaviour. sharonyue OpenFOAM Running, Solving & CFD 13 January 2, 2013 22:40
I-DEAS CAD data import with boundary conditions Yunus Siemens 1 June 1, 2001 10:04
I-DEAS CAD data import with boundary conditions Yunus FLUENT 2 March 14, 2001 14:45


All times are GMT -4. The time now is 19:35.