|
[Sponsors] |
[PyFoam] Using pyFoam to extract BCs from text file and automate my own solver |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
December 3, 2014, 08:03 |
Using pyFoam to extract BCs from text file and automate my own solver
|
#1 |
New Member
Edward Shorthouse
Join Date: Dec 2014
Posts: 2
Rep Power: 0 |
Hello all,
I have a text file with 40 sets of boundary conditions (4 parameters in each BC set). I'm trying to use pyFoam to extract one BC set at a time and feed into my case, and to run my own solver on that case (a variant of buoyantBoussinesqSimpleFoam). Q: Do I need a separate text file for each boundary condition, or can pyFoam extract the values for each of the 40 BC parameters from a single text file? Once each case has converged I want to take the BCs from the last time step of that case and use as the first time step for the next case. Can all the above be done using one pyFoam utility? If so, which one is most appropriate. Thanks! Last edited by e.shorthouse; December 3, 2014 at 08:04. Reason: format of table looked wrong |
|
December 3, 2014, 09:44 |
|
#2 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
December 3, 2014, 10:47 |
|
#3 |
New Member
Edward Shorthouse
Join Date: Dec 2014
Posts: 2
Rep Power: 0 |
Thanks Bernhard, by BC I mean boundary conditions for my 0 time directory. All the boundary conditions are set by me (the user) which are in a separate text file.
The 4 user variables (in addition to the standard ones 'k', 'epsilon' etc which are kept the same for each case) used in the boundary conditions are: wall surface temp, floor surface temp, relative humidity and air speed. I have 40 sets of values for these variables which I want to run on my case. I've attached the text file with the user variables. I am running my solver on the same mesh using the 40 different user set boundary conditions (so I have 40 cases because the boundary conditions are different every time). This is what I want to automate with pyFoam. Running 40 cases in series will take a long time, so to speed up convergence for each case, I want to use the latestTime directory from the previous converged case to start off my run for the next case. Hope that makes sense, Thanks |
|
December 3, 2014, 11:22 |
|
#4 | |
Assistant Moderator
Bernhard Gschaider
Join Date: Mar 2009
Posts: 4,225
Rep Power: 51 |
Quote:
Two problems with that: - apart from the online-help there is no documentation on this - it varies the 4 parameters independently and judging from that you have 40 sets this is not applicable for your case Apart from that I think you'll have to write a script yourself. Something like http://openfoamwiki.net/index.php/Co...eter_Variation The main "challenge" would be getting the values into the script but the DictReader from https://docs.python.org/2/library/csv.html might be your friend here
__________________
Note: I don't use "Friend"-feature on this forum out of principle. Ah. And by the way: I'm not on Facebook either. So don't be offended if I don't accept your invitation/friend request |
||
Tags |
pyfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using fluent loop to automate write to the file | Eman. | FLUENT | 1 | November 17, 2017 04:02 |
Hybrid discretisation - blend factor | gcoopermax | CFX | 5 | September 23, 2016 09:05 |
Flow 3D Cast Exporting Output as Text File | shantanu1 | FLOW-3D | 0 | October 30, 2015 12:51 |
Journal file to automate a time step change | Damien_CFD | FLUENT | 0 | August 2, 2011 08:05 |