|
[Sponsors] |
Import data fields for boundary conditions during run time |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 10, 2014, 09:49 |
Import data fields for boundary conditions during run time
|
#1 |
Senior Member
Join Date: Nov 2012
Location: Bavaria
Posts: 145
Rep Power: 14 |
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 |
|
April 10, 2014, 21:44 |
|
#2 |
Member
Christian Butcher
Join Date: Jul 2013
Location: Japan
Posts: 85
Rep Power: 13 |
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 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 |
|
April 11, 2014, 18:37 |
|
#3 | |
Senior Member
Join Date: Nov 2012
Location: Bavaria
Posts: 145
Rep Power: 14 |
Dear Christian,
thanks a lot for your reply! I have minimal programming skills, so please apologize my questions. Quote:
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 |
||
April 12, 2014, 11:24 |
|
#4 |
Senior Member
Joachim Herb
Join Date: Sep 2010
Posts: 650
Rep Power: 22 |
Have a look at the coupling boundary condition, e.g. https://github.com/OpenFOAM/OpenFOAM...lCoupledCavity
|
|
|
|
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 12:08 |
Micro Scale Pore, icoFoam | gooya_kabir | OpenFOAM Running, Solving & CFD | 2 | November 2, 2013 14:58 |
same geometry,structured and unstructured mesh,different behaviour. | sharonyue | OpenFOAM Running, Solving & CFD | 13 | January 2, 2013 23:40 |
I-DEAS CAD data import with boundary conditions | Yunus | Siemens | 1 | June 1, 2001 11:04 |
I-DEAS CAD data import with boundary conditions | Yunus | FLUENT | 2 | March 14, 2001 15:45 |