|
[Sponsors] |
September 22, 2011, 13:16 |
Couple with external program
|
#1 |
New Member
Join Date: Sep 2011
Location: Germany
Posts: 7
Rep Power: 15 |
I want to couple OpenFOAM with another scientific simulation software. OpenFOAM will solve turbulence with pisoFoam and the other software computes flow in a porous medium.
As a first step I want to grab the matrix from OpenFOAM and include it in the matrix from my other program to solve it there. Over the coupling surface the pressure should be constant. - How can I couple the both models? Do I have to set some boundary conditions in OpenFOAM? - Where can I get access to the matrix? - Has anyone done this before? Are there already interfaces for this? Later I want to exchange more than only pressure. And I assume that some Schwarz domain decomposition method would be necessary. But before I invest to much time I'll have to investigate whether my approach works and who it performs. Thanks for any hint. |
|
September 27, 2011, 10:05 |
|
#2 |
Member
Robertas N.
Join Date: Mar 2009
Location: Kaunas, Lithuania
Posts: 53
Rep Power: 17 |
If you have access to the source code of the other application, you can set up a combined
(hybrid) solver, using the parts from OF and the other application. Or you can set up an interprocess communication between the both, using the facilities provided by the OS, e.g., shared memory, pipes etc. In both cases, you'll have to modify the sources accordingly and compile. If you cannot modify the other applications, then you can write a driver program (shell script might be sufficient, or maybe some higher level language) that runs both OF and other app and exchanges data between them. It can run OF solver for certain number of time steps, then take its output and prepare input for the other app, then take the other app's output and prepare input for the next steps of OF solver, and so on until the final solution. This might be the only solution available if the other app cannot be modified, but this approach will also probably work much slower than modified solvers. Domain distribution among the different solvers is another matter, but in any case you'll have to exchange data between them. |
|
September 27, 2011, 10:44 |
More presice questions
|
#3 |
New Member
Join Date: Sep 2011
Location: Germany
Posts: 7
Rep Power: 15 |
Thanks for your answer r08n!
The external software is open source, too. Any modification in this part seems feasible to me because I know the software or know at least some people who now it well. I have some thoughts about the communication but want to start simple with file I/O. I would like to get some hints on how I should start. I imagine that there should be a matrix class or some sort of solver where the matrix is stored. I need to export the matrix to my external program where I could add the matrix part from the external program and solve it there. But what class do I search? I don't know the boundary condition for OpenFoam where the domain adjoins to the external-program-calculated domain. Neither Neumann nor Dirichlet seems appropriate because I don't know them in advance. Can I set a kind of unknown boundary condition? |
|
September 28, 2011, 08:43 |
|
#4 |
New Member
Join Date: Oct 2010
Posts: 13
Rep Power: 16 |
@ mathletic:
BC: There is always the possibility to write your own boundary condition. The material for the Advanced Course of the OpenFOAM training contains an example or you can just google and find eg this: http://www.tfd.chalmers.se/~hani/kur...yCondition.pdf OpenFOAM is a huge library of tools and it supports porous zones. Maybe your complete problem can be solved in OpenFOAM. Before thinking of methods of coupling OF with "the other scientific" tool I would rather check, how OF could solve your problem or how OF needs to be modified to satisfy your needs. Example of a Matrix equation for convective scalar transport Code:
solve ( fvm::ddt(T) + fvm::div(phi,T) ); // fvm::-objects are matrix equations including the right hand side // fvc::-returns just a field. eg fvc::interpolate(U_) & mesh.Sf() returns the flux through faces |
|
Tags |
couple, export matrix, external programm, link |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
CGNS Compiling | Diego | Main CFD Forum | 17 | December 21, 2014 02:40 |
Update boundary conditions calculated by an external program | CedricVH | OpenFOAM | 2 | January 15, 2010 12:55 |
Postprocessing in external program | Willem Haverkort | FLUENT | 1 | February 5, 2008 11:45 |
Couple error | Yehia | Siemens | 3 | January 25, 2007 04:58 |
[Commercial meshers] Trimmed cell and embedded refinement mesh conversion issues | michele | OpenFOAM Meshing & Mesh Conversion | 2 | July 15, 2005 05:15 |