|
[Sponsors] |
May 23, 2023, 17:53 |
Virtual Methods in combustionModel
|
#1 |
New Member
Peter Bevington
Join Date: May 2023
Posts: 10
Rep Power: 2 |
Hi all, I'm relatively new to OpenFoam and was trying to understand reactingFoam when I came across this point of confusion about the pure virtual methods correct() and Qdot():
In reactingFoam (YEqn.h), we use the pointer reaction to call virtual methods belonging to the combustion model class: Code:
reaction->correct(); Qdot = reaction->Qdot(); Code:
autoPtr<CombustionModel<psiReactionThermo>> reaction ( CombustionModel<psiReactionThermo>::New(thermo, turbulence()) ); Code:
//- Correct combustion rate virtual void correct() = 0; //- Fuel consumption rate matrix, i.e. source term for fuel equation virtual tmp<fvScalarMatrix> R(volScalarField& Y) const = 0; //- Heat release rate [kg/m/s3] virtual tmp<volScalarField> Qdot() const = 0; |
|
May 23, 2023, 20:30 |
|
#2 |
New Member
Peter Bevington
Join Date: May 2023
Posts: 10
Rep Power: 2 |
I think I figured this out- CombustionModel.c doesn't implement the virtual methods because it is only creating a pointer to a specific combustion model type (EDM, laminar, infinitelyFastChemistry, etc) defined by the user at runtime. Instead, the virtual methods are implemented in these individual models, as they differ between them.
|
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Could you please help me about the VTKFoam | liugx212 | OpenFOAM Pre-Processing | 5 | February 13, 2008 11:31 |
OpenFoam 14 installation problem | gfcoppola | OpenFOAM Installation | 20 | November 2, 2007 13:38 |
[OpenFOAM] Could you please help me | liugx212 | ParaView | 4 | December 22, 2005 16:55 |
[OpenFOAM] LibvtkFoamso | fred | ParaView | 2 | November 18, 2005 19:01 |
Please help about the VTKFoam | liugx212 | OpenFOAM Running, Solving & CFD | 0 | November 18, 2005 18:27 |