gdtk-uq / gdtk

The Gas Dynamics Toolkit (GDTk) is a set of software tools for simulating high speed fluid flow, maintained at The University of Queensland and the University of Southern Queensland, Australia.
https://gdtk.uqcloud.net/
Other
59 stars 15 forks source link

Turbulence and non-equilibrium #52

Closed jr144393 closed 6 months ago

jr144393 commented 6 months ago

I have tried utilizing a turbulence solver with non-equilibrium (5sp air) case. In doing so, I receive an error that the mass fraction does not sum to 1. Is this a solvable error or is it inherent in this type of calculation? The error exactly as reported is:

object.Error@(0): The given mass fraction values do not sum to 1.0. The sum value is: 0.000000e+00 The error in the sum is larger than tolerance= 1.000000e-06

Any thoughts on what we could try here?

uqngibbo commented 6 months ago

This should work. Can you double check your input file to make sure you aren't passing an empty mass fraction table to the FlowState constructor. That's the most likely reason that you would get a sum value of zero.

jr144393 commented 6 months ago

Certainly. My current input is given as:

massfraction = {N2=0.767, O2=0.233}

and my FlowState looks like:

inflow = FlowState:new{p=p_inf, velx=u_inf, vely=0.0, T=T_inf, nuhat=nuhat_inf, massf=massfraction}

Is there an error in my input? Otherwise could this be due to my version being a slightly older one? ~1 year ago?

jr144393 commented 6 months ago

Please let me know if more information about my script is needed to debug this; I can attach it if it aids in debugging. Thank you for your rapid reply.

uqngibbo commented 6 months ago

Hi jr, yes if I could look at your script that would be helpful.

It would also be good to know when this happens. Is it during the prep stage or when your simulation starts up?

jr144393 commented 6 months ago

It is happening during the prep step. One moment I will attach that here shortly. Hopefully it is readable. Let me know. input.txt

uqngibbo commented 6 months ago

It looks like you are computing a gas_state in lines 21 to 27, which is probably failing because the mass fractions are missing. Can you try adding this line directly after line 22:

gas_inf.massf = massfraction

And see if that helps.

jr144393 commented 6 months ago

I just tried adding it, and within the prep step, I get a different error:

"gas.gas_model.GasModelException@../gas/thermo/cea_thermo_curves.d(181): Coefficients for CEA curve could not be determined."

The only reason I am using the gm currently is to calculate the value for nu_inf. Is there a workaround? Or a common reason for this error?

uqngibbo commented 6 months ago

Ah okay. Can you also add gas_inf.T_modes = {T_inf} just below the massf line as well.

jr144393 commented 6 months ago

Thank you for your attention to this, after adding this, the check gives:

object.Exception@../util/json_helper.d(30): Failed to parse JSON from file: config/input.config Message is: Found 'a' when expecting 'u'. (Line 295:342)

uqngibbo commented 6 months ago

Usually that happens when a NaN has been written to the config file. Can you check Line 295 of input.config and report what you find?

jr144393 commented 6 months ago

I decided to get rid of the extra gas state, and calculate those parameters elsewhere before reading it in. I am not sure, but perhaps the extra gas state was interacting poorly with the way I was building the flowstate. I'll use this workaround for now, thank you for your attention on this matter.

jr144393 commented 6 months ago

Forgot to close on comment.