hollowCone.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 "hollowCone.H"
00028 #include "addToRunTimeSelectionTable.H"
00029 #include "mathematicalConstants.H"
00030
00031
00032
00033 namespace Foam
00034 {
00035
00036
00037
00038 defineTypeNameAndDebug(hollowConeInjector, 0);
00039
00040 addToRunTimeSelectionTable
00041 (
00042 injectorModel,
00043 hollowConeInjector,
00044 dictionary
00045 );
00046
00047
00048
00049
00050
00051 hollowConeInjector::hollowConeInjector
00052 (
00053 const dictionary& dict,
00054 spray& sm
00055 )
00056 :
00057 injectorModel(dict, sm),
00058 hollowConeDict_(dict.subDict(typeName + "Coeffs")),
00059 dropletPDF_
00060 (
00061 pdf::New
00062 (
00063 hollowConeDict_.subDict("dropletPDF"),
00064 sm.rndGen()
00065 )
00066 ),
00067 innerAngle_(hollowConeDict_.lookup("innerConeAngle")),
00068 outerAngle_(hollowConeDict_.lookup("outerConeAngle"))
00069 {
00070
00071 if (sm.injectors().size() != innerAngle_.size())
00072 {
00073 FatalError << "hollowConeInjector::hollowConeInjector"
00074 << "(const dictionary& dict, spray& sm)\n"
00075 << "Wrong number of entries in innerAngle"
00076 << abort(FatalError);
00077 }
00078
00079 if (sm.injectors().size() != outerAngle_.size())
00080 {
00081 FatalError << "hollowConeInjector::hollowConeInjector"
00082 << "(const dictionary& dict, spray& sm)\n"
00083 << "Wrong number of entries in outerAngle"
00084 << abort(FatalError);
00085 }
00086
00087 scalar referencePressure = sm.ambientPressure();
00088
00089
00090 forAll(sm.injectors(), i)
00091 {
00092 sm.injectors()[i].properties()->correctProfiles(sm.fuels(), referencePressure);
00093 }
00094
00095 }
00096
00097
00098
00099
00100 hollowConeInjector::~hollowConeInjector()
00101 {}
00102
00103
00104
00105
00106 scalar hollowConeInjector::d0
00107 (
00108 const label,
00109 const scalar
00110 ) const
00111 {
00112 return dropletPDF_->sample();
00113 }
00114
00115
00116 vector hollowConeInjector::direction
00117 (
00118 const label n,
00119 const label hole,
00120 const scalar time,
00121 const scalar d
00122 ) const
00123 {
00124 scalar angle = innerAngle_[n] + rndGen_.scalar01()*(outerAngle_[n]-innerAngle_[n]);
00125 scalar alpha = sin(angle*mathematicalConstant::pi/360.0);
00126 scalar dcorr = cos(angle*mathematicalConstant::pi/360.0);
00127 scalar beta = 2.0*mathematicalConstant::pi*rndGen_.scalar01();
00128
00129
00130 vector normal = vector::zero;
00131
00132 if (sm_.twoD())
00133 {
00134 scalar reduce = 0.01;
00135
00136
00137
00138 beta *= (1.0-2.0*reduce)*sm_.angleOfWedge()/(2.0*mathematicalConstant::pi);
00139 beta += reduce*sm_.angleOfWedge();
00140 normal = alpha*
00141 (
00142 sm_.axisOfWedge()*cos(beta) +
00143 sm_.axisOfWedgeNormal()*sin(beta)
00144 );
00145 }
00146 else
00147 {
00148 normal = alpha*
00149 (
00150 injectors_[n].properties()->tan1(hole)*cos(beta) +
00151 injectors_[n].properties()->tan2(hole)*sin(beta)
00152 );
00153 }
00154
00155
00156 vector dir = dcorr*injectors_[n].properties()->direction(hole, time) + normal;
00157 dir /= mag(dir);
00158
00159 return dir;
00160
00161 }
00162
00163 scalar hollowConeInjector::velocity
00164 (
00165 const label i,
00166 const scalar time
00167 ) const
00168 {
00169 const injectorType& it = sm_.injectors()[i].properties();
00170 if (it.pressureIndependentVelocity())
00171 {
00172 return it.getTableValue(it.velocityProfile(), time);
00173 }
00174 else
00175 {
00176 scalar Pref = sm_.ambientPressure();
00177 scalar Pinj = it.getTableValue(it.injectionPressureProfile(), time);
00178 scalar rho = sm_.fuels().rho(Pinj, it.T(time), it.X());
00179 scalar dp = max(0.0, Pinj - Pref);
00180 return sqrt(2.0*dp/rho);
00181 }
00182
00183 }
00184
00185 scalar hollowConeInjector::averageVelocity
00186 (
00187 const label i
00188 ) const
00189 {
00190 const injectorType& it = sm_.injectors()[i].properties();
00191 scalar dt = it.teoi() - it.tsoi();
00192 return it.integrateTable(it.velocityProfile())/dt;
00193 }
00194
00195 }
00196
00197
Copyright © 2000-2009 OpenCFD Ltd