|
[Sponsors] |
November 30, 2022, 05:57 |
Call OpenFOAM with input files as arguments
|
#1 |
New Member
Jesus
Join Date: Sep 2021
Posts: 11
Rep Power: 5 |
Dear Foamers,
I would like to modify the Input/Output of OpenFOAM to be able to pass the required inputs as arguments and receive the corresponding outputs as a return of my call. I would have my input files (constant, system, 0) saved as RAM variables, and I would save the output files (0+dt) also as RAM variables, instead of saving all these data files as hard disk variables. I need to do so, because my algorithm requires executing a lot of small cases, and it spends the major part of the time reading/writing data files in the hard disk. Could anyone give me some guidelines/examples/information of how to implement this modification? Thank you in advance! |
|
December 8, 2022, 11:34 |
|
#2 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
I don't see how you would want this to work (ie, how variables are to be persistent in memory between different applications). The closest I can think of is a RAM-disk, there are probably various FUSE implementations. |
||
December 9, 2022, 07:08 |
|
#3 | |
New Member
Jesus
Join Date: Sep 2021
Posts: 11
Rep Power: 5 |
Quote:
Code:
p,U,omega,nut,k = pimpleFoam controlDict fvSchemes fvSolution p U omega nut k transportProperties turbulenceProperties polyMesh |
||
December 11, 2022, 09:49 |
|
#4 | |
Senior Member
Mark Olesen
Join Date: Mar 2009
Location: https://olesenm.github.io/
Posts: 1,715
Rep Power: 40 |
Quote:
Even if I don't really understand how you expect things to hang around in memory, but still exit and restart an application each time. It simply does not fit together unless you are using some other mechanism (eg, a RAM disk) to handle the memory persistence for you. Having said that, it actually sounds like you have something more like an infinite loop of the pimpleFoam solver, with some modification of fields (on disk or in memory) between each loop. The normal description for that would be some time of a functionObject. There are plenty of ones already available but you'll have to code up your own. The external file coupling function object might be a reasonable place for you to start looking. It has a simple semaphore type of state tracking. |
||
Tags |
input output, openfoam, ram variables |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Any experts on FFTW? | jinhua2015 | Main CFD Forum | 3 | May 22, 2022 20:44 |
Map of the OpenFOAM Forum - Understanding where to post your questions! | wyldckat | OpenFOAM | 10 | September 2, 2021 06:29 |
Compiling User Fortran with CFX 14.0 on Win64 | Raijin Thunderkeg | CFX | 29 | March 9, 2016 12:45 |
OpenFOAM Training, London, Chicago, Munich, Sep-Oct 2015 | cfd.direct | OpenFOAM Announcements from Other Sources | 2 | August 31, 2015 14:36 |
File format - binary? (plot3d) | Joachim | Main CFD Forum | 15 | January 14, 2015 19:21 |