My Project
programmer's documentation
Enumerations | Functions
cs_balance_by_zone.h File Reference
#include "cs_defs.h"
#include "cs_base.h"
Include dependency graph for cs_balance_by_zone.h:

Go to the source code of this file.

Enumerations

enum  cs_balance_term_t {
  CS_BALANCE_VOLUME, CS_BALANCE_DIV, CS_BALANCE_UNSTEADY, CS_BALANCE_MASS,
  CS_BALANCE_MASS_IN, CS_BALANCE_MASS_OUT, CS_BALANCE_INTERIOR_IN, CS_BALANCE_INTERIOR_OUT,
  CS_BALANCE_BOUNDARY_IN, CS_BALANCE_BOUNDARY_OUT, CS_BALANCE_BOUNDARY_SYM, CS_BALANCE_BOUNDARY_WALL,
  CS_BALANCE_BOUNDARY_WALL_S, CS_BALANCE_BOUNDARY_WALL_R, CS_BALANCE_BOUNDARY_COUPLED, CS_BALANCE_BOUNDARY_COUPLED_E,
  CS_BALANCE_BOUNDARY_COUPLED_I, CS_BALANCE_BOUNDARY_OTHER, CS_BALANCE_TOTAL, CS_BALANCE_TOTAL_NORMALIZED,
  CS_BALANCE_N_TERMS
}
 
enum  cs_balance_p_term_t {
  CS_BALANCE_P_IN, CS_BALANCE_P_OUT, CS_BALANCE_P_U2_IN, CS_BALANCE_P_U2_OUT,
  CS_BALANCE_P_RHOGX_IN, CS_BALANCE_P_RHOGX_OUT, CS_BALANCE_P_U_IN, CS_BALANCE_P_U_OUT,
  CS_BALANCE_P_RHOU_IN, CS_BALANCE_P_RHOU_OUT, CS_BALANCE_P_N_TERMS
}
 

Functions

void cs_balance_by_zone_compute (const char *scalar_name, cs_lnum_t n_cells_sel, const cs_lnum_t cell_sel_ids[], cs_real_t balance[CS_BALANCE_N_TERMS])
 Compute the different terms of the balance of a given scalar, on a volume zone defined by selected cell ids/. More...
 
void cs_balance_by_zone (const char *selection_crit, const char *scalar_name)
 Compute and log the different terms of the balance of a given scalar, on a volumic zone defined by selection criteria. The different contributions to the balance are printed in the run_solver.log. More...
 
void cs_pressure_drop_by_zone_compute (cs_lnum_t n_cells_sel, const cs_lnum_t cell_sel_ids[], cs_real_t balance[CS_BALANCE_P_N_TERMS])
 Computes one term of the head loss balance (pressure drop) on a on a volume zone defined by selected cell ids/. More...
 
void cs_pressure_drop_by_zone (const char *selection_crit)
 Computes one term of the head loss balance (pressure drop) on a volumic zone defined by the criterion also given as argument. The different contributions are printed in the run_solver.log. More...
 
void cs_surface_balance (const char *selection_crit, const char *scalar_name, const cs_real_t normal[3])
 Compute the surface balance of a given scalar. More...
 
void cs_flux_through_surface (const char *scalar_name, const cs_real_t normal[3], cs_lnum_t n_b_faces_sel, cs_lnum_t n_i_faces_sel, const cs_lnum_t b_face_sel_ids[], const cs_lnum_t i_face_sel_ids[], cs_real_t *balance, cs_real_t *flux_b_faces, cs_real_t *flux_i_faces)
 Get the face by face surface flux of a given scalar, through a surface area defined by the given face ids. More...
 

Enumeration Type Documentation

◆ cs_balance_p_term_t

Pressure drop balance terms

Enumerator
CS_BALANCE_P_IN 

inlet pressure: p u

CS_BALANCE_P_OUT 

outlet pressure: p u

CS_BALANCE_P_U2_IN 

inlet contribution: u^2/2 rho u

CS_BALANCE_P_U2_OUT 

outlet contribution: u^2/2 rho u

CS_BALANCE_P_RHOGX_IN 

inlet contribution: -rho(g.x) u

CS_BALANCE_P_RHOGX_OUT 

outlet contribution: -rho(g.x) u

CS_BALANCE_P_U_IN 

inlet contribution: u

CS_BALANCE_P_U_OUT 

outlet contribution: u

CS_BALANCE_P_RHOU_IN 

inlet mass flow: rho u

CS_BALANCE_P_RHOU_OUT 

outlet mass flow: rho u

CS_BALANCE_P_N_TERMS 

◆ cs_balance_term_t

Balance terms

Enumerator
CS_BALANCE_VOLUME 

volume contribution of unsteady terms

CS_BALANCE_DIV 

volume contribution due to div(rho.u)

CS_BALANCE_UNSTEADY 

contribution of unsteady terms (volume + div(rho.u))

CS_BALANCE_MASS 

in and out-flowing mass

CS_BALANCE_MASS_IN 

inflowing mass

CS_BALANCE_MASS_OUT 

outflowing mass

CS_BALANCE_INTERIOR_IN 

inflow through interior faces

CS_BALANCE_INTERIOR_OUT 

outflow through interior faces

