|
[Sponsors] |
April 16, 2020, 06:59 |
main()-execution and object creation within
|
#1 |
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 369
Rep Power: 8 |
Hi,
from my understanding if i want to create an object from a class i do the following: classname objectname; afterwards i can access the member functions of this class: objectname.read(); when running a solver the main-function is executed. however, within the main-function i don't see where the object of the pimple solver is created. i just see for example (reactingMultiphaseEulerFoam.C): // --- Pressure-velocity PIMPLE corrector loop while (pimple.loop()) { fluid.solve(); fluid.correct(); #include "YEqns.H" if (faceMomentum) { #include "pUf/UEqns.H" #include "EEqns.H" #include "pUf/pEqn.H" } else { #include "pU/UEqns.H" #include "EEqns.H" #include "pU/pEqn.H" } fluid.correctKinematics(); if (pimple.turbCorr()) { fluid.correctTurbulence(); } } can anybody please explain how the object fluid or pimple is created? are those created in the header files and imported with #include? if yes, where is the code part that generates those objects automatically and gives these objects its names. also,i don't understand how functions are executed only by including some header files. do these header files contains certain code that are executed automatically? thanks in advance. |
|
December 28, 2021, 08:17 |
|
#2 |
New Member
Peng Ningning
Join Date: May 2020
Posts: 5
Rep Power: 6 |
hi geth,
Have you figured out this problem? I have the same confusion. |
|
December 28, 2021, 08:50 |
|
#3 |
Senior Member
Join Date: Dec 2019
Location: Cologne, Germany
Posts: 369
Rep Power: 8 |
Hi,
There is nothing to be confused about. Back then i didn't know anything about code structure. If you want to find how the code is written, you need to dig deeper and look how its done. If you are new to openfoaming coding, i suggest you start with icofoam and look how it is coded. Regards |
|
December 28, 2021, 09:25 |
|
#4 | |
New Member
Peng Ningning
Join Date: May 2020
Posts: 5
Rep Power: 6 |
Quote:
|
||
Tags |
programming, solver |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] Placing an object on top of the NACA0012 airfoil shape | najimaddin96 | OpenFOAM Meshing & Mesh Conversion | 0 | March 21, 2020 23:53 |
Is the full text of an IOdictionary stored in RAM for the life of the object? | knuckles | OpenFOAM Programming & Development | 0 | November 3, 2015 12:46 |
Problem Execution Control ICEM-CFX | cote2714 | CFX | 5 | September 10, 2015 14:03 |
[waves2Foam] floating object inside the flume tutorial with interDyMFoam | Rising Star | OpenFOAM Community Contributions | 2 | April 21, 2015 00:42 |
Problems with the execution of the setFields utility. | foamer | OpenFOAM Pre-Processing | 5 | June 3, 2013 13:24 |