8.2
general documentation
cs_cdocb_scaleq.h
Go to the documentation of this file.
1 #ifndef __CS_CDOCB_SCALEQ_H__
2 #define __CS_CDOCB_SCALEQ_H__
3 
4 /*============================================================================
5  * Build an algebraic CDO cell-based system for the diffusion equations
6  * and solved it as one block (monolithic approach of the flux-potential
7  * coupling)
8  *============================================================================*/
9 
10 /*
11  This file is part of code_saturne, a general-purpose CFD tool.
12 
13  Copyright (C) 1998-2024 EDF S.A.
14 
15  This program is free software; you can redistribute it and/or modify it under
16  the terms of the GNU General Public License as published by the Free Software
17  Foundation; either version 2 of the License, or (at your option) any later
18  version.
19 
20  This program is distributed in the hope that it will be useful, but WITHOUT
21  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
22  FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
23  details.
24 
25  You should have received a copy of the GNU General Public License along with
26  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
27  Street, Fifth Floor, Boston, MA 02110-1301, USA.
28 */
29 
30 /*----------------------------------------------------------------------------*/
31 
32 #include "cs_defs.h"
33 
34 /*----------------------------------------------------------------------------
35  * Standard C library headers
36  *----------------------------------------------------------------------------*/
37 
38 /*----------------------------------------------------------------------------
39  * Local headers
40  *----------------------------------------------------------------------------*/
41 
42 #include "cs_base.h"
43 #include "cs_cdo_connect.h"
44 #include "cs_cdocb_priv.h"
45 #include "cs_cdo_quantities.h"
46 #include "cs_equation.h"
47 #include "cs_mesh.h"
48 #include "cs_time_step.h"
49 #include "cs_domain.h"
50 /*----------------------------------------------------------------------------*/
51 
53 
54 /*============================================================================
55  * Macro definitions
56  *============================================================================*/
57 
58 /*============================================================================
59  * Type definitions
60  *============================================================================*/
61 
62 /*============================================================================
63  * Static inline public function prototypes
64  *============================================================================*/
65 
66 /*============================================================================
67  * Public function prototypes
68  *============================================================================*/
69 
70 /*----------------------------------------------------------------------------*/
77 /*----------------------------------------------------------------------------*/
78 
79 bool
81 
82 /*----------------------------------------------------------------------------*/
89 /*----------------------------------------------------------------------------*/
90 
91 void
93  cs_cell_builder_t **cb);
94 
95 /*----------------------------------------------------------------------------*/
104 /*----------------------------------------------------------------------------*/
105 
106 void
108  const cs_cdo_quantities_t *cdoq,
109  const cs_cdo_connect_t *connect,
110  const cs_time_step_t *time_step);
111 
112 /*----------------------------------------------------------------------------*/
116 /*----------------------------------------------------------------------------*/
117 
118 void
120 
121 /*----------------------------------------------------------------------------*/
133 /*----------------------------------------------------------------------------*/
134 
135 void *
137  int var_id,
138  int bflux_id,
139  cs_equation_builder_t *eqb);
140 
141 /*----------------------------------------------------------------------------*/
149 /*----------------------------------------------------------------------------*/
150 
151 void *
152 cs_cdocb_scaleq_free_context(void *scheme_context);
153 
154 /*----------------------------------------------------------------------------*/
166 /*----------------------------------------------------------------------------*/
167 
168 void
170  const cs_mesh_t *mesh,
171  const cs_equation_param_t *eqp,
172  cs_equation_builder_t *eqb);
173 
174 /*----------------------------------------------------------------------------*/
187 /*----------------------------------------------------------------------------*/
188 
189 void
191  const int field_id,
192  const cs_mesh_t *mesh,
193  const cs_equation_param_t *eqp,
195  void *context);
196 
197 /*----------------------------------------------------------------------------*/
210 /*----------------------------------------------------------------------------*/
211 
212 void
214  const cs_equation_builder_t *eqb,
215  const cs_cdocb_scaleq_t *eqc,
216  const cs_cell_mesh_t *cm,
217  cs_hodge_t *diff_hodge,
218  cs_cell_sys_t *csys,
219  cs_cell_builder_t *cb);
220 
221 
222 /*----------------------------------------------------------------------------*/
235 /*----------------------------------------------------------------------------*/
236 
237 void
239  const cs_mesh_t *mesh,
240  const int field_id,
241  const cs_equation_param_t *eqp,
243  void *context);
244 
245 /*----------------------------------------------------------------------------*/
256 /*----------------------------------------------------------------------------*/
257 
258 void
261  void *context);
262 
263 /*----------------------------------------------------------------------------*/
275 /*----------------------------------------------------------------------------*/
276 
277 cs_real_t *
278 cs_cdocb_scaleq_get_cell_values(void *context,
279  bool previous);
280 
281 /*----------------------------------------------------------------------------*/
294 /*----------------------------------------------------------------------------*/
295 
296 void
298  const cs_equation_param_t *eqp,
299  cs_real_t t_eval,
301  void *context,
302  cs_real_t *diff_flux);
303 
304 /*----------------------------------------------------------------------------*/
316 /*----------------------------------------------------------------------------*/
317 
321  void *context);
322 
323 /*----------------------------------------------------------------------------*/
331 /*----------------------------------------------------------------------------*/
332 
333 void
336  void *context);
337 
338 /*----------------------------------------------------------------------------*/
339 
341 
342 #endif /* __CS_CDOCB_SCALEQ_H__ */
void cs_cdocb_scaleq_current_to_previous(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
Copy current content of the related variables-fields to previous values Case of the monolithic coupli...
Definition: cs_cdocb_scaleq.c:1631
void * cs_cdocb_scaleq_free_context(void *scheme_context)
Destroy a cs_cdocb_scaleq_t structure.
Definition: cs_cdocb_scaleq.c:1218
bool cs_cdocb_scaleq_is_initialized(void)
Check if the generic structures for building a CDO-Cb scheme are allocated.
Definition: cs_cdocb_scaleq.c:875
void cs_cdocb_scaleq_diffusion(const cs_equation_param_t *eqp, const cs_equation_builder_t *eqb, const cs_cdocb_scaleq_t *eqc, const cs_cell_mesh_t *cm, cs_hodge_t *diff_hodge, cs_cell_sys_t *csys, cs_cell_builder_t *cb)
Build the local matrices arising from the diffusion term in the scalar-valued CDO-Cb schemes.
Definition: cs_cdocb_scaleq.c:1478
void cs_cdocb_scaleq_setup(cs_real_t t_eval, const cs_mesh_t *mesh, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb)
Set the boundary conditions known from the settings Define an indirection array for the enforcement o...
Definition: cs_cdocb_scaleq.c:1278
cs_real_t * cs_cdocb_scaleq_get_cell_values(void *context, bool previous)
Retrieve an array of values at mesh vertices for the variable field associated to the given context T...
Definition: cs_cdocb_scaleq.c:1657
cs_cdo_balance_t * cs_cdocb_scaleq_balance(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
Compute the balance for an equation over the full computational domain Case of scalar-valued CDO cell...
Definition: cs_cdocb_scaleq.c:1740
void cs_cdocb_scaleq_init_sharing(const cs_mesh_t *mesh, const cs_cdo_quantities_t *cdoq, const cs_cdo_connect_t *connect, const cs_time_step_t *time_step)
Set shared pointers from the main domain members.
Definition: cs_cdocb_scaleq.c:919
void cs_cdocb_scaleq_extra_post(const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
Predefined extra-operations related to this equation.
Definition: cs_cdocb_scaleq.c:1866
void cs_cdocb_scaleq_solve_steady_state(bool cur2prev, const cs_mesh_t *mesh, const int field_id, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
Solve the steady-state equation with a CDO cell-based scheme Scalar-valued diffusion equation up-to-n...
Definition: cs_cdocb_scaleq.c:1529
void cs_cdocb_scaleq_init_values(cs_real_t t_eval, const int field_id, const cs_mesh_t *mesh, const cs_equation_param_t *eqp, cs_equation_builder_t *eqb, void *context)
Set the initial values of the variable field taking into account the boundary conditions....
Definition: cs_cdocb_scaleq.c:1324
void cs_cdocb_scaleq_get(cs_cell_sys_t **csys, cs_cell_builder_t **cb)
Retrieve work buffers used for building a CDO system cellwise.
Definition: cs_cdocb_scaleq.c:893
void cs_cdocb_scaleq_finalize_sharing(void)
Free shared pointers with lifecycle dedicated to this file.
Definition: cs_cdocb_scaleq.c:974
void * cs_cdocb_scaleq_init_context(cs_equation_param_t *eqp, int var_id, int bflux_id, cs_equation_builder_t *eqb)
Initialize a cs_cdocb_scaleq_t structure storing data useful for building and managing such a scheme.
Definition: cs_cdocb_scaleq.c:1010
void cs_cdocb_scaleq_diff_flux_faces(const cs_real_t *values, const cs_equation_param_t *eqp, cs_real_t t_eval, cs_equation_builder_t *eqb, void *context, cs_real_t *diff_flux)
Cellwise computation of the diffusive flux accross (primal) faces A scalar-valued flux for each face....
Definition: cs_cdocb_scaleq.c:1690
#define BEGIN_C_DECLS
Definition: cs_defs.h:528
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
#define END_C_DECLS
Definition: cs_defs.h:529
Definition: mesh.f90:26
Definition: cs_cdo_toolbox.h:68
Definition: cs_cdo_connect.h:61
Definition: cs_cdo_quantities.h:137
Set of local and temporary buffers.
Definition: cs_cdo_local.h:60
Set of local quantities and connectivities related to a mesh cell.
Definition: cs_cdo_local.h:203
Set of arrays and local (small) dense matrices related to a mesh cell This is a key structure for bui...
Definition: cs_cdo_local.h:147
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:193
Structure associated to a discrete Hodge operator *.
Definition: cs_hodge.h:183
Definition: cs_mesh.h:85
time step descriptor
Definition: cs_time_step.h:64