CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > OpenFOAM Programming & Development

Couple with external program

Register Blogs Members List Search Today's Posts Mark Forums Read

Reply
 
LinkBack Thread Tools Display Modes
Old   September 22, 2011, 12:16
Default Couple with external program
  #1
New Member
 
Join Date: Sep 2011
Location: Germany
Posts: 4
Rep Power: 4
mathletic is on a distinguished road
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.
mathletic is offline   Reply With Quote

Old   September 27, 2011, 09:05
Default
  #2
Member
 
Robertas N.
Join Date: Mar 2009
Location: Kaunas, Lithuania
Posts: 49
Rep Power: 7
r08n is on a distinguished road
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.
r08n is offline   Reply With Quote

Old   September 27, 2011, 09:44
Default More presice questions
  #3
New Member
 
Join Date: Sep 2011
Location: Germany
Posts: 4
Rep Power: 4
mathletic is on a distinguished road
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?
mathletic is offline   Reply With Quote

Old   September 28, 2011, 07:43
Default
  #4
New Member
 
Join Date: Oct 2010
Posts: 13
Rep Power: 5
moritzhoefert is on a distinguished road
@ 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
moritzhoefert is offline   Reply With Quote

Reply

Tags
couple, export matrix, external programm, link

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
CGNS Compiling Diego Main CFD Forum 16 November 6, 2010 04:50
Update boundary conditions calculated by an external program CedricVH OpenFOAM 2 January 15, 2010 11:55
Postprocessing in external program Willem Haverkort FLUENT 1 February 5, 2008 10:45
Couple error Yehia CD-adapco 3 January 25, 2007 03:58
Trimmed cell and embedded refinement mesh conversion issues michele OpenFOAM Other Meshers: ICEM, Star, Ansys, Pointwise, GridPro, Ansa, ... 2 July 15, 2005 04:15


All times are GMT -4. The time now is 05:45.