Introduction
C user functions for code coupling.
Several functions are present in the file, each specific to different kind of couplings.
Global options for coupling
One can define global options for coupling with the user function cs_user_parameters. using cs_coupling_set_sync_flag allows defining the time step synchronization policy:
void cs_coupling_set_sync_flag(int flag)
Define an optional synchronization flag for external couplings.
Definition: cs_coupling.cpp:287
A time step multiplier between coupled tools may also be defined. The apparent time step for the current instance times (as viewed by coupled codes) is equal to the true time step times this multiplier.
When coupling with SYRTHES, it is recommended to use the same multiplier here as for the thermal variable time step (this is not automated, so as to allow for more advanced combinations if necessary, so the user should ensure this when using a time step multiplier). For example:
void cs_coupling_set_ts_multiplier(double m)
Define a time step multiplier for external couplings.
Definition: cs_coupling.cpp:326
Code coupling with SYRTHES
The cs_user_syrthes_coupling subroutine defines a or multiple couplings between code_saturne and SYRTHES by calling the cs_syr_coupling_define function for each coupling to add.
The following lines of code show different examples of coupling with SYRTHES.
Example 1
{
int verbosity = 1, plot = 1;
float tolerance = 0.1;
bool allow_nonmatching = false;
"3",
nullptr,
' ',
allow_nonmatching,
tolerance,
verbosity,
plot);
}
void cs_syr_coupling_define(const char *syrthes_name, const char *boundary_criteria, const char *volume_criteria, char projection_axis, bool allow_nonmatching, float tolerance, int verbosity, int visualization)
Define new SYRTHES coupling.
Definition: cs_syr_coupling.cpp:2148
Example 2
{
int verbosity = 1, plot = 1;
float tolerance = 0.1;
bool allow_nonmatching = false;
"Wall",
nullptr,
'z',
allow_nonmatching,
tolerance,
verbosity,
plot);
}
Example 3
{
int verbosity = 1, plot = 1;
float tolerance = 0.1;
bool allow_nonmatching = false;
nullptr,
"box[0., 0., 0., 1., 1., 1.]",
' ',
allow_nonmatching,
tolerance,
verbosity,
plot);
}
Code coupling with other instances of code_saturne
The cs_user_saturne_coupling allows one to couple different instances of code_saturne by calling the cs_sat_coupling_define function for each coupling to add.
Two examples are provided hereafter.
Example 1
{
int verbosity = 1;
int reverse = 0;
"3 or 4",
nullptr,
nullptr,
"all[]",
reverse,
verbosity);
}
void cs_sat_coupling_define(const char *saturne_name, const char *boundary_cpl_criteria, const char *volume_cpl_criteria, const char *boundary_loc_criteria, const char *volume_loc_criteria, int reverse, int verbosity)
Define new code_saturne coupling.
Definition: cs_sat_coupling.cpp:1838
Example 2
{
int verbosity = 1;
int reverse = 0;
"coupled_faces",
"all[]",
nullptr,
"all[]",
reverse,
verbosity);
}