sprayInject.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 "spray.H"
00028 #include "breakupModel.H"
00029 #include "collisionModel.H"
00030 #include "dispersionModel.H"
00031 #include "injectorModel.H"
00032
00033
00034
00035 namespace Foam
00036 {
00037
00038
00039
00040 void spray::inject()
00041 {
00042 scalar time = runTime_.value();
00043 scalar time0 = time0_;
00044
00045
00046 forAll(injectors_, i)
00047 {
00048 autoPtr<injectorType>& it = injectors()[i].properties();
00049 if (!it->pressureIndependentVelocity())
00050 {
00051 scalar referencePressure = p().average().value();
00052 it->correctProfiles(fuels(), referencePressure);
00053 }
00054
00055 const label nHoles = it->nHoles();
00056
00057
00058 scalar mass = it->mass(time0, time, twoD_, angleOfWedge_);
00059
00060 label Np = it->nParcelsToInject(time0, time);
00061
00062 if (mass > 0)
00063 {
00064 Np = max(1, Np);
00065 scalar mp = mass/Np/nHoles;
00066
00067
00068
00069 scalar constT = max(0.0, it->tsoi() - time0);
00070
00071
00072 scalar deltaT = min
00073 (
00074 runTime_.deltaT().value(),
00075 min
00076 (
00077 time - it->tsoi(),
00078 it->teoi() - time0
00079 )
00080 );
00081
00082 for(label j=0; j<Np; j++)
00083 {
00084
00085 scalar toi = time0 + constT + deltaT*j/scalar(Np);
00086
00087 for(label n=0; n<nHoles; n++)
00088 {
00089
00090
00091 vector injectionPosition = it->position
00092 (
00093 n,
00094 toi,
00095 twoD_,
00096 angleOfWedge_,
00097 axisOfSymmetry_,
00098 axisOfWedge_,
00099 axisOfWedgeNormal_,
00100 rndGen_
00101 );
00102
00103 scalar diameter = injection().d0(i, toi);
00104 vector direction =
00105 injection().direction(i, n, toi, diameter);
00106 vector U = injection().velocity(i, toi)*direction;
00107
00108 scalar symComponent = direction & axisOfSymmetry_;
00109 vector normal = direction - symComponent*axisOfSymmetry_;
00110 normal /= mag(normal);
00111
00112
00113 scalar deviation = breakup().y0();
00114 scalar ddev = breakup().yDot0();
00115
00116 label injectorCell = mesh_.findCell(injectionPosition);
00117
00118 # include "findInjectorCell.H"
00119
00120 if (injectorCell >= 0)
00121 {
00122 scalar liquidCore = 1.0;
00123
00124
00125
00126 parcel* pPtr = new parcel
00127 (
00128 *this,
00129 injectionPosition,
00130 injectorCell,
00131 normal,
00132 diameter,
00133 it->T(toi),
00134 mp,
00135 deviation,
00136 ddev,
00137 0.0,
00138 0.0,
00139 0.0,
00140 liquidCore,
00141 scalar(i),
00142 U,
00143 vector::zero,
00144 it->X(),
00145 fuels_->components()
00146 );
00147
00148 injectedLiquidKE_ += 0.5*pPtr->m()*magSqr(U);
00149
00150 scalar dt = time - toi;
00151
00152 pPtr->stepFraction() =
00153 (runTime_.deltaT().value() - dt)
00154 /runTime_.deltaT().value();
00155
00156 bool keepParcel = pPtr->move(*this);
00157
00158 if (keepParcel)
00159 {
00160 addParticle(pPtr);
00161 }
00162 else
00163 {
00164 delete pPtr;
00165 }
00166 }
00167 }
00168 }
00169 }
00170 }
00171
00172 time0_ = time;
00173 }
00174
00175
00176
00177
00178 }
00179
00180
Copyright © 2000-2009 OpenCFD Ltd