|
[Sponsors] |
Update boundary conditions calculated by an external program |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
January 13, 2010, 16:16 |
Update boundary conditions calculated by an external program
|
#1 |
Member
Cedric Van Holsbeke
Join Date: Dec 2009
Location: Belgium
Posts: 81
Rep Power: 16 |
How can I update boundary conditions, calculated by an external program, in OpenFoam 1.6 while running a case?
The program was originally written for Fluent. It generates a file boundary.txt which contains pressure boundary conditions. Fluent reads these boundary conditions, iterates 30 times and outputs some variables in a file var.txt. This file is read in the external program and this program calculates new boundary conditions in the file boundary.txt which is read in Fluent, ... The process is stopped when the program generates a stop file. The journal file for Fluent is rather straigthforward: Code:
(do ((iter 1 (+ iter (rpgetvar 'stop-the-journal)))) ((> iter 1)) (ti-menu-load-string (format #f "file read-bc \"boundary.txt\" ")) (ti-menu-load-string (format #f "solve iterate 30")) (ti-menu-load-string (format #f "report all sorts of variables \"var.txt\" ")) ... )
Is there a better method, comparable to the Fluent script, to achieve this? Last edited by CedricVH; January 13, 2010 at 16:44. |
|
January 15, 2010, 05:26 |
|
#2 |
Member
Cedric Van Holsbeke
Join Date: Dec 2009
Location: Belgium
Posts: 81
Rep Power: 16 |
The text replacement is faster than foreseen and is not the bottleneck!
However, when running MPI cases, my method does not work anymore as the boundary conditions are spreaded across the several processor directories. Is there a way to change the boundary conditions in a generic way like the command "file read-bc" in Fluent? |
|
January 15, 2010, 11:55 |
|
#3 |
Member
Cedric Van Holsbeke
Join Date: Dec 2009
Location: Belgium
Posts: 81
Rep Power: 16 |
It seems that this is not possible and that I have to use another boundary field than fixedValue.
I've looked at timeVaryingUniformFixedValue, but the values have to be known before the run starts and it interpolates the values. I'm searching for a boundary field that can read boundary conditions at runtime and does not interpolate. I'm rather new to OpenFoam so I don't know how to modify an existing boundary field. Maybe somebody can help me? |
|
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Some Problems about the Boundary Conditions in OpenFoam | lzgwhy | OpenFOAM Running, Solving & CFD | 47 | October 10, 2017 08:33 |
Boundary Conditions | Thomas P. Abraham | Main CFD Forum | 20 | July 7, 2013 05:05 |
Boundary Conditions for External Flow | raytracer | OpenFOAM Running, Solving & CFD | 4 | July 14, 2008 12:18 |
UDS Boundary conditions | Max Perrotta | FLUENT | 0 | August 16, 2007 03:59 |
Outlet boundary conditions for unsteady flow | Bjorn B | Main CFD Forum | 3 | January 11, 2006 05:42 |