7.0
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-2021 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
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 /*----------------------------------------------------------------------------*/
203 /*----------------------------------------------------------------------------*/
204 
205 void
206 cs_cdo_advection_set_cip_coef(double new_value);
207 
208 /*----------------------------------------------------------------------------*/
214 /*----------------------------------------------------------------------------*/
215 
216 double
218 
219 /*----------------------------------------------------------------------------*/
232 /*----------------------------------------------------------------------------*/
233 
234 void
236  const cs_cell_mesh_t *cm,
237  const cs_cell_sys_t *csys,
238  void *input,
239  cs_cell_builder_t *cb);
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 /*----------------------------------------------------------------------------*/
320 /*----------------------------------------------------------------------------*/
321 
322 void
324  const cs_cell_mesh_t *cm,
325  cs_cell_sys_t *csys,
326  cs_cell_builder_t *cb,
327  cs_sdm_t *adv);
328 
329 /*----------------------------------------------------------------------------*/
345 /*----------------------------------------------------------------------------*/
346 
347 void
349  const cs_cell_mesh_t *cm,
350  const cs_cell_sys_t *csys,
351  cs_cdofb_adv_scheme_t *build_func,
352  cs_cell_builder_t *cb);
353 
354 /*----------------------------------------------------------------------------*/
368 /*----------------------------------------------------------------------------*/
369 
370 void
372  const cs_cell_mesh_t *cm,
373  const cs_cell_sys_t *csys,
374  cs_cdofb_adv_scheme_t *build_func,
375  cs_cell_builder_t *cb);
376 
377 /*----------------------------------------------------------------------------*/
396 /*----------------------------------------------------------------------------*/
397 
398 void
400  const cs_cell_mesh_t *cm,
401  const cs_cell_sys_t *csys,
402  cs_cell_builder_t *cb,
403  cs_sdm_t *adv);
404 
405 /*----------------------------------------------------------------------------*/
424 /*----------------------------------------------------------------------------*/
425 
426 void
428  const cs_cell_mesh_t *cm,
429  const cs_cell_sys_t *csys,
430  cs_cell_builder_t *cb,
431  cs_sdm_t *adv);
432 
433 /*----------------------------------------------------------------------------*/
452 /*----------------------------------------------------------------------------*/
453 
454 void
456  const cs_cell_mesh_t *cm,
457  const cs_cell_sys_t *csys,
458  cs_cell_builder_t *cb,
459  cs_sdm_t *adv);
460 
461 /*----------------------------------------------------------------------------*/
480 /*----------------------------------------------------------------------------*/
481 
482 void
484  const cs_cell_mesh_t *cm,
485  const cs_cell_sys_t *csys,
486  cs_cell_builder_t *cb,
487  cs_sdm_t *adv);
488 
489 /*----------------------------------------------------------------------------*/
505 /*----------------------------------------------------------------------------*/
506 
507 void
509  const cs_cell_mesh_t *cm,
510  const cs_property_data_t *diff_pty,
511  cs_face_mesh_t *fm,
512  cs_cell_builder_t *cb);
513 
514 /*----------------------------------------------------------------------------*/
529 /*----------------------------------------------------------------------------*/
530 
531 void
533  const cs_cell_mesh_t *cm,
534  const cs_property_data_t *diff_pty,
535  cs_face_mesh_t *fm,
536  cs_cell_builder_t *cb);
537 
538 /*----------------------------------------------------------------------------*/
553 /*----------------------------------------------------------------------------*/
554 
555 void
557  const cs_cell_mesh_t *cm,
558  const cs_property_data_t *diff_pty,
559  cs_face_mesh_t *fm,
560  cs_cell_builder_t *cb);
561 
562 /*----------------------------------------------------------------------------*/
577 /*----------------------------------------------------------------------------*/
578 
579 void
581  const cs_cell_mesh_t *cm,
582  const cs_property_data_t *diff_pty,
583  cs_face_mesh_t *fm,
584  cs_cell_builder_t *cb);
585 
586 /*----------------------------------------------------------------------------*/
602 /*----------------------------------------------------------------------------*/
603 
604 void
606  const cs_cell_mesh_t *cm,
607  const cs_property_data_t *diff_pty,
608  cs_face_mesh_t *fm,
609  cs_cell_builder_t *cb);
610 
611 /*----------------------------------------------------------------------------*/
626 /*----------------------------------------------------------------------------*/
627 
628 void
630  const cs_cell_mesh_t *cm,
631  const cs_property_data_t *diff_pty,
632  cs_face_mesh_t *fm,
633  cs_cell_builder_t *cb);
634 
635 /*----------------------------------------------------------------------------*/
650 /*----------------------------------------------------------------------------*/
651 
652 void
654  const cs_cell_mesh_t *cm,
655  const cs_property_data_t *diff_pty,
656  cs_face_mesh_t *fm,
657  cs_cell_builder_t *cb);
658 
659 /*----------------------------------------------------------------------------*/
671 /*----------------------------------------------------------------------------*/
672 
673 void
675  const cs_cell_mesh_t *cm,
676  const cs_property_data_t *diff_pty,
677  cs_face_mesh_t *fm,
678  cs_cell_builder_t *cb);
679 
680 /*----------------------------------------------------------------------------*/
691 /*----------------------------------------------------------------------------*/
692 
693 void
695  const cs_cell_mesh_t *cm,
696  const cs_property_data_t *diff_pty,
697  cs_face_mesh_t *fm,
698  cs_cell_builder_t *cb);
699 
700 /*----------------------------------------------------------------------------*/
711 /*----------------------------------------------------------------------------*/
712 
713 void
715  const cs_equation_param_t *eqp,
716  cs_real_t t_eval,
717  cs_face_mesh_t *fm,
718  cs_cell_builder_t *cb,
719  cs_cell_sys_t *csys);
720 
721 /*----------------------------------------------------------------------------*/
733 /*----------------------------------------------------------------------------*/
734 
735 void
737  const cs_equation_param_t *eqp,
738  cs_real_t t_eval,
739  cs_face_mesh_t *fm,
740  cs_cell_builder_t *cb,
741  cs_cell_sys_t *csys);
742 
743 /*----------------------------------------------------------------------------*/
754 /*----------------------------------------------------------------------------*/
755 
756 void
759  cs_real_t coefval[]);
760 
761 /*----------------------------------------------------------------------------*/
762 
764 
765 #endif /* __CS_CDO_ADVECTION_H__ */
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:2725
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_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_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. The local matrix related to this operator is stored in cb->loc.
Definition: cs_cdo_advection.h:161
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:2257
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources...
Definition: cs_equation_param.h:202
Structure storing the evaluation of a property and its related data.
Definition: cs_property.h:178
#define BEGIN_C_DECLS
Definition: cs_defs.h:495
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:1538
Set of local quantities and connectivities related to a mesh cell This is a key structure for all cel...
Definition: cs_cdo_local.h:159
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:1724
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:1947
double cs_cdo_advection_get_cip_coef(void)
Get the value of the stabilization coefficient used in CIP scheme.
Definition: cs_cdo_advection.c:1132
double cs_real_t
Floating-point value.
Definition: cs_defs.h:307
Definition: cs_cdo_quantities.h:124
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:107
Definition: cs_field_pointer.h:134
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:1860
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:1285
void cs_cdofb_advection_build_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 *build_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.c:1401
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:2110
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:1338
Set of local and temporary buffers useful for building the algebraic system with a cellwise process...
Definition: cs_cdo_local.h:69
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:2195
void cs_cdofb_advection_close_std_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:1185
void cs_cdofb_advection_close_std_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:1229
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:1631
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:2660
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
#define END_C_DECLS
Definition: cs_defs.h:496
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:1791
void cs_cdofb_advection_build(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_cell_sys_t *csys, cs_cdofb_adv_scheme_t *build_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.c:1478
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
cs_param_advection_scheme_t
Definition: cs_param_types.h:311
Set of local quantities and connectivities related to a mesh face Structure used to get a better memo...
Definition: cs_cdo_local.h:227
void cs_cdofb_advection_open_std(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:1153
Structure and routines handling the specific settings related to a cs_equation_t structure.
void cs_cdo_advection_set_cip_coef(double new_value)
Set the value of the stabilization coefficient used in CIP scheme.
Definition: cs_cdo_advection.c:1118
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:2434
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:2555
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:2304
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:2059
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:2009