|
[Sponsors] |
How to rewrite a standard OpenFOAM solver as a C++ class |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 17, 2016, 11:34 |
How to rewrite a standard OpenFOAM solver as a C++ class
|
#1 |
New Member
Carlos Baptista
Join Date: Feb 2016
Location: Rotterdam, The Netherlands
Posts: 14
Rep Power: 10 |
Standard OpenFOAM solvers are complete applications. This implies they do everything: read configuration files, initialize case and (for each time step) solve equations and write out data. This makes it difficult to embed an OpenFOAM solver into a 3rd party solver in a flexible manner.
I would like to know how to rewrite a standard OpenFOAM solver as a C++ class. By defining variables that need to remain in RAM as properties of the class and by defining actions (e.g. set boundary conditions, perform single time step, write out data) as methods of the class, I can instruct OpenFOAM to do what I want whenever I want. My final objective is to rewrite pisoFoam as a C++ solver class for external flow cases (e.g. airfoil simulations). This class should contain methods to do at least the following:
Can someone help me identify which variables I need to define as properties, or point me to documentation/tutorials dealing with similar things? ps: Doing it the other way around (e.g. embedding the 3rd party solver inside OpenFOAM) is, unfortunately, not an option. |
|
Tags |
c++ solver class, embedding openfoam, interfacing openfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Which would be the most suitable standard solver in ejector problem? | jexposito | OpenFOAM Running, Solving & CFD | 1 | October 25, 2019 10:58 |
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 | cfd.direct | OpenFOAM Announcements from Other Sources | 2 | August 31, 2015 13:36 |
Can't get data from OpenFoam to external solver using externalCoupled | perry | OpenFOAM Running, Solving & CFD | 4 | May 26, 2014 08:09 |
Possible bug in OpenFoam Interpolation class | MMC15 | OpenFOAM Bugs | 2 | March 23, 2014 12:55 |
Building a custom solver on OpenFOAM 2.0 | wschosta | OpenFOAM Programming & Development | 1 | July 8, 2011 15:07 |