Schmidt number in code saturne

Questions and remarks about code_saturne usage
Forum rules
Please read the forum usage recommendations before posting.
Tsubasa
Posts: 175
Joined: Fri Nov 20, 2020 4:09 am

Re: Schmidt number in code saturne

Post by Tsubasa »

Hello Yvan,

Sorry, I did not understand well about it.
I checked Doxygen and now I understood how to access a field,
and now I can find different behaviors by each schmidt number.

I would like to show the code for someone who want to do same thing.

Code: Select all

void
cs_user_parameters(cs_domain_t   *domain)
{
  cs_field_t *sch_scal1 = cs_field_by_name("scalar1");  //scalar1 is name of scalar which can be seen in GUI
  cs_field_set_key_double(sch_scal1, cs_field_key_id("turbulent_schmidt"), 0.1);  //0.1 is schmidt number which you can change
}
in cs_user_parameters.c

Best regards,
Tsubasa
Tsubasa
Posts: 175
Joined: Fri Nov 20, 2020 4:09 am

Re: Schmidt number in code saturne

Post by Tsubasa »

Hello Yvan,

I compared two pollutant simulations; one with Sch(schmidt number)=0.7 and the other with default Sch.

So far I thought default Sch in codesaturne is 0.7 according to src/cogz/coini.f90 following

Code: Select all

CODE: SELECT ALL

! ---- Schmidt ou Prandtl turbulent

  turb_schmidt = 0.7d0
  call field_set_key_double(ivarfl(isca(jj)), ksigmas, turb_schmidt)
Bbut is it wrong? Two simulations shows completely different results, and I found that default Sch is 1.0 according to my simulation results. Would you tell me this?

Best regards,
Hamada
Yvan Fournier
Posts: 4070
Joined: Mon Feb 20, 2012 3:25 pm

Re: Schmidt number in code saturne

Post by Yvan Fournier »

Hello,

The actual default is in src/base/cs_parameters.c, here :

Code: Select all

 cs_field_define_key_double("turbulent_schmidt",
                             1., CS_FIELD_VARIABLE); /* sigmas(iscal) */
The code in coini1 changes this a a specific model (gas combustion, fire modeling).

So this seems consistent with your observations. Note also that in case of doublt, you can check the keyword value setings for each field in the "setup.log" file.

Best regards,

Yvan
Post Reply