URANS in code_saturne
Forum rules
Please read the forum usage recommendations before posting.
Please read the forum usage recommendations before posting.
URANS in code_saturne
Hello,
Now I am looking for how to run URANS simulation. However, I cannot find any options about URANS in GUI.
Could you tell me how to set URANS? Should I set it in setip.xml manually(not GUI)?
At least, there is no option such as "unsteady" in time setting.
I use version 6.0.5 now.
I hope someone give me tips.
Tsubasa
Now I am looking for how to run URANS simulation. However, I cannot find any options about URANS in GUI.
Could you tell me how to set URANS? Should I set it in setip.xml manually(not GUI)?
At least, there is no option such as "unsteady" in time setting.
I use version 6.0.5 now.
I hope someone give me tips.
Tsubasa
-
- Posts: 4194
- Joined: Mon Feb 20, 2012 3:25 pm
Re: URANS in code_saturne
Hello,
In code_saturne, RANS is actually URANS (there are no "true" steady models).
Best regards,
Yvan
In code_saturne, RANS is actually URANS (there are no "true" steady models).
Best regards,
Yvan
Re: URANS in code_saturne
Hello,
Oh, I didn't know that. Sorry for trivial question.
Thank you.
Tsubasa
Oh, I didn't know that. Sorry for trivial question.
Thank you.
Tsubasa
-
- Posts: 41
- Joined: Tue Apr 09, 2024 3:26 am
Re: URANS in code_saturne
Hi Yvon,
Could you please expand on this answer regarding URANS? In particular, the differences between the pseudo-steady stepping and constant time stepping. They should converge on the same solution, no?
The reason I ask, is that when I run a calculation (constant time step) for an extended period of time, the fields have no unsteady features left, and it appears "time-averaged". I wanted to verify that the post-processed fields are in fact time-averaged, or whether there are other settings required to produce instantaneous and time-averaged fields.
Secondly, I am still unsure of the target CFL number for these calculations. If possible, could you please provide guidance on this as well?
Best regards,
Sean Hanrahan
Could you please expand on this answer regarding URANS? In particular, the differences between the pseudo-steady stepping and constant time stepping. They should converge on the same solution, no?
The reason I ask, is that when I run a calculation (constant time step) for an extended period of time, the fields have no unsteady features left, and it appears "time-averaged". I wanted to verify that the post-processed fields are in fact time-averaged, or whether there are other settings required to produce instantaneous and time-averaged fields.
Secondly, I am still unsure of the target CFL number for these calculations. If possible, could you please provide guidance on this as well?
Best regards,
Sean Hanrahan
-
- Posts: 4194
- Joined: Mon Feb 20, 2012 3:25 pm
Re: URANS in code_saturne
Hello,
If the actual solution is steady, yes, in theory pseudo steady should converge to the same solution as unsteady (though you may have small differences as the pressure-velocity coupling involves the Rhie&Chow filter which introduces a time step term).
If the physical solution has low frequency fluctuations (at a larger time scale than the characteristic averaging time scale of the turbulence model), the unsteady model may/should capture this, while witj the pseudo steady model, even if you do observe fluctuations, you cannot interpret them.
The code in the turbulence models themselves is the same. Only the time stepping scheme comes into play here.
Best regards,
Yvan
If the actual solution is steady, yes, in theory pseudo steady should converge to the same solution as unsteady (though you may have small differences as the pressure-velocity coupling involves the Rhie&Chow filter which introduces a time step term).
If the physical solution has low frequency fluctuations (at a larger time scale than the characteristic averaging time scale of the turbulence model), the unsteady model may/should capture this, while witj the pseudo steady model, even if you do observe fluctuations, you cannot interpret them.
The code in the turbulence models themselves is the same. Only the time stepping scheme comes into play here.
Best regards,
Yvan
-
- Posts: 41
- Joined: Tue Apr 09, 2024 3:26 am
Re: URANS in code_saturne
Hi Yvon,
Thank you for your reply on this.
So just to confirm, just by setting the time stepping scheme to constant, the post-proeccesed soltuion is the time-averaged solution, not the instantaneous one.
Best regards,
Sean Hanrahan
Thank you for your reply on this.
So just to confirm, just by setting the time stepping scheme to constant, the post-proeccesed soltuion is the time-averaged solution, not the instantaneous one.
Best regards,
Sean Hanrahan
-
- Posts: 4194
- Joined: Mon Feb 20, 2012 3:25 pm
Re: URANS in code_saturne
Hello,
No, unless you specifically define a time average for post-processing, which will lead to a specific (addional) output, the "main" post processing output is the value at the output time step.
Depending on you mesh, boundary conditions, and numerical options, the solution can converge to something very stable/steady, or fluctuate around an average. Placing several probes in the domain and observing their time behavior will help you determine which is the case. Generating a time averaged output and comparing it to the the instantaneous output can also be of interest. You can also define a variance time moment, though this requires coding in cs_user_parameters.c, as it is not yet available in the GUI.
Best regards,
Yvan
No, unless you specifically define a time average for post-processing, which will lead to a specific (addional) output, the "main" post processing output is the value at the output time step.
Depending on you mesh, boundary conditions, and numerical options, the solution can converge to something very stable/steady, or fluctuate around an average. Placing several probes in the domain and observing their time behavior will help you determine which is the case. Generating a time averaged output and comparing it to the the instantaneous output can also be of interest. You can also define a variance time moment, though this requires coding in cs_user_parameters.c, as it is not yet available in the GUI.
Best regards,
Yvan
-
- Posts: 41
- Joined: Tue Apr 09, 2024 3:26 am
Re: URANS in code_saturne
Hi Yvon,
Thanks for your advice on this - this recommendation worked great.
Is there anyway to extract time-averaged surface quantities? I.e. like the time-averaged y^{+} values and shear-stress components?
Best regards,
Sean Hanrahan
Thanks for your advice on this - this recommendation worked great.
Is there anyway to extract time-averaged surface quantities? I.e. like the time-averaged y^{+} values and shear-stress components?
Best regards,
Sean Hanrahan
-
- Posts: 4194
- Joined: Mon Feb 20, 2012 3:25 pm
Re: URANS in code_saturne
Hello,
Yes, the time moments mechanism is designed to handle any type of field, and can work on boundary face-based fields such as y+, but this is still available only through coding in cs_user_parameters/cs_user_time_moments. THere are examples (though not for y+) here https://www.code-saturne.org/documentat ... eters.html (search for "Time moments").
Best regards,
Yvan
Yes, the time moments mechanism is designed to handle any type of field, and can work on boundary face-based fields such as y+, but this is still available only through coding in cs_user_parameters/cs_user_time_moments. THere are examples (though not for y+) here https://www.code-saturne.org/documentat ... eters.html (search for "Time moments").
Best regards,
Yvan
-
- Posts: 41
- Joined: Tue Apr 09, 2024 3:26 am
Re: URANS in code_saturne
Dear Yvon,
Thanks for your advice with this.
So I have been able to extract plus, but not a time-averaged wall stress components. I think that these components are calculated after runtime, whereas yplus is a field.
Could you please provide any advice with this?
Best regards,
Sean Hanrahan
Working code (CS8.3; cs_user_parameters.cpp):
Thanks for your advice with this.
So I have been able to extract plus, but not a time-averaged wall stress components. I think that these components are calculated after runtime, whereas yplus is a field.
Could you please provide any advice with this?
Best regards,
Sean Hanrahan
Working code (CS8.3; cs_user_parameters.cpp):
Code: Select all
static void
_wall_yp(const void *input,
cs_real_t *vals)
{
CS_NO_WARN_IF_UNUSED(input);
const int location_id = CS_MESH_LOCATION_BOUNDARY_FACES;
const cs_lnum_t n_elts = cs_mesh_location_get_n_elts(location_id)[0];
const cs_real_t *s1 = cs_field_by_name("yplus")->val;
for (cs_lnum_t i = 0; i < n_elts; i++) {
vals[i] = s1[i];
}
}
void
cs_user_time_moments(void)
{
/*
* We compute temporal means of the type <f1*f2*f3*...*fn>
* The fi's are variables defined by fields of a same location
* (usually cells or boundary faces)
* The parameters for time_moment_define_by_field_ids are:
* name <-- name of associated moment
* n_fields <-- number of associated fields
* field_id <-- ids of associated fields
* component_id <-- ids of matching field components (-1 for all)
* type <-- moment type (CS_TIME_MOMENT_MEAN
* or CS_TIME_MOMENT_VARIANCE)
* nt_start <-- starting time step (or -1 to use t_start)
* t_start <-- starting time
* restart_mode <-- behavior in case or restart:
* CS_TIME_MOMENT_RESTART_RESET,
* CS_TIME_MOMENT_RESTART_AUTO, or
* CS_TIME_MOMENT_RESTART_EXACT
* restart_name <-- name in previous run, null for default
*/
{
const char *yp_name[] = {"yp_mean"};
cs_time_moment_type_t m_type[] = {CS_TIME_MOMENT_MEAN};
for (int i = 0; i < 2; i++) {
cs_time_moment_define_by_func(yp_name[i],
CS_MESH_LOCATION_BOUNDARY_FACES,
1, /* field dimension */
true, /* intensive*/
_wall_yp, /* data_func */
nullptr, /* data_input */
nullptr, /* w_data_func */
nullptr, /* w_data_input */
m_type[i],
1, /* nt_start */
-1, /* t_start */
CS_TIME_MOMENT_RESTART_AUTO,
nullptr);
}
}
}