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