My Project
programmer's documentation
Functions
cs_fan.c File Reference
#include "cs_defs.h"
#include <assert.h>
#include <math.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "bft_mem.h"
#include "cs_base.h"
#include "cs_field.h"
#include "cs_log.h"
#include "cs_math.h"
#include "cs_parall.h"
#include "cs_fan.h"
Include dependency graph for cs_fan.c:

Functions

void CS_PROCF (debvtl, DEBVTL)
 
void CS_PROCF (tsvvtl, TSVVTL)
 
void cs_fan_define (int fan_dim, const cs_real_t inlet_axis_coords[3], const cs_real_t outlet_axis_coords[3], cs_real_t fan_radius, cs_real_t blades_radius, cs_real_t hub_radius, const cs_real_t curve_coeffs[3], cs_real_t axial_torque)
 Fan definition (added to the ones previously defined) More...
 
void cs_fan_destroy_all (void)
 Destroy the structures associated with fans. More...
 
int cs_fan_n_fans (void)
 Return number of fans. More...
 
void cs_fan_log_setup (void)
 Log fans definition setup information. More...
 
void cs_fan_log_iteration (void)
 Log fan information for a given iteration. More...
 
void cs_fan_build_all (const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities)
 Define the cells belonging to the different fans. More...
 
void cs_fan_compute_flows (const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities, const cs_real_t i_mass_flux[], const cs_real_t b_mass_flux[], const cs_real_t c_rho[], const cs_real_t b_rho[])
 Compute the flows through the fans. More...
 
void cs_fan_compute_force (const cs_mesh_quantities_t *mesh_quantities, cs_real_3_t source_t[])
 Compute the force induced by the fans (needs a previous calculation of the flows through each fan). More...
 
void cs_fan_flag_cells (const cs_mesh_t *mesh, int cell_fan_id[])
 Flag the cells belonging to the different fans (by the fan id, -1 otherwise) More...
 
void cs_fan_cells_select (void *input, cs_lnum_t *n_cells, cs_lnum_t **cell_ids)
 Selection function for cells belonging to fans. More...
 

Detailed Description

Fan modeling through velocity source terms.

Function Documentation

◆ cs_fan_build_all()

void cs_fan_build_all ( const cs_mesh_t mesh,
const cs_mesh_quantities_t mesh_quantities 
)

Define the cells belonging to the different fans.

Parameters
[in]meshassociated mesh structure
[in]mesh_quantitiesmesh quantities

◆ cs_fan_cells_select()

void cs_fan_cells_select ( void *  input,
cs_lnum_t n_cells,
cs_lnum_t **  cell_ids 
)

Selection function for cells belonging to fans.

This function may be used for the definition of postprocessing meshes.

Parameters
[in,out]inputpointer to input (unused here)
[out]n_cellsnumber of selected cells
[out]cell_idsarray of selected cell ids (0 to n-1 numbering)

◆ cs_fan_compute_flows()

void cs_fan_compute_flows ( const cs_mesh_t mesh,
const cs_mesh_quantities_t mesh_quantities,
const cs_real_t  i_mass_flux[],
const cs_real_t  b_mass_flux[],
const cs_real_t  c_rho[],
const cs_real_t  b_rho[] 
)

Compute the flows through the fans.

Parameters
[in]meshmesh structure
[in]mesh_quantitiesmesh quantities
[in]i_mass_fluxinterior faces mass flux
[in]b_mass_fluxboundary faces mass flux
[in]c_rhodensity at cells
[in]b_rhodensity at boundary faces

◆ cs_fan_compute_force()

void cs_fan_compute_force ( const cs_mesh_quantities_t mesh_quantities,
cs_real_3_t  source_t[] 
)

Compute the force induced by the fans (needs a previous calculation of the flows through each fan).

Parameters
[in]mesh_quantitiesmesh quantities
[in]source_texplicit source term for the velocity

◆ cs_fan_define()

void cs_fan_define ( int  fan_dim,
const cs_real_t  inlet_axis_coords[3],
const cs_real_t  outlet_axis_coords[3],
cs_real_t  fan_radius,
cs_real_t  blades_radius,
cs_real_t  hub_radius,
const cs_real_t  curve_coeffs[3],
cs_real_t  axial_torque 
)

Fan definition (added to the ones previously defined)

Fans are handled as explicit momentum source terms at the given location, based on the fan's axis and diameter. The fan's pressure characteristic curve is defined by 3 coefficients, such that: $\delta P = C_0 + C_1.flow + C_2.flow^2$. An axial torque may also be defined for the 3D model.

Parameters
[in]fan_dimfan dimension: 2: pseudo-2D (extruded mesh) 3: 3D (standard)
[in]inlet_axis_coordsintersection of axis and inlet face
[in]outlet_axis_coordsintersection of axis and outlet face
[in]fan_radiusfan radius
[in]blades_radiusblades radius
[in]hub_radiushub radius
[in]curve_coeffscoefficients of degre 0, 1 and 2 of the pressure drop/flow rate characteristic curve
[in]axial_torquefan axial torque

◆ cs_fan_destroy_all()

void cs_fan_destroy_all ( void  )

Destroy the structures associated with fans.

◆ cs_fan_flag_cells()

void cs_fan_flag_cells ( const cs_mesh_t mesh,
int  cell_fan_id[] 
)

Flag the cells belonging to the different fans (by the fan id, -1 otherwise)

Parameters
[in]meshassosiated mesh structure
[out]cell_fan_idfan id (or -1) for each cell

◆ cs_fan_log_iteration()

void cs_fan_log_iteration ( void  )

Log fan information for a given iteration.

◆ cs_fan_log_setup()

void cs_fan_log_setup ( void  )

Log fans definition setup information.

◆ cs_fan_n_fans()

int cs_fan_n_fans ( void  )

Return number of fans.

Returns
number of defined fans

◆ CS_PROCF() [1/2]

void CS_PROCF ( debvtl  ,
DEBVTL   
)

◆ CS_PROCF() [2/2]

void CS_PROCF ( tsvvtl  ,
TSVVTL   
)