9.2
general documentation
cs_macfb_priv.h
Go to the documentation of this file.
1#ifndef CS_MACFB_PRIV_H
2#define CS_MACFB_PRIV_H
3
4/*============================================================================
5 * Definition of cs_macfb_scaleq_t and cs_macfb_vecteq structures
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2026 EDF S.A.
12
13 This program is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License as published by the Free Software
15 Foundation; either version 2 of the License, or (at your option) any later
16 version.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 details.
22
23 You should have received a copy of the GNU General Public License along with
24 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25 Street, Fifth Floor, Boston, MA 02110-1301, USA.
26*/
27
28/*----------------------------------------------------------------------------
29 * Local headers
30 *----------------------------------------------------------------------------*/
31
32#include "cdo/cs_equation_bc.h"
34#include "cdo/cs_hodge.h"
36
37/*============================================================================
38 * Macro definitions
39 *============================================================================*/
40
41/*============================================================================
42 * Type definitions
43 *============================================================================*/
44
45/* Algebraic system for MAC face-based discretization */
46
48
49 /* Ids related to the variable field and to the boundary flux field */
50
53
54 /* System size (n_faces) */
55
58
59 /* Solution of the algebraic system DoF unknowns (x) + BCs */
60
61 cs_real_t *face_values; /* At the last iteration */
62 cs_real_t *face_values_pre; /* At the previous iteration */
63
64 /* Array storing the value arising from the contribution of all source
65 terms (only allocated to n_cells) */
66
68
69 /* Pointer of function to build the diffusion term */
70
75
76 /* Pointer of functions to define the advection term:
77 * advection_open is called first, then advection_main which calls
78 * advection_scheme and after the build step, advection_close is called last
79 */
80
85
87
88 /* If one needs to build a local hodge op. for time and reaction */
89
92};
93
94typedef struct _cs_macfb_t cs_macfb_priv_t;
95
96/*============================================================================
97 * Public function prototypes
98 *============================================================================*/
99
100/*----------------------------------------------------------------------------*/
109/*----------------------------------------------------------------------------*/
110
113 cs_macfb_priv_t *eqc);
114
115#endif /* CS_MACFB_PRIV_H */
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:325
void() cs_cdo_enforce_bc_t(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Enforcement of a boundary condition (Dirichlet, Robin, sliding...)
Definition: cs_equation_bc.h:86
void() cs_macfb_adv_scheme_t(const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, cs_cell_builder_t *cb, cs_sdm_t *adv, cs_real_t *rhs)
Define the local convection operator in MAC-Fb schemes. Case of an operator that should be assemble i...
Definition: cs_macfb_advection.h:90
void() cs_macfb_adv_open_hook_t(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, const cs_cell_sys_t *csys, void *input, cs_cell_builder_t *cb)
Perform preprocessing such as the computation of the advection flux at the expected location in order...
Definition: cs_macfb_advection.h:68
void() cs_macfb_adv_close_hook_t(const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, const cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Operation done after the matrix related to the advection term has been defined.
Definition: cs_macfb_advection.h:133
void() cs_macfb_adv_build_t(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, cs_macfb_adv_scheme_t *scheme_func, cs_cell_sys_t *csys, cs_cell_builder_t *cb)
Build the cellwise advection operator for MAC-Fb schemes The local matrix related to this operator is...
Definition: cs_macfb_advection.h:114
void cs_macfb_set_advection_function(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, cs_macfb_priv_t *eqc)
Set the advection-related parameters in the context structure of MAC face-based schemes.
Definition: cs_macfb_priv.cpp:87
Definition: cs_macfb_priv.h:47
cs_lnum_t n_dofs
Definition: cs_macfb_priv.h:57
cs_macfb_adv_build_t * advection_main
Definition: cs_macfb_priv.h:82
cs_macfb_adv_scheme_t * advection_scheme
Definition: cs_macfb_priv.h:84
cs_cdo_enforce_bc_t * enforce_sliding
Definition: cs_macfb_priv.h:74
cs_hodge_param_t mass_hodgep
Definition: cs_macfb_priv.h:90
cs_hodge_t ** diffusion_hodge
Definition: cs_macfb_priv.h:71
cs_cdo_enforce_bc_t * enforce_dirichlet
Definition: cs_macfb_priv.h:72
cs_lnum_t n_faces
Definition: cs_macfb_priv.h:56
cs_macfb_adv_close_hook_t * advection_close
Definition: cs_macfb_priv.h:83
cs_real_t * face_values_pre
Definition: cs_macfb_priv.h:62
cs_macfb_adv_open_hook_t * advection_open
Definition: cs_macfb_priv.h:81
void * advection_input
Definition: cs_macfb_priv.h:86
cs_real_t * source_terms
Definition: cs_macfb_priv.h:67
int bflux_field_id
Definition: cs_macfb_priv.h:52
cs_cdo_enforce_bc_t * enforce_robin_bc
Definition: cs_macfb_priv.h:73
cs_real_t * face_values
Definition: cs_macfb_priv.h:61
int var_field_id
Definition: cs_macfb_priv.h:51
cs_hodge_t ** mass_hodge
Definition: cs_macfb_priv.h:91
Store common elements used when building an algebraic system related to an equation.
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:190
Structure storing all metadata/parameters related to the usage of a discrete Hodge operator.
Definition: cs_hodge.h:147
Structure associated to a discrete Hodge operator *.
Definition: cs_hodge.h:179