CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   [Lagrangian] Injection Model Start of Injection timestep Mistake? (https://www.cfd-online.com/Forums/openfoam-programming-development/138039-lagrangian-injection-model-start-injection-timestep-mistake.html)

zarox June 27, 2014 04:37

[Lagrangian] Injection Model Start of Injection timestep Mistake?
 
Hi everyone,

[OF 2.2.2]
Looking at the lagrangian injection Model : InjectionModel.C,
I find in the membre function PrepareForTheNextTimestep something I don't Understand :

// Make times relative to SOI
scalar t0 = timeStep0_ - SOI_;
scalar t1 = time - SOI_;

In my mind, because timestep0_ is the last time step, so the first delta Time between current time and SOI is miss, indeed function parcelsToinject require t0 > 0

so in my mind,

if SOI = 0.5

at first step time =1 (dt=1) timeStep_0=0
so t0=-0.5 so no parcel to inject ... [But we want to inject parcel, no?]

at second step time time =2 timestep_0 = 1
so t0 = 0.5 and t1 = 1.5 so inject parcel give us t1-t0 = dt =1

But we have forget the first par of injection from SOI = 0.5 to time =1


Is it right? Where is my missunderstanding?


If someone can enlighten me, it will be great!



Have a nice day!

ChristoBeers October 29, 2014 16:51

Has anybody looked into this? InjectionModel seems good, but the derived injection model's parcelsToInject disallows time0<0 as you noted Emeline.

e.g. I am using coneNozzleInjection with SOI = 10.010. See log file, the first injection time step 10.0101 is missed...!? May be a bug? (albeit minor I suppose!)


Quote:

Courant Number mean: 0.1118990122 max: 1.994706046
deltaT = 0.0003471966024
Time = 10.0101


Solving 3-D cloud reactingCloud1
Cloud: reactingCloud1
Current number of parcels = 0
Current mass in system = 0
Linear momentum = (0 0 0)
|Linear momentum| = 0
Linear kinetic energy = 0
model1:
number of parcels added = 0
mass introduced = 0
Parcels absorbed into film = 0
New film detached parcels = 0
Parcel fate (number, mass)
- escape = 0, 0
- stick = 0, 0
Temperature min/max = 0, 0
Mass transfer phase change = 0
Mass transfer devolatilisation = 0
Mass transfer surface reaction = 0

diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
rho min/max = 1.113112118, 1.171788043
DILUPBiCG: Solving for Ux, Initial residual = 3.337508174e-006, Final residual = 7.54026209e-008, No Iterations 1
DILUPBiCG: Solving for Uy, Initial residual = 5.504945546e-005, Final residual = 6.941799875e-007, No Iterations 1
DILUPBiCG: Solving for Uz, Initial residual = 2.989294024e-005, Final residual = 1.62292623e-007, No Iterations 2
smoothSolver: Solving for C2H5OH, Initial residual = 0, Final residual = 0, No Iterations 0
DILUPBiCG: Solving for h, Initial residual = 6.731643474e-005, Final residual = 8.670916541e-007, No Iterations 1
T gas min/max = 329.6221401, 330.0232519
GAMG: Solving for p, Initial residual = 2.82501963e-005, Final residual = 8.700497101e-006, No Iterations 1
GAMG: Solving for p, Initial residual = 8.700456195e-006, Final residual = 8.700456195e-006, No Iterations 0
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
rho min/max = 1.113112293, 1.171788119
time step continuity errors : sum local = 2.836225714e-007, global = -6.787536111e-009, cumulative = -5.346327795e-007
p min/max = 108937, 114760.7215
GAMG: Solving for p, Initial residual = 9.265208855e-006, Final residual = 9.265208855e-006, No Iterations 0
GAMG: Solving for p, Initial residual = 9.265208855e-006, Final residual = 9.265208855e-006, No Iterations 0
diagonal: Solving for rho, Initial residual = 0, Final residual = 0, No Iterations 0
rho min/max = 1.113112293, 1.171788256
time step continuity errors : sum local = 3.02032656e-007, global = -6.781834716e-009, cumulative = -5.414146142e-007
p min/max = 108937, 114760.7215
smoothSolver: Solving for epsilon, Initial residual = 9.471710755e-006, Final residual = 9.471710755e-006, No Iterations 0
smoothSolver: Solving for k, Initial residual = 3.536078672e-005, Final residual = 1.691882988e-006, No Iterations 1
ExecutionTime = 19.562 s ClockTime = 20 s

Courant Number mean: 0.11189953 max: 1.994730392
deltaT = 0.0003471966024
Time = 10.0104


Solving 3-D cloud reactingCloud1

--> Cloud: reactingCloud1 injector: model1
Added 34 new parcels

Cloud: reactingCloud1
Current number of parcels = 34
Current mass in system = 1.190824736e-007
Linear momentum = (-4.40729446e-010 3.633447476e-011 -1.927799815e-008)
|Linear momentum| = 1.928306965e-008
Linear kinetic energy = 1.593230117e-009
model1:
number of parcels added = 34
mass introduced = 1.202654311e-007
Parcels absorbed into film = 0
New film detached parcels = 0
Parcel fate (number, mass)
- escape = 0, 0
- stick = 0, 0
Temperature min/max = 295.1830963, 365.007777
Mass transfer phase change = 1.182957479e-009
Mass transfer devolatilisation = 0
Mass transfer surface reaction = 0

kmooney November 5, 2014 20:53

The answer to your question should lie in the call to parcelsToInject function in one of the InjectionModel derived classes as opposed to looking at the base class.

For example, take a look at the PatchFlowRateInjection derived class.

You'll see that the parcesToInject() function won't necessarily return a positive value even if t>SOI. Here it introduces some randomness to the injection process while still meeting the concentration criteria you set in the kinematicCloud dictionary. My understanding is the purpose is to remove a timestep dependency to the injection rates. I actually think its a pretty clever implementation.

I hope that helps!

Cheers,
Kyle


All times are GMT -4. The time now is 16:08.