|
[Sponsors] |
How to add equations to modular solver in openFoam11 |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 11, 2023, 19:09 |
How to add equations to modular solver in openFoam11
|
#1 |
New Member
Alberto Campuzano
Join Date: Mar 2021
Posts: 14
Rep Power: 5 |
Dear All
I am looking for help, how to add temperature equation or any other equation to InterFoam solver?, i noticed, that now everything is called modular solver and even the name changed to incompressibleVoF. i know everything is with classes, however, openFoam is improving faster and now i am a bit lost. Finally the version is OpenFoam11 thanks in advance Last edited by baezacaljo; September 11, 2023 at 19:11. Reason: typos |
|
September 12, 2023, 00:09 |
|
#2 |
Member
Tatsuya Shimizu
Join Date: Jul 2012
Posts: 42
Rep Power: 13 |
Hello baezacaljo
I would add to the class method "thermophysicalPredictor" in "incompressibleVoF.C". The solver "foamRun" always calls this class method. OpenFOAM-11/applications/modules/incompressibleVoF Code:
void Foam::solvers::incompressibleVoF::thermophysicalPredictor() {} OpenFOAM-11/applications/solvers/foamRun/foamRun.C Code:
// PIMPLE corrector loop while (pimple.loop()) { solver.moveMesh(); solver.fvModels().correct(); solver.prePredictor(); solver.momentumPredictor(); solver.thermophysicalPredictor(); solver.pressureCorrector(); solver.postCorrector(); }
__________________
Our Work: https://www.idaj.co.jp/product/ennovacfd/openfoam_gui/ Powered by Ennova : https://ennova-cfd.com/ Ennova's Channel Partners : http://www.wolfdynamics.com/ |
|
September 12, 2023, 05:41 |
|
#3 | ||
New Member
Alberto Campuzano
Join Date: Mar 2021
Posts: 14
Rep Power: 5 |
Thank you for your help LongGe
Now I assume I have to copy both folder the one called incompressibleVoF and compile it. And the other other one that contains the solver foamRun.C and compile it, right? Finally in the controlDict file in solver I have to write myFoamRun, right? By the way, i was reading the code carefully and the fie incompressibleVoF.C already has Quote:
and the file incompressibleVoF.H has Quote:
Hence, i am not getting the code. is the incompressibleVoF.C and foamRun considering the temperature already? Best regards Last edited by baezacaljo; September 12, 2023 at 09:38. Reason: lack of information |
|||
September 12, 2023, 18:34 |
|
#4 |
Member
Tatsuya Shimizu
Join Date: Jul 2012
Posts: 42
Rep Power: 13 |
Hello
Since "foamRun" is simply a client using the "solver" class, you do not need to make any changes. All you have to do is copy "incompressibleVoF" and create your "yourincompressibleVoF". The controlDict is as follows. Code:
application foamRun; solver yourincompressibleVoF Code:
incompressibleVoF->twoPhaseVoFSolver->twoPhaseSolver->VoFSolver->fluidSolver virtual void thermophysicalPredictor() = 0;
__________________
Our Work: https://www.idaj.co.jp/product/ennovacfd/openfoam_gui/ Powered by Ennova : https://ennova-cfd.com/ Ennova's Channel Partners : http://www.wolfdynamics.com/ |
|
September 13, 2023, 19:33 |
|
#5 |
New Member
Alberto Campuzano
Join Date: Mar 2021
Posts: 14
Rep Power: 5 |
Thank you LongGe
So rry for the late reply i was testing and writing the code, look this is what i achieved so far (see attached files), however, in the case of the Make folder and the other two folder, do i have to modify them and then COMPILE THEM? or what to do? i only modify the folder name from incompressibleVoF to incompressibleVoFTemp and the files stick with the same name incompressibleVoF.C and incompressibleVoF.H but with some modifications. Thanks in advance |
|
September 13, 2023, 20:13 |
|
#6 |
Member
Tatsuya Shimizu
Join Date: Jul 2012
Posts: 42
Rep Power: 13 |
Hello
You will need to create a new class. I don't think you can just copy it. For example: Code:
class incompressibleVoFTemp : public twoPhaseVoFSolver { ... ... //- Runtime type information TypeName("incompressibleVoFTemp");
__________________
Our Work: https://www.idaj.co.jp/product/ennovacfd/openfoam_gui/ Powered by Ennova : https://ennova-cfd.com/ Ennova's Channel Partners : http://www.wolfdynamics.com/ |
|
May 3, 2024, 09:42 |
|
#7 |
Member
Join Date: Mar 2015
Posts: 36
Rep Power: 11 |
I found this thread via Google and have to admit, that I am facing the same problem.
I copied an existing solver module, modified it and then compiled it into an shared library with .so extension via "wclean" and "wmake libso". Compilation worked fine, but my new solver class is not available to foamRun I tried Code:
foamRun -solver {nameOfMyOwnSolver} Code:
libs("{pathToMyLibrary.so}"); and I also tried Code:
foamRun -libs '("{pathToMyLibrary.so}")' -solver {nameOfMyOwnSolver} and my last attempt was to extend the searchPath for libraries with Code:
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/{absolutePathToMyLibraryFolder} In all ways foamRun complains with "solvers table is empty" So how can I declare to foamRun to use my new created solver module? The Kind regards, K.C. |
|
Tags |
incompressiblevof, interfoam, modular solver, openfoam 11 |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Add mesh refinement to solidDisplacementFoam solver | j-avdeev | OpenFOAM Programming & Development | 0 | May 10, 2022 12:39 |
Error SIGSEGV using VOF and UDF | JERC_UTFSM | Fluent UDF and Scheme Programming | 14 | November 7, 2021 23:17 |
Add a pollutant in simpleFoam solver | Gohu8 | OpenFOAM Running, Solving & CFD | 2 | July 19, 2017 03:16 |
How to add temperature to cavitatingFoam solver | chodki-c | OpenFOAM | 9 | September 30, 2010 11:21 |
Navier-stokes equations and iterative solver?? | wuliang | Main CFD Forum | 2 | January 13, 2003 22:28 |