9.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-2026 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 "base/cs_defs.h"
33
34/*----------------------------------------------------------------------------
35 * Standard C library headers
36 *----------------------------------------------------------------------------*/
37
38/*----------------------------------------------------------------------------
39 * Local headers
40 *----------------------------------------------------------------------------*/
41
42#include "base/cs_base.h"
43#include "base/cs_time_step.h"
44#include "cdo/cs_cdo_connect.h"
46#include "cdo/cs_cdocb_priv.h"
47#include "cdo/cs_domain.h"
48#include "cdo/cs_equation.h"
49#include "mesh/cs_mesh.h"
50
51/*============================================================================
52 * Macro definitions
53 *============================================================================*/
54
55/*============================================================================
56 * Type definitions
57 *============================================================================*/
58
59/*============================================================================
60 * Static inline public function prototypes
61 *============================================================================*/
62
63/*============================================================================
64 * Public function prototypes
65 *============================================================================*/
66
67/*----------------------------------------------------------------------------*/
74/*----------------------------------------------------------------------------*/
75
76bool
78
79/*----------------------------------------------------------------------------*/
86/*----------------------------------------------------------------------------*/
87
88void
91
92/*----------------------------------------------------------------------------*/
101/*----------------------------------------------------------------------------*/
102
103void
105 const cs_cdo_quantities_t *cdoq,
106 const cs_cdo_connect_t *connect,
107 const cs_time_step_t *time_step);
108
109/*----------------------------------------------------------------------------*/
113/*----------------------------------------------------------------------------*/
114
115void
117
118/*----------------------------------------------------------------------------*/
130/*----------------------------------------------------------------------------*/
131
132void *
134 int var_id,
135 int bflux_id,
137
138/*----------------------------------------------------------------------------*/
146/*----------------------------------------------------------------------------*/
147
148void *
149cs_cdocb_scaleq_free_context(void *scheme_context);
150
151/*----------------------------------------------------------------------------*/
163/*----------------------------------------------------------------------------*/
164
165void
167 const cs_mesh_t *mesh,
168 const cs_equation_param_t *eqp,
170
171/*----------------------------------------------------------------------------*/
184/*----------------------------------------------------------------------------*/
185
186void
188 const int field_id,
189 const cs_mesh_t *mesh,
190 const cs_equation_param_t *eqp,
192 void *context);
193
194/*----------------------------------------------------------------------------*/
207/*----------------------------------------------------------------------------*/
208
209void
211 const cs_equation_builder_t *eqb,
212 const cs_cdocb_scaleq_t *eqc,
213 const cs_cell_mesh_t *cm,
214 cs_hodge_t *diff_hodge,
215 cs_cell_sys_t *csys,
217
218
219/*----------------------------------------------------------------------------*/
232/*----------------------------------------------------------------------------*/
233
234void
236 const cs_mesh_t *mesh,
237 const int field_id,
238 const cs_equation_param_t *eqp,
240 void *context);
241
242/*----------------------------------------------------------------------------*/
253/*----------------------------------------------------------------------------*/
254
255void
258 void *context);
259
260/*----------------------------------------------------------------------------*/
272/*----------------------------------------------------------------------------*/
273
274cs_real_t *
276 bool previous);
277
278/*----------------------------------------------------------------------------*/
290/*----------------------------------------------------------------------------*/
291
292cs_real_t *
294 bool previous);
295
296/*----------------------------------------------------------------------------*/
309/*----------------------------------------------------------------------------*/
310
311void
313 const cs_equation_param_t *eqp,
314 cs_real_t t_eval,
316 void *context,
317 cs_real_t *diff_flux);
318
319/*----------------------------------------------------------------------------*/
331/*----------------------------------------------------------------------------*/
332
336 void *context);
337
338/*----------------------------------------------------------------------------*/
346/*----------------------------------------------------------------------------*/
347
348void
351 void *context);
352
353#endif /* CS_CDOCB_SCALEQ_H */
time step descriptor
Definition: cs_time_step.h:60
void * cs_cdocb_scaleq_free_context(void *scheme_context)
Destroy a cs_cdocb_scaleq_t structure.
Definition: cs_cdocb_scaleq.cpp:1206
cs_real_t * cs_cdocb_scaleq_get_face_values(void *context, bool previous)
Retrieve an array of values at mesh faces for the variable field associated to the given context The ...
Definition: cs_cdocb_scaleq.cpp:1684
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.cpp:1625
bool cs_cdocb_scaleq_is_initialized(void)
Check if the generic structures for building a CDO-Cb scheme are allocated.
Definition: cs_cdocb_scaleq.cpp:862
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.cpp:1472
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.cpp:1272
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.cpp:905
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.cpp:1773
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.cpp:1899
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.cpp:1523
cs_real_t * cs_cdocb_scaleq_get_cell_values(void *context, bool previous)
Retrieve an array of values at mesh cellss for the variable field associated to the given context The...
Definition: cs_cdocb_scaleq.cpp:1651
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.cpp:994
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.cpp:1318
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.cpp:880
void cs_cdocb_scaleq_finalize_sharing(void)
Free shared pointers with lifecycle dedicated to this file.
Definition: cs_cdocb_scaleq.cpp:958
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.cpp:1723
double cs_real_t
Floating-point value.
Definition: cs_defs.h:332
Definition: mesh.f90:26
Definition: cs_cdo_toolbox.h:64
Definition: cs_cdo_connect.h:57
Definition: cs_cdo_quantities.h:142
Set of local and temporary buffers.
Definition: cs_cdo_local.h:56
Set of local quantities and connectivities related to a mesh cell.
Definition: cs_cdo_local.h:242
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:163
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 associated to a discrete Hodge operator *.
Definition: cs_hodge.h:179
Definition: cs_mesh.h:85