8.2
general documentation
cs_cdo_advection.h
Go to the documentation of this file.
1 #ifndef __CS_CDO_ADVECTION_H__
2 #define __CS_CDO_ADVECTION_H__
3 
4 /*============================================================================
5  * Build discrete convection operators for CDO schemes
6  *============================================================================*/
7 
8 /*
9  This file is part of code_saturne, a general-purpose CFD tool.
10 
11  Copyright (C) 1998-2024 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 
30 /*----------------------------------------------------------------------------
31  * Local headers
32  *----------------------------------------------------------------------------*/
33 
34 #include "cs_advection_field.h"
35 #include "cs_cdo_connect.h"
36 #include "cs_cdo_local.h"
37 #include "cs_cdo_quantities.h"
38 #include "cs_equation_param.h"
39 #include "cs_property.h"
40 
41 /*----------------------------------------------------------------------------*/
42 
44 
45 /*============================================================================
46  * Macro definitions
47  *============================================================================*/
48 
49 /*============================================================================
50  * Type definitions
51  *============================================================================*/
52 
53 /* ---------------------------------------------------------------------------
54  * Function pointers for CDO face-based schemes
55  * -------------------------------------------------------------------------- */
56 
57 /*----------------------------------------------------------------------------*/
68 /*----------------------------------------------------------------------------*/
69 
70 typedef void
72  const cs_cell_mesh_t *cm,
73  const cs_cell_sys_t *csys,
74  void *input,
75  cs_cell_builder_t *cb);
76 
77 /*----------------------------------------------------------------------------*/
89 /*----------------------------------------------------------------------------*/
90 
91 typedef void
92 (cs_cdofb_adv_scheme_t)(int dim,
93  const cs_cell_mesh_t *cm,
94  const cs_cell_sys_t *csys,
96  cs_sdm_t *adv);
97 
98 /*----------------------------------------------------------------------------*/
113 /*----------------------------------------------------------------------------*/
114 
115 typedef void
117  const cs_cell_mesh_t *cm,
118  const cs_cell_sys_t *csys,
119  cs_cdofb_adv_scheme_t *scheme_func,
120  cs_cell_builder_t *cb);
121 
122 /*----------------------------------------------------------------------------*/
133 /*----------------------------------------------------------------------------*/
134 
135 typedef void
137  const cs_cell_mesh_t *cm,
138  cs_cell_sys_t *csys,
139  cs_cell_builder_t *cb,
140  cs_sdm_t *adv);
141 
142 /* ---------------------------------------------------------------------------
143  * Function pointers for CDO vertex-based schemes
144  * -------------------------------------------------------------------------- */
145 
146 /*----------------------------------------------------------------------------*/
158 /*----------------------------------------------------------------------------*/
159 
160 typedef void
162  const cs_cell_mesh_t *cm,
163  const cs_property_data_t *diff_pty,
165  cs_cell_builder_t *cb);
166 
167 /*----------------------------------------------------------------------------*/
179 /*----------------------------------------------------------------------------*/
180 
181 typedef void
183  const cs_equation_param_t *eqp,
184  cs_real_t t_eval,
186  cs_cell_builder_t *cb,
187  cs_cell_sys_t *csys);
188 
189 /*============================================================================
190  * Global variables
191  *============================================================================*/
192 
193 /*============================================================================
194  * Public function prototypes
195  *============================================================================*/
196 
197 /*----------------------------------------------------------------------------*/
210 /*----------------------------------------------------------------------------*/
211 
212 void
214  const cs_cell_mesh_t *cm,
215  const cs_cell_sys_t *csys,
216  void *input,
217  cs_cell_builder_t *cb);
218 
219 /*----------------------------------------------------------------------------*/
232 /*----------------------------------------------------------------------------*/
233 
234 void
236  const cs_cell_mesh_t *cm,
237  cs_cell_sys_t *csys,
238  cs_cell_builder_t *cb,
239  cs_sdm_t *adv);
240 
241 /*----------------------------------------------------------------------------*/
254 /*----------------------------------------------------------------------------*/
255 
256 void
258  const cs_cell_mesh_t *cm,
259  cs_cell_sys_t *csys,
260  cs_cell_builder_t *cb,
261  cs_sdm_t *adv);
262 
263 /*----------------------------------------------------------------------------*/
276 /*----------------------------------------------------------------------------*/
277 
278 void
280  const cs_cell_mesh_t *cm,
281  cs_cell_sys_t *csys,
282  cs_cell_builder_t *cb,
283  cs_sdm_t *adv);
284 
285 /*----------------------------------------------------------------------------*/
298 /*----------------------------------------------------------------------------*/
299 
300 void
302  const cs_cell_mesh_t *cm,
303  cs_cell_sys_t *csys,
304  cs_cell_builder_t *cb,
305  cs_sdm_t *adv);
306 
307 /*----------------------------------------------------------------------------*/
324 /*----------------------------------------------------------------------------*/
325 
326 void
328  const cs_cell_mesh_t *cm,
329  const cs_cell_sys_t *csys,
330  cs_cdofb_adv_scheme_t *scheme_func,
331  cs_cell_builder_t *cb);
332 
333 /*----------------------------------------------------------------------------*/
349 /*----------------------------------------------------------------------------*/
350 
351 void
353  const cs_cell_mesh_t *cm,
354  const cs_cell_sys_t *csys,
355  cs_cdofb_adv_scheme_t *scheme_func,
356  cs_cell_builder_t *cb);
357 
358 /*----------------------------------------------------------------------------*/
377 /*----------------------------------------------------------------------------*/
378 
379 void
381  const cs_cell_mesh_t *cm,
382  const cs_cell_sys_t *csys,
383  cs_cell_builder_t *cb,
384  cs_sdm_t *adv);
385 
386 /*----------------------------------------------------------------------------*/
405 /*----------------------------------------------------------------------------*/
406 
407 void
409  const cs_cell_mesh_t *cm,
410  const cs_cell_sys_t *csys,
411  cs_cell_builder_t *cb,
412  cs_sdm_t *adv);
413 
414 /*----------------------------------------------------------------------------*/
433 /*----------------------------------------------------------------------------*/
434 
435 void
437  const cs_cell_mesh_t *cm,
438  const cs_cell_sys_t *csys,
439  cs_cell_builder_t *cb,
440  cs_sdm_t *adv);
441 
442 /*----------------------------------------------------------------------------*/
461 /*----------------------------------------------------------------------------*/
462 
463 void
465  const cs_cell_mesh_t *cm,
466  const cs_cell_sys_t *csys,
467  cs_cell_builder_t *cb,
468  cs_sdm_t *adv);
469 
470 /*----------------------------------------------------------------------------*/
486 /*----------------------------------------------------------------------------*/
487 
488 void
490  const cs_cell_mesh_t *cm,
491  const cs_property_data_t *diff_pty,
493  cs_cell_builder_t *cb);
494 
495 /*----------------------------------------------------------------------------*/
510 /*----------------------------------------------------------------------------*/
511 
512 void
514  const cs_cell_mesh_t *cm,
515  const cs_property_data_t *diff_pty,
517  cs_cell_builder_t *cb);
518 
519 /*----------------------------------------------------------------------------*/
534 /*----------------------------------------------------------------------------*/
535 
536 void
538  const cs_cell_mesh_t *cm,
539  const cs_property_data_t *diff_pty,
541  cs_cell_builder_t *cb);
542 
543 /*----------------------------------------------------------------------------*/
558 /*----------------------------------------------------------------------------*/
559 
560 void
562  const cs_cell_mesh_t *cm,
563  const cs_property_data_t *diff_pty,
565  cs_cell_builder_t *cb);
566 
567 /*----------------------------------------------------------------------------*/
582 /*----------------------------------------------------------------------------*/
583 
584 void
586  const cs_cell_mesh_t *cm,
587  const cs_property_data_t *diff_pty,
589  cs_cell_builder_t *cb);
590 
591 /*----------------------------------------------------------------------------*/
607 /*----------------------------------------------------------------------------*/
608 
609 void
611  const cs_cell_mesh_t *cm,
612  const cs_property_data_t *diff_pty,
614  cs_cell_builder_t *cb);
615 
616 /*----------------------------------------------------------------------------*/
631 /*----------------------------------------------------------------------------*/
632 
633 void
635  const cs_cell_mesh_t *cm,
636  const cs_property_data_t *diff_pty,
638  cs_cell_builder_t *cb);
639 
640 /*----------------------------------------------------------------------------*/
655 /*----------------------------------------------------------------------------*/
656 
657 void
659  const cs_cell_mesh_t *cm,
660  const cs_property_data_t *diff_pty,
662  cs_cell_builder_t *cb);
663 
664 /*----------------------------------------------------------------------------*/
676 /*----------------------------------------------------------------------------*/
677 
678 void
680  const cs_cell_mesh_t *cm,
681  const cs_property_data_t *diff_pty,
683  cs_cell_builder_t *cb);
684 
685 /*----------------------------------------------------------------------------*/
696 /*----------------------------------------------------------------------------*/
697 
698 void
700  const cs_cell_mesh_t *cm,
701  const cs_property_data_t *diff_pty,
703  cs_cell_builder_t *cb);
704 
705 /*----------------------------------------------------------------------------*/
716 /*----------------------------------------------------------------------------*/
717 
718 void
720  const cs_equation_param_t *eqp,
721  cs_real_t t_eval,
723  cs_cell_builder_t *cb,
724  cs_cell_sys_t *csys);
725 
726 /*----------------------------------------------------------------------------*/
738 /*----------------------------------------------------------------------------*/
739 
740 void
742  const cs_equation_param_t *eqp,
743  cs_real_t t_eval,
745  cs_cell_builder_t *cb,
746  cs_cell_sys_t *csys);
747 
748 /*----------------------------------------------------------------------------*/
759 /*----------------------------------------------------------------------------*/
760 
761 void
764  cs_real_t coefval[]);
765 
766 /*----------------------------------------------------------------------------*/
767 
769 
770 #endif /* __CS_CDO_ADVECTION_H__ */
void cs_cdo_advection_vb_upwcsv_wpty(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
Compute the convection operator attached to a cell with a CDO vertex-based scheme with an upwind sche...
Definition: cs_cdo_advection.c:1915
void cs_cdo_advection_vcb_bc(const cs_cell_mesh_t *cm, const cs_equation_param_t *eqp, cs_real_t t_eval, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Compute the BC contribution for the convection operator with CDO V+C schemes.
Definition: cs_cdo_advection.c:2821
void cs_cdofb_advection_upwnoc(int dim, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
Compute the convection operator attached to a cell with a CDO face-based scheme.
Definition: cs_cdo_advection.c:1574
void cs_cdo_advection_vb_upwcsv(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
Compute the convection operator attached to a cell with a CDO vertex-based scheme without diffusion a...
Definition: cs_cdo_advection.c:2006
void cs_cdo_advection_vb_upwnoc(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
Compute the convection operator attached to a cell with a CDO vertex-based scheme without diffusion w...
Definition: cs_cdo_advection.c:2314
void cs_cdofb_advection_close_default_vect(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
Operation done after the matrix related to the advection term has been defined. Follow the prototype ...
Definition: cs_cdo_advection.c:1296
void cs_cdofb_advection_no_diffusion(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, cs_cdofb_adv_scheme_t *scheme_func, cs_cell_builder_t *cb)
Main function to build the cellwise advection operator for CDO-Fb schemes The local matrix related to...
Definition: cs_cdo_advection.c:1432
void cs_cdofb_advection_close_default_scal(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
Operation done after the matrix related to the advection term has been defined. Follow the prototype ...
Definition: cs_cdo_advection.c:1267
void cs_cdo_advection_vcb_cw_cst(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
Compute the convection operator attached to a cell with a CDO vertex+cell-based scheme when the advec...
Definition: cs_cdo_advection.c:2426
void cs_cdofb_advection_cennoc(int dim, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
Compute the convection operator attached to a cell with a CDO face-based scheme.
Definition: cs_cdo_advection.c:1768
void cs_cdofb_advection_cencsv(int dim, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
Compute the convection operator attached to a cell with a CDO face-based scheme.
Definition: cs_cdo_advection.c:1840
void cs_cdo_advection_vb_bc(const cs_cell_mesh_t *cm, const cs_equation_param_t *eqp, cs_real_t t_eval, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Compute the BC contribution for the convection operator.
Definition: cs_cdo_advection.c:2699
void cs_cdofb_advection(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, cs_cdofb_adv_scheme_t *scheme_func, cs_cell_builder_t *cb)
Main function to build the cellwise advection operator for CDO face-based schemes....
Definition: cs_cdo_advection.c:1513
void cs_cdofb_advection_close_exp_none_scal(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
Operation done after the matrix related to the advection term has been defined. Follow the prototype ...
Definition: cs_cdo_advection.c:1341
void() cs_cdofb_adv_build_t(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, cs_cdofb_adv_scheme_t *scheme_func, cs_cell_builder_t *cb)
Build the cellwise advection operator for CDO-Fb schemes The local matrix related to this operator is...
Definition: cs_cdo_advection.h:116
void cs_cdo_advection_vcb(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
Compute the convection operator attached to a cell with a CDO vertex+cell-based scheme.
Definition: cs_cdo_advection.c:2568
void() cs_cdofb_adv_scheme_t(int dim, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
Define the local convection operator in CDO-Fb schemes. Case of an operator that should be assemble i...
Definition: cs_cdo_advection.h:92
void cs_cdo_advection_vb_upwnoc_wpty(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
Compute the convection operator attached to a cell with a CDO vertex-based scheme with an upwind sche...
Definition: cs_cdo_advection.c:2225
void() cs_cdovb_advection_bc_t(const cs_cell_mesh_t *cm, const cs_equation_param_t *eqp, cs_real_t t_eval, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Compute the BC contribution for the advection operator in CDO vertex-based (or vertex+cell-based) sch...
Definition: cs_cdo_advection.h:182
void() cs_cdofb_adv_close_hook_t(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
Operation done after the matrix related to the advection term has been defined.
Definition: cs_cdo_advection.h:136
void cs_cdo_advection_vb_mcucsv(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
Compute the convection operator attached to a cell with a CDO vertex-based scheme when a mixed center...
Definition: cs_cdo_advection.c:2122
void cs_cdo_advection_vb_mcunoc(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
Compute the convection operator attached to a cell with a CDO vertex-based scheme when a mixed center...
Definition: cs_cdo_advection.c:2173
void cs_cdo_advection_vb_cennoc(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
Compute the convection operator attached to a cell with a CDO vertex-based scheme when a centered sch...
Definition: cs_cdo_advection.c:2378
void cs_cdo_advection_cell_upwind_coef(const cs_cdo_quantities_t *cdoq, cs_param_advection_scheme_t scheme, cs_real_t coefval[])
Compute the value of the upwinding coefficient in each cell knowing the related Peclet number.
Definition: cs_cdo_advection.c:2886
void cs_cdofb_advection_upwcsv(int dim, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
Compute the convection operator attached to a cell with a CDO face-based scheme.
Definition: cs_cdo_advection.c:1671
void() cs_cdofb_adv_open_hook_t(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, 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_cdo_advection.h:71
void cs_cdofb_advection_close_exp_none_vect(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_cell_sys_t *csys, cs_cell_builder_t *cb, cs_sdm_t *adv)
Operation done after the matrix related to the advection term has been defined. Follow the prototype ...
Definition: cs_cdo_advection.c:1379
void() cs_cdovb_advection_t(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
Compute the convection operator attached to a cell with a CDO vertex-based scheme....
Definition: cs_cdo_advection.h:161
void cs_cdo_advection_vb_cencsv(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_property_data_t *diff_pty, cs_face_mesh_t *fm, cs_cell_builder_t *cb)
Compute the convection operator attached to a cell with a CDO vertex-based scheme when a centered sch...
Definition: cs_cdo_advection.c:2071
void cs_cdofb_advection_open_default(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, 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_cdo_advection.c:1221
#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
@ fm
Definition: cs_field_pointer.h:127
cs_param_advection_scheme_t
Definition: cs_param_types.h:351
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
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition: cs_equation_param.h:193
Set of local quantities and connectivities related to a mesh face Structure used to get a better memo...
Definition: cs_cdo_local.h:279
Structure storing the evaluation of a property and its related data.
Definition: cs_property.h:223