|
[Sponsors] |
H2 injection temperature as IC under janaf limit (modifying janafThermoI.H) |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 4, 2011, 11:25 |
H2 injection temperature as IC under janaf limit (modifying janafThermoI.H)
|
#1 |
New Member
Luigi
Join Date: Apr 2011
Posts: 10
Rep Power: 15 |
Hi everybody,
I'm newby in OpenFOAM and in C++ programming language and I try to simulate combustion air-H2 inside a scramjet combustion chamber. For my thesis I need to set a injection temperature of hydrogen around 133K but it is already out of temperature range. I have calculated coefficients for the lower temperature using Chemkin Fitdata function, but I don't know how to modify OpenFoam to read this new file (i.e therm_lowrange.dat). Looking around the code I found the file where temperature is checked, janafThermoI.H: template<class equationOfState> inline void Foam::janafThermo<equationOfState>::checkT(const scalar T) const { if (T < Tlow_ || T > Thigh_) { FatalErrorIn ( "janafThermo<equationOfState>::checkT(const scalar T) const" ) << "attempt to use janafThermo<equationOfState>" " out of temperature range " << Tlow_ << " -> " << Thigh_ << "; T = " << T << abort(FatalError); } } I would like to bypass this check for example say OpenFoam to read something like that from thermophysicalProperties file: CHEMKINThermoFile_lowrange "$FOAM_CASE/chemkin/therm_lowrange.dat" before abort (if doesn't exist). What is the easy way to do it? Do you know if foamChemistryReader can do this? Thanks for any suggestions! Luigi |
|
April 11, 2011, 18:32 |
|
#2 |
New Member
Luigi
Join Date: Apr 2011
Posts: 10
Rep Power: 15 |
This is my new janafThemoI:
Code:
template<class equationOfState> inline void Foam::janafThermo<equationOfState>::checkT(scalar T) const { if (T < Tlow_) { Info<< "Warning: out of temperature range " << Tlow_ << " -> " << Thigh_ << "; T = " << T << endl; T = Tlow_; Info<< "Temperature limited at T = " << T << endl; } if (T > Thigh_) { Info<< "Warning: out of temperature range " << Tlow_ << " -> " << Thigh_ << "; T = " << T << endl; T = Thigh_; Info<< "Temperature limited at T = " << T << endl; } /*if (T < Tlow_ || T > Thigh_) { FatalErrorIn ( "janafThermo<equationOfState>::checkT(const scalar T) const" ) << "attempt to use janafThermo<equationOfState>" " out of temperature range " << Tlow_ << " -> " << Thigh_ << "; T = " << T << abort(FatalError); }*/ } template<class equationOfState> inline const typename Foam::janafThermo<equationOfState>::coeffArray& Foam::janafThermo<equationOfState>::coeffs ( scalar T // const scalar T ) const { checkT(T); if (T < Tcommon_) { return lowCpCoeffs_; } else { return highCpCoeffs_; } } Code:
Solving chemistry diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0 DILUPBiCG: Solving for Ux, Initial residual = 0.126810514, Final residual = 1.17492806e-09, No Iterations 1 DILUPBiCG: Solving for Uy, Initial residual = 0.0715419851, Final residual = 2.01756428e-08, No Iterations 1 DILUPBiCG: Solving for Uz, Initial residual = 0.377246649, Final residual = 5.3260308e-09, No Iterations 1 DILUPBiCG: Solving for H2, Initial residual = 0.0323321349, Final residual = 1.97452836e-08, No Iterations 1 DILUPBiCG: Solving for O2, Initial residual = 0.0324333194, Final residual = 1.99863629e-08, No Iterations 1 DILUPBiCG: Solving for H2O, Initial residual = 0, Final residual = 0, No Iterations 0 DILUPBiCG: Solving for hs, Initial residual = 0.0703365119, Final residual = 3.26754347e-09, No Iterations 1 Warning: out of temperature range 100 -> 5000; T = 50 Temperature limited at T = 100 Warning: out of temperature range 100 -> 5000; T = 50 Temperature limited at T = 100 Warning: out of temperature range 100 -> 5000; T = 50.000762 Temperature limited at T = 100 Warning: out of temperature range 100 -> 5000; T = 50.000762 Temperature limited at T = 100 Warning: out of temperature range 100 -> 5000; T = 50 Temperature limited at T = 100 Warning: out of temperature range 100 -> 5000; T = 50 Temperature limited at T = 100 Warning: out of temperature range 100 -> 5000; T = 50.0007507 Temperature limited at T = 100 Warning: out of temperature range 100 -> 5000; T = 50.0007507 Temperature limited at T = 100 T gas min/max = 50.0007507, 1204.00116 |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Calculation of the Governing Equations | Mihail | CFX | 7 | September 7, 2014 07:27 |
How do I set lower temperature boundary limit? | Arefin Anwar | CFX | 1 | December 4, 2006 10:48 |
How do I set Lower temperature boundary limit? | Arefin Anwar | CFX | 0 | December 4, 2006 03:31 |
Low temperature limit when iterations are done. | MANOJKUMAR | FLUENT | 4 | February 28, 2006 16:30 |
Temperature went outside of its upper limit | Atit Koonsrisuk | CFX | 0 | January 8, 2004 12:43 |