Page 1 of 3

Schmidt number in code saturne

Posted: Wed Apr 14, 2021 4:06 pm
by Tsubasa
Hello,

I have some questions about Schmidt number.

In code saturne,
1. How much is default Schmidt number?
2. Can we modify this?

Best regards,
Tsubasa

Re: Schmidt number in code saturne

Posted: Thu Apr 15, 2021 1:50 pm
by Luciano Garelli
Hello,

Did you check the theory guide of CS? It appears several times.

Also, you can search in the source code, the turbulent schmidt key for scalars is "ksigmas".

Regards,
Luciano

Re: Schmidt number in code saturne

Posted: Sun May 02, 2021 5:08 pm
by Tsubasa
Hello,

Although I looked for how to define default Schmidt number in code saturne, I cannnot find a correct section in the theory guide for this information. Would someone tell me this?

Best regards,
Tsubasa

Re: Schmidt number in code saturne

Posted: Mon May 03, 2021 11:41 am
by Tsubasa
Hello,

Now, I am looking for information about Schmidt number and how much default it is in code saturne.
Then I want to check the source code, but where can I check this in the following src directory?
a.png
Sorry I am not familiar with this kind of computational things,

Also as I said in the prvious post,
although I looked for how to define default Schmidt number in code saturne, I cannnot find a correct section in the theory guide for this information. Would someone tell me this?

Best regards,
Tsubasa

Re: Schmidt number in code saturne

Posted: Tue May 04, 2021 10:03 pm
by Yvan Fournier
Hello,

In most cases, it is recommended to search in all directories, but in this case, "base" (and possibly turb, for the turbulent Schmidt number) are the best places to look.

I also remember there was a recent comment on our side about the naming of the Schmidt number. I need to check, but if the way this is implemented does not seem to fit the standard definition, but includes another multiplier or divisor, do not hesitate to comment here.

Best regards,

Yvan

Re: Schmidt number in code saturne

Posted: Fri Sep 17, 2021 8:56 am
by Tsubasa
Bonjour,

Sorry for the late reply.
I found "default" Schmidt and Prandtl number in code saturne.
Let me answer myself to be sure.

This can can be seen in src/cogz/coini.f90

Code: Select all

! ---- Schmidt ou Prandtl turbulent

  turb_schmidt = 0.7d0
  call field_set_key_double(ivarfl(isca(jj)), ksigmas, turb_schmidt)
So the default value is 0.7 for Schmidt (also Prandtl number), isn't it?

Best regards,
Tsubasa

Re: Schmidt number in code saturne

Posted: Mon Sep 20, 2021 12:09 pm
by Tsubasa
Hello,

To set another value for Schmidt number.
Should I just put this when I want it to be 0.5

Code: Select all

call field_get_key_double(ivarfl(isca(iscal)), ksigmas, turb_schmidt)
turb_schmidt = 0.5;
in cs_user_physical_propoerties.f90?
or this in cs_user_parameters.c?

Code: Select all

void
cs_user_parameters(cs_domain_t   *domain)
{
  cs_field_get_key_double(f, cs_field_key_id("turb_schmidt "));
  turb_schmidt = 0.1
}
I also try this

Code: Select all

void
cs_user_parameters(cs_domain_t   *domain)
{
  0.5 = cs_field_get_key_double(f, cs_field_key_id("turb_schmidt"));
}
in in cs_user_parameters.c.

As far as I understand, should I put correct "field id" instead of "f", right?
So what is "field id" for this case?
Should I define "field id" in other lines in "cs_user_parameters.c"?

I tried this, but this is wrong.

Code: Select all

void
cs_user_parameters(cs_domain_t   *domain)
{
  cs_field_t *sca1 = cs_field_by_name("ksigmas");
   0.1 = cs_field_get_key_double(sca1, cs_field_key_id("ksigmas"));
}
Would someone help me?

Best regards,
Tsubasa

Re: Schmidt number in code saturne

Posted: Mon Sep 20, 2021 11:22 pm
by Yvan Fournier
Hello,

The first 2 methods (C and Fortran) seem OK. Methods 3 and 4 have programming errors : you cannot assign a variable value to a constant (i.e. "0.5 = function()) won't work.

Regards,

Yvan

Re: Schmidt number in code saturne

Posted: Tue Sep 21, 2021 8:18 am
by Tsubasa
Hello,

When compiling, this

Code: Select all

void
cs_user_parameters(cs_domain_t   *domain)
{
  cs_field_get_key_double(f, cs_field_key_id("turb_schmidt"));
  turb_schmidt = 0.5
}
Error happed

Code: Select all

/home/tsubasa/Desktop/scalr_transport/course/RESU/test_Sc12/src/cs_user_parameters.c: In function ‘cs_user_parameters’:
/home/tsubasa/Desktop/scalr_transport/course/RESU/test_Sc12/src/cs_user_parameters.c:167:27: error: ‘f’ undeclared (first use in this function)
   cs_field_get_key_double(f, cs_field_key_id("turb_schmidt"));
                           ^
/home/tsubasa/Desktop/scalr_transport/course/RESU/test_Sc12/src/cs_user_parameters.c:167:27: note: each undeclared identifier is reported only once for each function it appears in
/home/tsubasa/Desktop/scalr_transport/course/RESU/test_Sc12/src/cs_user_parameters.c:168:3: error: ‘turb_schmidt’ undeclared (first use in this function)
   turb_schmidt = 0.5
   ^~~~~~~~~~~~
So how should I define "f" in this case?

Best regards,
Tsubasa

Re: Schmidt number in code saturne

Posted: Tue Sep 21, 2021 2:04 pm
by Yvan Fournier
Hello,

You should check examples for cs_fields_set_key_double (set instead of get)..

The syntax is close but slightly different.

Best regards,

Yvan