DENG-MIT / Arrhenius.jl

Differentiable Reacting Flow Modeling Software
https://deng-mit.github.io/Arrhenius.jl/dev/
MIT License
56 stars 20 forks source link

Discretization for one-dimensional flame #31

Open jiweiqi opened 3 years ago

jiweiqi commented 3 years ago

Goal:

implement the discretization for one-dimensional flame, then one can compute the residuals and the sensitivity for a given solution. Further, one can also solve the equations.

Equations:

see Chemkin manual Sec. 12.6

Notes:

similar to the one did for sensBVP for ignition, but more complex with the central difference.

jiweiqi commented 3 years ago

Detailed plans

jiweiqi commented 3 years ago

https://github.com/SciML/DiffEqOperators.jl

TJP-Karpowski commented 3 years ago

Hi, I see you started already with the 1D flame. I am also interested in that capability. In your repo I dont see any usage of the DiffEqOperators. Out of curiosity, what made you decide not to use them? I thought it would fit the task quite nicely and might enable the usage of the broader SciML Ecosystem later on.

jiweiqi commented 3 years ago

Are you referring to the repo of https://github.com/DENG-MIT/Arrhenius_Flame_1D/blob/main/src/flame_1d.jl

I haven't tried DiffEqOperators, but I think it is worth trying. I didn't decide not to use them.

I don't have much recent hands-on experience in implementing the discretization scheme. So that I thought it might be a good start to implement it manually. Another consideration is that one-d flame involves a complex scheme for diffusion term. See sec. 12.6 of https://personal.ems.psu.edu/~radovic/ChemKin_Theory_PaSR.pdf. I am not sure if DiffEqOperators support such a scheme.

By the way, currently, I am not using the scheme detailed in the Chemkin manual to evaluate the residuals. It seems that a simple windward difference seems to give wrong residuals. if you have experience with the finite difference scheme used in one-d flame or DNS, it will be great we can have some discussions to resolve the issue.

RSuryaNarayan commented 3 years ago

So we are skipping this entirely or are we pushing it further down the lane?

jiweiqi commented 3 years ago

@RSuryaNarayan , I am working on implementing the finite difference scheme thoseday. Hope fully get it to work next week.

RSuryaNarayan commented 3 years ago

Sure @jiweiqi sounds good

jiweiqi commented 3 years ago

After a tough debug, finally, sens something works h2o2.yaml

https://github.com/DENG-MIT/Arrhenius_Flame_1D/blob/ed5e130d819012d9de8a261ea6208c00786b1222/src/sens_flame_1d.jl#L64

RSuryaNarayan commented 3 years ago

Ah looks great!