Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

hy2Foam: Updated turbulent terms and Mach number calculation #141

Open
wants to merge 7 commits into
base: master
Choose a base branch
from

Conversation

alexlshepherd
Copy link

@alexlshepherd alexlshepherd commented Jul 5, 2023

Turbulent Terms and Mach Number Calculation

Changes

Writes out the heat capactiy ratio, gamma, as a volScalarField, this is useful for post-processing. Calculation of gamma, and subsequently the Mach number, were modified to use the total (translational, rotational, vibrational, etc.) heat capacities. This revised calculation aligns with the common definition of speed of sound. The current release of hy2Foam uses only the tranlstional-rotational heat capacities to calculate the speed of sound, the reasons for this are unclear despite the provided.

The species conservation equation is modified to now include turbulent terms, making use of the turbulent Schmidt number defined in the transportProperties dictionary:

transportModels
{
  ...
  diffusionModelParameters
  {
    ...
    TurbulentSchmidtNumber   0.7;
  }
}

The viscous energy equation now includes turbulent thermal diffusivity terms. These changes have been only applied to the single temperature equations, so further modifications may need to be made to work with a two temperature model.

Known Issues

The turbulent Schmidt number must be defined in all cases, currently this parameter has no default value, and is still used in the laminar case, however since the turbulent viscosity mut() is zero this shouldn't be an issue. An error is occasionally raised when this fork is initially run, the simulation will then proceed as normal and can be largely ignored without issue. It has been observed that a case using "too many" or "too little" processors , when running a case in parallel with adjustableRunTime enabled, will start with timesteps on the order of 1e-100s. This behaviour has not been observed in hy2Foam (unmodified), and to mitigate it one can start with a fixed time step initially and change back later, or just simply change the number of processors.

Changes to Data Files

Reaction rate constants, variable A, were off by a few orders of magnitude in hTCReactionsES. This is likely a mistake due to unit conversion. This change was only made to one file for clarity, and should be updated in the other tutorial folders.

Molecular data in thermoDEM_TRVE was updated. Comments in that file elaborate on this. This change was only made to one file for clarity, and should be updated in the other tutorial folders as well as the variants: thermoDEM, thermoDEM_TR, etc.

Use total heat capacities in Mach calculation.
Read turbulent Schmidt number
Added turbulent mass diffusivity with turbulent Schmidt number.
Added turbulent thermal diffusivity.
Use total heat capacity ratios to calculate Mach number.
Revised reaction rates.
Updated gas properties.
@sunny7bit
Copy link

nice job!

@LDK29
Copy link

LDK29 commented Oct 20, 2023

Very useful work!!!

@LDK29
Copy link

LDK29 commented Oct 23, 2023

Turbulent Terms and Mach Number Calculation

Changes

Writes out the heat capactiy ratio, gamma, as a volScalarField, this is useful for post-processing. Calculation of gamma, and subsequently the Mach number, were modified to use the total (translational, rotational, vibrational, etc.) heat capacities. This revised calculation aligns with the common definition of speed of sound. The current release of hy2Foam uses only the tranlstional-rotational heat capacities to calculate the speed of sound, the reasons for this are unclear despite the provided.

The species conservation equation is modified to now include turbulent terms, making use of the turbulent Schmidt number defined in the transportProperties dictionary:

transportModels
{
  ...
  diffusionModelParameters
  {
    ...
    TurbulentSchmidtNumber   0.7;
  }
}

The viscous energy equation now includes turbulent thermal diffusivity terms. These changes have been only applied to the single temperature equations, so further modifications may need to be made to work with a two temperature model.

Known Issues

The turbulent Schmidt number must be defined in all cases, currently this parameter has no default value, and is still used in the laminar case, however since the turbulent viscosity mut() is zero this shouldn't be an issue. An error is occasionally raised when this fork is initially run, the simulation will then proceed as normal and can be largely ignored without issue. It has been observed that a case using "too many" or "too little" processors , when running a case in parallel with adjustableRunTime enabled, will start with timesteps on the order of 1e-100s. This behaviour has not been observed in hy2Foam (unmodified), and to mitigate it one can start with a fixed time step initially and change back later, or just simply change the number of processors.

Changes to Data Files

Reaction rate constants, variable A, were off by a few orders of magnitude in hTCReactionsES. This is likely a mistake due to unit conversion. This change was only made to one file for clarity, and should be updated in the other tutorial folders.

Molecular data in thermoDEM_TRVE was updated. Comments in that file elaborate on this. This change was only made to one file for clarity, and should be updated in the other tutorial folders as well as the variants: thermoDEM, thermoDEM_TR, etc.

Hi Shepherd,
I am a user of hy2Foam. Recently, I want to let hy2Foam output the vibrationasl energy of species, VT relaxtion time and the mass production rates of species. I have tried many times to change the codes, but it still can't work. Could you give some routines of output these variables? Thanks for your time and best regards.

@alexlshepherd
Copy link
Author

Hi @LDK29 ,
Unfortunately I'm not too sure. I've only been working with hy2Foam for about a year and haven't used the two temperature models, let alone have the theoretical basis for it. From what I can tell, variables have to be created in the createFields.H file, or one of its dependencies, and then calculated/updated somewhere in the main loop. Not sure if you looked at it already, but hTCProperties in the case folder has some flags that might be of some help. I kind of got lucky in my case as the variables were already there, they just needed to be corrected and written to file. Again, I'm still pretty new to this so I'm not sure how much more help I can be, but I hope this is of some use nonetheless.

@LDK29
Copy link

LDK29 commented Oct 24, 2023

Hi @alexlshepherd ,
Thanks for your reply. For vibrational energy, I finally output them by add codes in file "write.H" like:
forAll(composition.molecules(), moli)
{
const volScalarField e_v
(
IOobject
(
"e_v" + composition.molecules()[moli],
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::NO_WRITE
),
composition.hev(moli)
);
e_v.write();
}
But for the two other varibles, I still have no idea to output them. Anyway ,thanks for your suggestions.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants