Structure and functions handling the solidification module (modified Navier-Stokes + thermal module + transport equations) More...
#include "cs_defs.h"
#include <assert.h>
#include <float.h>
#include <bft_error.h>
#include <bft_mem.h>
#include <bft_printf.h>
#include "cs_cdofb_scaleq.h"
#include "cs_navsto_system.h"
#include "cs_parall.h"
#include "cs_post.h"
#include "cs_solid_selection.h"
#include "cs_solidification.h"
Macros | |
#define | CS_SOLIDIFICATION_DBG 0 |
Functions | |
bool | cs_solidification_is_activated (void) |
Test if solidification module is activated. More... | |
cs_solidification_t * | cs_solidification_get_structure (void) |
Retrieve the main structure to deal with solidification process. More... | |
void | cs_solidification_set_verbosity (int verbosity) |
Set the level of verbosity for the solidification module. More... | |
void | cs_solidification_set_forcing_eps (cs_real_t forcing_eps) |
Set the value of the epsilon parameter used in the forcing term of the momentum equation. More... | |
cs_solidification_t * | cs_solidification_activate (cs_solidification_model_t model, cs_flag_t options, cs_flag_t post_flag, const cs_boundary_t *boundaries, cs_navsto_param_model_t ns_model, cs_navsto_param_model_flag_t ns_model_flag, cs_navsto_param_coupling_t algo_coupling, cs_navsto_param_post_flag_t ns_post_flag) |
Activate the solidification module. More... | |
cs_solidification_stefan_t * | cs_solidification_get_stefan_struct (void) |
Get the structure defining the Stefan model. More... | |
cs_solidification_stefan_t * | cs_solidification_check_stefan_model (void) |
Sanity checks on the consistency of the Stefan's model settings. More... | |
void | cs_solidification_set_stefan_model (cs_real_t t_change, cs_real_t latent_heat) |
Set the main physical parameters which describe the Stefan model. More... | |
cs_solidification_voller_t * | cs_solidification_get_voller_struct (void) |
Get the structure defining the Voller model. More... | |
cs_solidification_voller_t * | cs_solidification_check_voller_model (void) |
Sanity checks on the consistency of the Voller's model settings. More... | |
void | cs_solidification_set_voller_model (cs_real_t beta, cs_real_t t_ref, cs_real_t t_solidus, cs_real_t t_liquidus, cs_real_t latent_heat, cs_real_t s_das) |
Set the main physical parameters which describe the Voller and Prakash modelling. More... | |
void | cs_solidification_set_voller_model_no_velocity (cs_real_t t_solidus, cs_real_t t_liquidus, cs_real_t latent_heat) |
Set the main physical parameters which describe the Voller and Prakash modelling. More... | |
cs_solidification_binary_alloy_t * | cs_solidification_get_binary_alloy_struct (void) |
Get the structure defining the binary alloy model. More... | |
cs_solidification_binary_alloy_t * | cs_solidification_check_binary_alloy_model (void) |
Sanity checks on the consistency of the settings of the binary alloy model. More... | |
void | cs_solidification_set_binary_alloy_model (const char *name, const char *varname, cs_real_t beta_t, cs_real_t temp0, cs_real_t beta_c, cs_real_t conc0, cs_real_t kp, cs_real_t mliq, cs_real_t t_eutec, cs_real_t t_melt, cs_real_t solute_diff, cs_real_t latent_heat, cs_real_t s_das) |
Set the main physical parameters which describe a solidification process with a binary alloy (with components A and B) Add a transport equation for the solute concentration to simulate the conv/diffusion of the alloy ratio between the two components of the alloy. More... | |
void | cs_solidification_set_strategy (cs_solidification_strategy_t strategy) |
Set the strategy to update quantitiess (liquid fraction and the thermal source term for the two main quantities) More... | |
void | cs_solidification_set_segr_functions (cs_solidification_func_t *vel_forcing, cs_solidification_func_t *cliq_update, cs_solidification_func_t *gliq_update, cs_solidification_func_t *thm_st_update) |
Set the functions to perform the update of physical properties and/or the computation of the thermal source term or quantities and/or the way to perform the coupling between the thermal equation and the bulk concentration computation. All this setting defines the way to compute the solidification process of a binary alloy. If a function is set to NULL then the automatic settings are kept. More... | |
cs_solidification_t * | cs_solidification_destroy_all (void) |
Free the main structure related to the solidification module. More... | |
void | cs_solidification_init_setup (void) |
Setup equations/properties related to the solidification module. More... | |
void | cs_solidification_finalize_setup (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant) |
Finalize the setup stage for equations related to the solidification module. More... | |
void | cs_solidification_log_setup (void) |
Summarize the solidification module in the log file dedicated to the setup. More... | |
void | cs_solidification_init_values (const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step) |
Set an initial values for all quantities related to this module This is done after the setup step. More... | |
void | cs_solidification_compute (const cs_mesh_t *mesh, const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *time_step) |
Solve equations related to the solidification module. More... | |
void | cs_solidification_extra_op (const cs_cdo_connect_t *connect, const cs_cdo_quantities_t *quant, const cs_time_step_t *ts) |
Predefined extra-operations for the solidification module. More... | |
void | cs_solidification_extra_post (void *input, int mesh_id, int cat_id, int ent_flag[5], cs_lnum_t n_cells, cs_lnum_t n_i_faces, cs_lnum_t n_b_faces, const cs_lnum_t cell_ids[], const cs_lnum_t i_face_ids[], const cs_lnum_t b_face_ids[], const cs_time_step_t *time_step) |
Predefined post-processing output for the solidification module. Prototype of this function is fixed since it is a function pointer defined in cs_post.h (cs_post_time_mesh_dep_output_t) More... | |
Variables | |
static const char | _state_names [CS_SOLIDIFICATION_N_STATES][32] |
Structure and functions handling the solidification module (modified Navier-Stokes + thermal module + transport equations)
#define CS_SOLIDIFICATION_DBG 0 |
cs_solidification_t* cs_solidification_activate | ( | cs_solidification_model_t | model, |
cs_flag_t | options, | ||
cs_flag_t | post_flag, | ||
const cs_boundary_t * | boundaries, | ||
cs_navsto_param_model_t | ns_model, | ||
cs_navsto_param_model_flag_t | ns_model_flag, | ||
cs_navsto_param_coupling_t | algo_coupling, | ||
cs_navsto_param_post_flag_t | ns_post_flag | ||
) |
Activate the solidification module.
[in] | model | type of modelling |
[in] | options | flag to handle optional parameters |
[in] | post_flag | predefined post-processings |
[in] | boundaries | pointer to the domain boundaries |
[in] | ns_model | model equations for the NavSto system |
[in] | ns_model_flag | option flag for the Navier-Stokes system |
[in] | algo_coupling | algorithm used for solving the NavSto system |
[in] | ns_post_flag | predefined post-processings for Navier-Stokes |
cs_solidification_binary_alloy_t* cs_solidification_check_binary_alloy_model | ( | void | ) |
Sanity checks on the consistency of the settings of the binary alloy model.
cs_solidification_stefan_t* cs_solidification_check_stefan_model | ( | void | ) |
Sanity checks on the consistency of the Stefan's model settings.
cs_solidification_voller_t* cs_solidification_check_voller_model | ( | void | ) |
Sanity checks on the consistency of the Voller's model settings.
void cs_solidification_compute | ( | const cs_mesh_t * | mesh, |
const cs_cdo_connect_t * | connect, | ||
const cs_cdo_quantities_t * | quant, | ||
const cs_time_step_t * | time_step | ||
) |
Solve equations related to the solidification module.
[in] | mesh | pointer to a cs_mesh_t structure |
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in] | time_step | pointer to a cs_time_step_t structure |
cs_solidification_t* cs_solidification_destroy_all | ( | void | ) |
Free the main structure related to the solidification module.
void cs_solidification_extra_op | ( | const cs_cdo_connect_t * | connect, |
const cs_cdo_quantities_t * | quant, | ||
const cs_time_step_t * | ts | ||
) |
Predefined extra-operations for the solidification module.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in] | ts | pointer to a cs_time_step_t structure |
void cs_solidification_extra_post | ( | void * | input, |
int | mesh_id, | ||
int | cat_id, | ||
int | ent_flag[5], | ||
cs_lnum_t | n_cells, | ||
cs_lnum_t | n_i_faces, | ||
cs_lnum_t | n_b_faces, | ||
const cs_lnum_t | cell_ids[], | ||
const cs_lnum_t | i_face_ids[], | ||
const cs_lnum_t | b_face_ids[], | ||
const cs_time_step_t * | time_step | ||
) |
Predefined post-processing output for the solidification module. Prototype of this function is fixed since it is a function pointer defined in cs_post.h (cs_post_time_mesh_dep_output_t)
[in,out] | input | pointer to a optional structure (here a cs_gwf_t structure) |
[in] | mesh_id | id of the output mesh for the current call |
[in] | cat_id | category id of the output mesh for this call |
[in] | ent_flag | indicate global presence of cells (ent_flag[0]), interior faces (ent_flag[1]), boundary faces (ent_flag[2]), particles (ent_flag[3]) or probes (ent_flag[4]) |
[in] | n_cells | local number of cells of post_mesh |
[in] | n_i_faces | local number of interior faces of post_mesh |
[in] | n_b_faces | local number of boundary faces of post_mesh |
[in] | cell_ids | list of cells (0 to n-1) |
[in] | i_face_ids | list of interior faces (0 to n-1) |
[in] | b_face_ids | list of boundary faces (0 to n-1) |
[in] | time_step | pointer to a cs_time_step_t struct. |
void cs_solidification_finalize_setup | ( | const cs_cdo_connect_t * | connect, |
const cs_cdo_quantities_t * | quant | ||
) |
Finalize the setup stage for equations related to the solidification module.
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
cs_solidification_binary_alloy_t* cs_solidification_get_binary_alloy_struct | ( | void | ) |
Get the structure defining the binary alloy model.
cs_solidification_stefan_t* cs_solidification_get_stefan_struct | ( | void | ) |
Get the structure defining the Stefan model.
cs_solidification_t* cs_solidification_get_structure | ( | void | ) |
Retrieve the main structure to deal with solidification process.
cs_solidification_voller_t* cs_solidification_get_voller_struct | ( | void | ) |
Get the structure defining the Voller model.
void cs_solidification_init_setup | ( | void | ) |
Setup equations/properties related to the solidification module.
void cs_solidification_init_values | ( | const cs_mesh_t * | mesh, |
const cs_cdo_connect_t * | connect, | ||
const cs_cdo_quantities_t * | quant, | ||
const cs_time_step_t * | time_step | ||
) |
Set an initial values for all quantities related to this module This is done after the setup step.
[in] | mesh | pointer to a cs_mesh_t structure |
[in] | connect | pointer to a cs_cdo_connect_t structure |
[in] | quant | pointer to a cs_cdo_quantities_t structure |
[in] | time_step | pointer to a cs_time_step_t structure |
bool cs_solidification_is_activated | ( | void | ) |
Test if solidification module is activated.
void cs_solidification_log_setup | ( | void | ) |
Summarize the solidification module in the log file dedicated to the setup.
void cs_solidification_set_binary_alloy_model | ( | const char * | name, |
const char * | varname, | ||
cs_real_t | beta_t, | ||
cs_real_t | temp0, | ||
cs_real_t | beta_c, | ||
cs_real_t | conc0, | ||
cs_real_t | kp, | ||
cs_real_t | mliq, | ||
cs_real_t | t_eutec, | ||
cs_real_t | t_melt, | ||
cs_real_t | solute_diff, | ||
cs_real_t | latent_heat, | ||
cs_real_t | s_das | ||
) |
Set the main physical parameters which describe a solidification process with a binary alloy (with components A and B) Add a transport equation for the solute concentration to simulate the conv/diffusion of the alloy ratio between the two components of the alloy.
[in] | name | name of the binary alloy |
[in] | varname | name of the unknown related to the tracer eq. |
[in] | beta_t | thermal dilatation coefficient |
[in] | temp0 | reference temperature (Boussinesq term) |
[in] | beta_c | solutal dilatation coefficient |
[in] | conc0 | reference mixture concentration (Boussinesq term) |
[in] | kp | value of the distribution coefficient |
[in] | mliq | liquidus slope for the solute concentration |
[in] | t_eutec | temperature at the eutectic point |
[in] | t_melt | phase-change temperature for the pure material (A) |
[in] | solute_diff | solutal diffusion coefficient in the liquid |
[in] | latent_heat | latent heat |
[in] | s_das | secondary dendrite arm spacing |
void cs_solidification_set_forcing_eps | ( | cs_real_t | forcing_eps | ) |
Set the value of the epsilon parameter used in the forcing term of the momentum equation.
[in] | forcing_eps | epsilon used in the penalization term to avoid a division by zero |
void cs_solidification_set_segr_functions | ( | cs_solidification_func_t * | vel_forcing, |
cs_solidification_func_t * | cliq_update, | ||
cs_solidification_func_t * | gliq_update, | ||
cs_solidification_func_t * | thm_st_update | ||
) |
Set the functions to perform the update of physical properties and/or the computation of the thermal source term or quantities and/or the way to perform the coupling between the thermal equation and the bulk concentration computation. All this setting defines the way to compute the solidification process of a binary alloy. If a function is set to NULL then the automatic settings are kept.
–Advanced usage– This enables to finely control the numerical or physical modelling aspects.
[in] | vel_forcing | pointer to update the velocity forcing |
[in] | cliq_update | pointer to update the liquid concentration |
[in] | gliq_update | pointer to update the liquid fraction |
[in] | thm_st_update | pointer to update thermal source terms |
Set the main physical parameters which describe the Stefan model.
[in] | t_change | liquidus/solidus temperature (in K) |
[in] | latent_heat | latent heat |
void cs_solidification_set_strategy | ( | cs_solidification_strategy_t | strategy | ) |
Set the strategy to update quantitiess (liquid fraction and the thermal source term for the two main quantities)
[in] | strategy | strategy to perform the update of quantities |
void cs_solidification_set_verbosity | ( | int | verbosity | ) |
Set the level of verbosity for the solidification module.
[in] | verbosity | level of verbosity to set |
void cs_solidification_set_voller_model | ( | cs_real_t | beta, |
cs_real_t | t_ref, | ||
cs_real_t | t_solidus, | ||
cs_real_t | t_liquidus, | ||
cs_real_t | latent_heat, | ||
cs_real_t | s_das | ||
) |
Set the main physical parameters which describe the Voller and Prakash modelling.
[in] | beta | thermal dilatation coefficient |
[in] | t_ref | reference temperature (for the Boussinesq approx) |
[in] | t_solidus | solidus temperature (in K) |
[in] | t_liquidus | liquidus temperature (in K) |
[in] | latent_heat | latent heat |
[in] | s_das | secondary dendrite space arms |
void cs_solidification_set_voller_model_no_velocity | ( | cs_real_t | t_solidus, |
cs_real_t | t_liquidus, | ||
cs_real_t | latent_heat | ||
) |
Set the main physical parameters which describe the Voller and Prakash modelling.
[in] | beta | thermal dilatation coefficient |
[in] | t_ref | reference temperature (for the Boussinesq approx) |
[in] | t_solidus | solidus temperature (in K) |
[in] | t_liquidus | liquidus temperature (in K) |
[in] | latent_heat | latent heat |
|
static |