CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   Integrating rhoReactionThermo in twoPhaseModel (https://www.cfd-online.com/Forums/openfoam-programming-development/243753-integrating-rhoreactionthermo-twophasemodel.html)

überschwupper July 4, 2022 11:50

Integrating rhoReactionThermo in twoPhaseModel
 
Dear Foamers!


I need some help. I'm currently building a multiphase class (pretty similar to that in compressibleInterFoam https://github.com/OpenFOAM/OpenFOAM...ixtureThermo.H) but instead of rhoThermo, I need rhoReactionThermo for the multicomponent feature + reaction models in OF. Thats why I inherited the composite sub class .


Code:

class twoPhaseReactionThermo
:
public rhoReactionThermo::composite,
public twoPhaseMixture,
public interfaceProperties

Unfortunately I always get the error message, that I cant create an object of pure abstract type and thats because of the function that gets inhereted from fluidReactionThermo:



Code:

virtual basicSpecieMixture& composition() = 0;
Can someone explain to me why making a reference to an object managed by autoPtr is working fine, for exampe in reactingFoam, altough this function is pure inside that class

Code:

basicSpecieMixture& composition = thermo.composition();
And can someone please explain to me how I get away with that? I mean that function has literally no function, since I have two different phases that has different components inside. Í thought about recompiling that class without that function but then I loose the option of calling it from the thermos managed by autoPtr


Code:

*.H

autoPtr<rhoReactionThermo> thermo1_;
autoPtr<rhoReactionThermo> thermo2_;


*.C
thermo1_= rhoReactionThermo::New(U.mesh(), phase1Name_);
thermo2_= rhoReactionThermo::New(U.mesh(), phase2Name_);


basicSpecieMixture& composition1()
{ return thermo1_->composition(); }
basicSpecieMixture& composition2()
{ return thermo2_->composition(); }



Or should I just delete the inheritance from rhoReactionThermo::composite and access everything just from thermo1 and thermo2?




Big thanks to anyone in advance and have a nice week!


All times are GMT -4. The time now is 20:44.