|
[Sponsors] |
January 7, 2015, 11:13 |
janaf dynamic_cast issue
|
#1 |
New Member
sebastien vilfayeau
Join Date: Feb 2012
Posts: 14
Rep Power: 14 |
Hi,
I'm working on fireFoam and I try to implement a new model. For this model, I need to have access to polynomial Janaf coefficients defined in "constant/thermo.compressibleGas". My solution was to use a dynamic_cast inside my code as follows : Code:
// Setup the janaf thermo class typedef janafThermo<perfectGas<specie> > janafType; typedef sutherlandTransport<sensibleEnthalpy<janafType> > thermoType; const multiComponentMixture<thermoType>& myThermo = dynamic_cast<const multiComponentMixture<thermoType>&>(this->thermoPtr_()); // O2 thermal enthalpy // Oxygen label const label specie_O2 = this->thermoPtr_->composition().species()["O2"]; // Compute janaf class for O2 const janafType& myThermo_O2 = dynamic_cast<const janafType&>(myThermo.speciesData()[specie_O2]); // Compute molecular thermal enthalpy [J/kmol] scalar H_O2 = myThermo_O2.hs(1e5, Tair_); // Compute molecular weight [kg/kmol] scalar MW_O2 = this->thermoPtr_->composition().W(specie_O2); // Calculate thermal enthalpy [J/kg] scalar hs_O2 = H_O2/MW_O2; Info << "hs_O2 = " << hs_O2 << endl; cannot dynamic_cast ... (source type is not polymorphic) Anyone has a hint how to solve this problem? Thanks Sebastien |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how can see Cp values? | immortality | OpenFOAM Post-Processing | 51 | June 18, 2021 08:19 |
Entropy calculation in OpenFoam | immortality | OpenFOAM | 23 | September 8, 2013 18:18 |
Strange issue while launching ANSYS workbench in CentOS 6.4 | Philip_C | ANSYS | 11 | August 29, 2013 07:44 |
CyclicAMI Issue In OpenFOAM 2.2.0 | prasant | OpenFOAM Running, Solving & CFD | 17 | March 16, 2013 03:00 |
Meshing related issue in Flow EFD | appu | FloEFD, FloWorks & FloTHERM | 1 | May 22, 2011 09:27 |