inhomogeneousMixture.C
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #include "inhomogeneousMixture.H"
00028 #include "fvMesh.H"
00029
00030
00031
00032 template<class ThermoType>
00033 const char* Foam::inhomogeneousMixture<ThermoType>::specieNames_[2] =
00034 {"ft", "b"};
00035
00036
00037
00038
00039 template<class ThermoType>
00040 Foam::inhomogeneousMixture<ThermoType>::inhomogeneousMixture
00041 (
00042 const dictionary& thermoDict,
00043 const fvMesh& mesh
00044 )
00045 :
00046 basicMultiComponentMixture
00047 (
00048 thermoDict,
00049 speciesTable(nSpecies_, specieNames_),
00050 mesh
00051 ),
00052
00053 stoicRatio_(thermoDict.lookup("stoichiometricAirFuelMassRatio")),
00054
00055 fuel_(thermoDict.lookup("fuel")),
00056 oxidant_(thermoDict.lookup("oxidant")),
00057 products_(thermoDict.lookup("burntProducts")),
00058
00059 mixture_("mixture", fuel_),
00060
00061 ft_(Y("ft")),
00062 b_(Y("b"))
00063 {}
00064
00065
00066
00067
00068 template<class ThermoType>
00069 const ThermoType& Foam::inhomogeneousMixture<ThermoType>::mixture
00070 (
00071 const scalar ft,
00072 const scalar b
00073 ) const
00074 {
00075 if (ft < 0.0001)
00076 {
00077 return oxidant_;
00078 }
00079 else
00080 {
00081 scalar fu = b*ft + (1.0 - b)*fres(ft, stoicRatio().value());
00082 scalar ox = 1 - ft - (ft - fu)*stoicRatio().value();
00083 scalar pr = 1 - fu - ox;
00084
00085 mixture_ = fu/fuel_.W()*fuel_;
00086 mixture_ += ox/oxidant_.W()*oxidant_;
00087 mixture_ += pr/products_.W()*products_;
00088
00089 return mixture_;
00090 }
00091 }
00092
00093
00094 template<class ThermoType>
00095 void Foam::inhomogeneousMixture<ThermoType>::read(const dictionary& thermoDict)
00096 {
00097 stoicRatio_ = thermoDict.lookup("stoichiometricAirFuelMassRatio");
00098
00099 fuel_ = ThermoType(thermoDict.lookup("fuel"));
00100 oxidant_ = ThermoType(thermoDict.lookup("oxidant"));
00101 products_ = ThermoType(thermoDict.lookup("burntProducts"));
00102 }
00103
00104
00105
Copyright © 2000-2009 OpenCFD Ltd