Schmidt number in code saturne

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

Schmidt number in code saturne

Post 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
Luciano Garelli
Posts: 260
Joined: Fri Dec 04, 2015 1:42 pm

Re: Schmidt number in code saturne

Post 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
Tsubasa
Posts: 130
Joined: Fri Nov 20, 2020 4:09 am

Re: Schmidt number in code saturne

Post 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
Tsubasa
Posts: 130
Joined: Fri Nov 20, 2020 4:09 am

Re: Schmidt number in code saturne

Post 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
Yvan Fournier
Posts: 3500
Joined: Mon Feb 20, 2012 3:25 pm

Re: Schmidt number in code saturne

Post 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
Tsubasa
Posts: 130
Joined: Fri Nov 20, 2020 4:09 am

Re: Schmidt number in code saturne

Post 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
Last edited by Tsubasa on Thu Sep 23, 2021 5:39 pm, edited 2 times in total.
Tsubasa
Posts: 130
Joined: Fri Nov 20, 2020 4:09 am

Re: Schmidt number in code saturne

Post 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
Last edited by Tsubasa on Thu Sep 23, 2021 5:39 pm, edited 1 time in total.
Yvan Fournier
Posts: 3500
Joined: Mon Feb 20, 2012 3:25 pm

Re: Schmidt number in code saturne

Post 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
Tsubasa
Posts: 130
Joined: Fri Nov 20, 2020 4:09 am

Re: Schmidt number in code saturne

Post 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
Yvan Fournier
Posts: 3500
Joined: Mon Feb 20, 2012 3:25 pm

Re: Schmidt number in code saturne

Post 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
Post Reply