CS_BALANCE_BOUNDARY_IN 

inflow through boundary faces

CS_BALANCE_BOUNDARY_OUT 

outflow through boundary faces

CS_BALANCE_BOUNDARY_SYM 

symmetry faces

CS_BALANCE_BOUNDARY_WALL 

wall faces (rough + smoothe)

CS_BALANCE_BOUNDARY_WALL_S 

smooth wall faces

CS_BALANCE_BOUNDARY_WALL_R 

rough wall faces

CS_BALANCE_BOUNDARY_COUPLED 

coupled boundary faces (all)

CS_BALANCE_BOUNDARY_COUPLED_E 

externally coupled boundary faces

CS_BALANCE_BOUNDARY_COUPLED_I 

internally coupled boundary faces

CS_BALANCE_BOUNDARY_OTHER 

other boundary faces

CS_BALANCE_TOTAL 

total balance

CS_BALANCE_TOTAL_NORMALIZED 

total balance normalized by square root of total volume

CS_BALANCE_N_TERMS 

Function Documentation

◆ cs_balance_by_zone()

void cs_balance_by_zone ( const char *  selection_crit,
const char *  scalar_name 
)

Compute and log the different terms of the balance of a given scalar, on a volumic zone defined by selection criteria. The different contributions to the balance are printed in the run_solver.log.

This function computes the balance relative to a given scalar on a selected zone of the mesh. We assume that we want to compute balances (convective and diffusive) at the boundaries of the calculation domain represented below (with different boundary types).

The scalar and the zone are selected at the top of the routine by the user. In the case of the temperature, the energy balance in Joules will be computed by multiplying by the specific heat.

Parameters
[in]selection_critzone selection criterion
[in]scalar_namescalar name

◆ cs_balance_by_zone_compute()

void cs_balance_by_zone_compute ( const char *  scalar_name,
cs_lnum_t  n_cells_sel,
const cs_lnum_t  cell_sel_ids[],
cs_real_t  balance[CS_BALANCE_N_TERMS] 
)

Compute the different terms of the balance of a given scalar, on a volume zone defined by selected cell ids/.

This function computes the balance relative to a given scalar on a selected zone of the mesh. We assume that we want to compute balances (convective and diffusive) at the boundaries of the calculation domain represented below (with different boundary types).

In the case of the temperature, the energy balance in Joules will be computed by multiplying by the specific heat.

Parameters
[in]scalar_namescalar name
[in]n_cells_selnumber of selected cells
[in]cell_sel_idsids of selected cells
[out]balancearray of computed balance terms (see cs_balance_term_t)

◆ cs_flux_through_surface()

void cs_flux_through_surface ( const char *  scalar_name,
const cs_real_t  normal[3],
cs_lnum_t  n_b_faces_sel,
cs_lnum_t  n_i_faces_sel,
const cs_lnum_t  b_face_sel_ids[],
const cs_lnum_t  i_face_sel_ids[],
cs_real_t balance,
cs_real_t flux_b_faces,
cs_real_t flux_i_faces 
)

Get the face by face surface flux of a given scalar, through a surface area defined by the given face ids.

For interior faces, the flux is counted negatively relative to the given normal (as neighboring interior faces may have differently-aligned normals).

For boundary faces, the flux is counted negatively in the outwards-facing direction.

Parameters
[in]scalar_namescalar name
[in]normaloutwards normal direction
[in]n_b_faces_selnumber of selected boundary faces
[in]n_i_faces_selnumber of selected internal faces
[in]b_face_sel_idsids of selected boundary faces
[in]i_face_sel_idsids of selected internal faces
[out]balanceoptional array of computed balance terms (see cs_balance_term_t), of size CS_BALANCE_N_TERMS, or NULL
[out]flux_b_facesoptional surface flux through selected boundary faces, or NULL
[out]flux_i_facesoptional surface flux through selected interior faces, or NULL

◆ cs_pressure_drop_by_zone()

void cs_pressure_drop_by_zone ( const char *  selection_crit)

Computes one term of the head loss balance (pressure drop) on a volumic zone defined by the criterion also given as argument. The different contributions are printed in the run_solver.log.

Parameters
[in]selection_critzone selection criterion

◆ cs_pressure_drop_by_zone_compute()

void cs_pressure_drop_by_zone_compute ( cs_lnum_t  n_cells_sel,
const cs_lnum_t  cell_sel_ids[],
cs_real_t  balance[CS_BALANCE_P_N_TERMS] 
)

Computes one term of the head loss balance (pressure drop) on a on a volume zone defined by selected cell ids/.

Parameters
[in]n_cells_selnumber of selected cells
[in]cell_sel_idsids of selected cells
[out]balancearray of computed balance terms (see cs_balance_p_term_t)

◆ cs_surface_balance()

void cs_surface_balance ( const char *  selection_crit,
const char *  scalar_name,
const cs_real_t  normal[3] 
)

Compute the surface balance of a given scalar.

For interior faces, the flux is counted negatively relative to the given normal (as neighboring interior faces may have differently-aligned normals).

For boundary faces, the flux is counted negatively in the outwards-facing direction.

Parameters
[in]selection_critzone selection criterion
[in]scalar_namescalar name
[in]normaloutwards normal direction