8.3
general documentation
cs_cdo_diffusion.h
Go to the documentation of this file.
1#ifndef __CS_CDO_DIFFUSION_H__
2#define __CS_CDO_DIFFUSION_H__
3
4/*============================================================================
5 * Build discrete stiffness matrices and handled boundary conditions for the
6 * diffusion term in CDO vertex-based and vertex+cell schemes
7 *============================================================================*/
8
9/*
10 This file is part of code_saturne, a general-purpose CFD tool.
11
12 Copyright (C) 1998-2024 EDF S.A.
13
14 This program is free software; you can redistribute it and/or modify it under
15 the terms of the GNU General Public License as published by the Free Software
16 Foundation; either version 2 of the License, or (at your option) any later
17 version.
18
19 This program is distributed in the hope that it will be useful, but WITHOUT
20 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
21 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
22 details.
23
24 You should have received a copy of the GNU General Public License along with
25 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
26 Street, Fifth Floor, Boston, MA 02110-1301, USA.
27*/
28
29/*----------------------------------------------------------------------------
30 * Local headers
31 *----------------------------------------------------------------------------*/
32
33#include "cs_cdo_bc.h"
34#include "cs_cdo_connect.h"
35#include "cs_cdo_local.h"
36#include "cs_cdo_quantities.h"
37#include "cs_equation_param.h"
38#include "cs_hodge.h"
39#include "cs_macfb_builder.h"
40
41/*----------------------------------------------------------------------------*/
42
44
45/*============================================================================
46 * Macro definitions
47 *============================================================================*/
48
49/*============================================================================
50 * Type definitions
51 *============================================================================*/
52
53/*----------------------------------------------------------------------------*/
63/*----------------------------------------------------------------------------*/
64
65typedef void
67 const cs_real_t *pot,
68 const cs_hodge_t *hodge,
70 cs_real_t *flx);
71
72/*============================================================================
73 * Public function prototypes
74 *============================================================================*/
75
76/*----------------------------------------------------------------------------*/
89/*----------------------------------------------------------------------------*/
90
91void
93 const cs_cell_mesh_t *cm,
95 cs_hodge_t *hodge,
97 cs_cell_sys_t *csys);
98
99/*----------------------------------------------------------------------------*/
114/*----------------------------------------------------------------------------*/
115
116void
118 const cs_cell_mesh_t *cm,
120 cs_hodge_t *hodge,
122 cs_cell_sys_t *csys);
123
124/*----------------------------------------------------------------------------*/
147/*----------------------------------------------------------------------------*/
148
149void
151 const cs_cell_mesh_t *cm,
153 cs_hodge_t *hodge,
155 cs_cell_sys_t *csys);
156
157/*----------------------------------------------------------------------------*/
184/*----------------------------------------------------------------------------*/
185
186void
188 const cs_cell_mesh_t *cm,
190 cs_hodge_t *hodge,
192 cs_cell_sys_t *csys);
193
194/*----------------------------------------------------------------------------*/
218/*----------------------------------------------------------------------------*/
219
220void
222 const cs_cell_mesh_t *cm,
224 cs_hodge_t *hodge,
226 cs_cell_sys_t *csys);
227
228/*----------------------------------------------------------------------------*/
243/*----------------------------------------------------------------------------*/
244
245void
247 const cs_cell_mesh_t *cm,
249 cs_hodge_t *hodge,
251 cs_cell_sys_t *csys);
252
253/*----------------------------------------------------------------------------*/
270/*----------------------------------------------------------------------------*/
271
272void
274 const cs_cell_mesh_t *cm,
276 cs_hodge_t *hodge,
278 cs_cell_sys_t *csys);
279
280/*----------------------------------------------------------------------------*/
295/*----------------------------------------------------------------------------*/
296
297void
299 const cs_cell_mesh_t *cm,
301 cs_hodge_t *hodge,
303 cs_cell_sys_t *csys);
304
305/*----------------------------------------------------------------------------*/
322/*----------------------------------------------------------------------------*/
323
324void
326 const cs_cell_mesh_t *cm,
328 cs_hodge_t *hodge,
330 cs_cell_sys_t *csys);
331
332/*----------------------------------------------------------------------------*/
347/*----------------------------------------------------------------------------*/
348
349void
351 const cs_cell_mesh_t *cm,
353 cs_hodge_t *hodge,
355 cs_cell_sys_t *csys);
356
357/*----------------------------------------------------------------------------*/
371/*----------------------------------------------------------------------------*/
372
373void
375 const cs_cell_mesh_t *cm,
377 cs_hodge_t *hodge,
379 cs_cell_sys_t *csys);
380
381/*----------------------------------------------------------------------------*/
395/*----------------------------------------------------------------------------*/
396
397void
399 const cs_cell_mesh_t *cm,
401 cs_hodge_t *hodge,
403 cs_cell_sys_t *csys);
404
405/*----------------------------------------------------------------------------*/
420/*----------------------------------------------------------------------------*/
421
422void
424 const cs_cell_mesh_t *cm,
426 cs_hodge_t *hodge,
428 cs_cell_sys_t *csys);
429
430/*----------------------------------------------------------------------------*/
446/*----------------------------------------------------------------------------*/
447
448void
450 const cs_cell_mesh_t *cm,
452 cs_hodge_t *hodge,
454 cs_cell_sys_t *csys);
455
456/*----------------------------------------------------------------------------*/
471/*----------------------------------------------------------------------------*/
472
473void
475 const cs_cell_mesh_t *cm,
477 cs_hodge_t *hodge,
479 cs_cell_sys_t *csys);
480
481/*----------------------------------------------------------------------------*/
497/*----------------------------------------------------------------------------*/
498
499void
501 const cs_cell_mesh_t *cm,
503 cs_hodge_t *hodge,
505 cs_cell_sys_t *csys);
506
507/*----------------------------------------------------------------------------*/
521/*----------------------------------------------------------------------------*/
522
523void
525 const cs_cell_mesh_t *cm,
527 cs_hodge_t *hodge,
529 cs_cell_sys_t *csys);
530
531/*----------------------------------------------------------------------------*/
545/*----------------------------------------------------------------------------*/
546
547void
549 const cs_cell_mesh_t *cm,
551 cs_hodge_t *hodge,
553 cs_cell_sys_t *csys);
554
555/*----------------------------------------------------------------------------*/
570/*----------------------------------------------------------------------------*/
571
572void
574 const cs_cell_mesh_t *cm,
576 cs_hodge_t *hodge,
578 cs_cell_sys_t *csys);
579
580/*----------------------------------------------------------------------------*/
594/*----------------------------------------------------------------------------*/
595
596void
598 const cs_cell_mesh_t *cm,
600 cs_hodge_t *hodge,
602 cs_cell_sys_t *csys);
603
604/*----------------------------------------------------------------------------*/
619/*----------------------------------------------------------------------------*/
620
621void
623 const cs_cell_mesh_t *cm,
625 cs_hodge_t *hodge,
627 cs_cell_sys_t *csys);
628
629/*----------------------------------------------------------------------------*/
645/*----------------------------------------------------------------------------*/
646
647void
649 const double *pot,
650 const cs_hodge_t *hodge,
652 double *flx);
653
654/*----------------------------------------------------------------------------*/
670/*----------------------------------------------------------------------------*/
671
672void
674 const double *pot,
675 const cs_hodge_t *hodge,
677 double *flx);
678
679/*----------------------------------------------------------------------------*/
695/*----------------------------------------------------------------------------*/
696
697void
699 const double *pot,
700 const cs_hodge_t *hodge,
702 double *flx);
703
704/*----------------------------------------------------------------------------*/
720/*----------------------------------------------------------------------------*/
721
722void
724 const cs_cell_mesh_t *cm,
725 const cs_real_t *pot,
726 const cs_hodge_t *hodge,
728 cs_real_t *flux);
729
730/*----------------------------------------------------------------------------*/
745/*----------------------------------------------------------------------------*/
746
747void
749 const cs_real_t *pot,
750 const cs_hodge_t *hodge,
752 cs_real_t *flx);
753
754/*----------------------------------------------------------------------------*/
769/*----------------------------------------------------------------------------*/
770
771void
773 const cs_real_t *pot,
774 const cs_hodge_t *hodge,
776 cs_real_t *flx);
777
778/*----------------------------------------------------------------------------*/
791/*----------------------------------------------------------------------------*/
792
793void
795 const cs_cell_mesh_t *cm,
796 const cs_real_t *pot,
797 const cs_hodge_t *hodge,
799 cs_real_t *flux);
800
801/*----------------------------------------------------------------------------*/
815/*----------------------------------------------------------------------------*/
816
817double
819 const cs_real_t pty_tens[3][3],
820 const double *p_v,
821 const double p_f,
822 const double p_c,
824
825/*----------------------------------------------------------------------------*/
839/*----------------------------------------------------------------------------*/
840
841void
843 const cs_cell_mesh_t *cm,
844 const cs_real_t *pot,
845 const cs_hodge_t *hodge,
847 cs_real_t *flux);
848
849/*----------------------------------------------------------------------------*/
863/*----------------------------------------------------------------------------*/
864
865void
866cs_cdovb_diffusion_p0_face_flux(const short int f,
867 const cs_cell_mesh_t *cm,
868 const cs_real_t diff_tensor[3][3],
869 const cs_real_t *pot_values,
870 cs_real_t *fluxes);
871
872/*----------------------------------------------------------------------------*/
884/*----------------------------------------------------------------------------*/
885
887 const cs_macfb_builder_t *macb,
888 const cs_property_t *diff_pty,
889 cs_sdm_t *mat,
890 cs_real_t *rhs);
891
892/*----------------------------------------------------------------------------*/
893
895
896#endif /* __CS_CDO_DIFFUSION_H__ */
void cs_cdo_diffusion_svb_wbs_wsym_dirichlet(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)
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique plus a symmetric treatm...
Definition: cs_cdo_diffusion.cpp:2593
void cs_cdo_diffusion_wbs_get_dfbyc_flux(const cs_cell_mesh_t *cm, const cs_real_t *pot, const cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_real_t *flx)
Compute the diffusive flux across dual faces for a given cell Use the WBS algo. for approximating the...
Definition: cs_cdo_diffusion.cpp:3132
void cs_cdo_diffusion_vvb_ocs_weak_dirichlet(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)
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. A Dirichlet is set for...
Definition: cs_cdo_diffusion.cpp:2045
void() cs_cdo_diffusion_cw_flux_t(const cs_cell_mesh_t *cm, const cs_real_t *pot, const cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_real_t *flx)
Cellwise computation of the diffusive flux.
Definition: cs_cdo_diffusion.h:66
void cs_cdo_diffusion_vcb_weak_dirichlet(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)
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. Case of CDO-VCb scheme...
Definition: cs_cdo_diffusion.cpp:2695
void cs_cdo_diffusion_sfb_cost_flux(short int f, const cs_cell_mesh_t *cm, const cs_real_t *pot, const cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_real_t *flux)
Compute the normal diffusive flux for a face assuming only the knowledge of the potential at faces an...
Definition: cs_cdo_diffusion.cpp:3456
void cs_cdo_diffusion_sfb_cost_robin(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)
Take into account Robin BCs. Case of scalar-valued CDO-Fb schemes with a CO+ST algorithm....
Definition: cs_cdo_diffusion.cpp:1796
void cs_cdo_diffusion_alge_dirichlet_extra_block(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)
Function close to cs_cdo_diffusion_alge_dirichlet but dedicated to systems by blocks and especially f...
Definition: cs_cdo_diffusion.cpp:950
void cs_macfb_diffusion(const cs_cell_mesh_t *cm, const cs_macfb_builder_t *macb, const cs_property_t *diff_pty, cs_sdm_t *mat, cs_real_t *rhs)
Compute the diffusion operator for the MAC face-based scheme.
Definition: cs_cdo_diffusion.cpp:3577
void cs_cdo_diffusion_vfb_wsym_sliding(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)
Take into account sliding BCs by a weak enforcement using Nitsche technique plus a symmetric treatmen...
Definition: cs_cdo_diffusion.cpp:1659
void cs_cdo_diffusion_sfb_get_face_flux(const cs_cell_mesh_t *cm, const double *pot, const cs_hodge_t *hodge, cs_cell_builder_t *cb, double *flx)
Compute the diffusive flux across primal faces for a given cell. Use the same consistent approximatio...
Definition: cs_cdo_diffusion.cpp:2882
void cs_cdo_diffusion_vfb_weak_dirichlet(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)
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. Case of vector-valued ...
Definition: cs_cdo_diffusion.cpp:1259
void cs_cdo_diffusion_svb_ocs_weak_dirichlet(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)
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. Case of scalar-valued ...
Definition: cs_cdo_diffusion.cpp:1954
void cs_cdo_diffusion_svb_get_dfbyc_flux(const cs_cell_mesh_t *cm, const double *pot, const cs_hodge_t *hodge, cs_cell_builder_t *cb, double *flx)
Compute the diffusive flux across dual faces for a given cell. Use the same consistent approximation ...
Definition: cs_cdo_diffusion.cpp:2923
void cs_cdo_diffusion_svb_get_cell_flux(const cs_cell_mesh_t *cm, const double *pot, const cs_hodge_t *hodge, cs_cell_builder_t *cb, double *flx)
Compute the constant approximation of the diffusive flux inside a (primal) cell. Use the same consist...
Definition: cs_cdo_diffusion.cpp:2972
double cs_cdo_diffusion_wbs_face_flux(const cs_face_mesh_t *fm, const cs_real_t pty_tens[3][3], const double *p_v, const double p_f, const double p_c, cs_cell_builder_t *cb)
Compute the diffusive flux across a face (based on a subdivision into tetrahedra of the volume p_{f,...
Definition: cs_cdo_diffusion.cpp:3375
void cs_cdo_diffusion_svb_cost_robin(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)
Take into account Robin BCs. Case of scalar-valued CDO-Vb schemes with a CO+ST algorithm....
Definition: cs_cdo_diffusion.cpp:1865
void cs_cdo_diffusion_alge_block_dirichlet(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)
Take into account Dirichlet BCs by keeping the DoFs related to Dirichlet BCs in the algebraic system ...
Definition: cs_cdo_diffusion.cpp:1036
void cs_cdo_diffusion_svb_wbs_weak_dirichlet(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)
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. Case of CDO-Vb schemes...
Definition: cs_cdo_diffusion.cpp:2506
void cs_cdo_diffusion_vfb_wsym_dirichlet(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)
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique plus a symmetric treatm...
Definition: cs_cdo_diffusion.cpp:1506
void cs_cdo_diffusion_wbs_vbyf_flux(short int f, const cs_cell_mesh_t *cm, const cs_real_t *pot, const cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_real_t *flux)
Compute the normal flux for a face assuming only the knowledge of the potential at cell vertices (and...
Definition: cs_cdo_diffusion.cpp:3275
void cs_cdo_diffusion_svb_ocs_wsym_dirichlet(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)
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique plus a symmetric treatm...
Definition: cs_cdo_diffusion.cpp:2303
void cs_cdo_diffusion_sfb_wsym_dirichlet(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)
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique plus a symmetric treatm...
Definition: cs_cdo_diffusion.cpp:1384
void cs_cdovb_diffusion_p0_face_flux(const short int f, const cs_cell_mesh_t *cm, const cs_real_t diff_tensor[3][3], const cs_real_t *pot_values, cs_real_t *fluxes)
Compute the normal flux for a face assuming only the knowledge of the potential at cell vertices....
Definition: cs_cdo_diffusion.cpp:3534
void cs_cdo_diffusion_alge_dirichlet(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)
Take into account Dirichlet BCs by keeping the DoFs related to Dirichlet BCs in the algebraic system ...
Definition: cs_cdo_diffusion.cpp:860
void cs_cdo_diffusion_vcb_wsym_dirichlet(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)
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique plus a symmetric treatm...
Definition: cs_cdo_diffusion.cpp:2782
void cs_cdo_diffusion_vvb_ocs_sliding(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)
Take into account a sliding BCs. Case of vector-valued CDO-Vb schemes with a OCS algorithm....
Definition: cs_cdo_diffusion.cpp:2169
void cs_cdo_diffusion_svb_vbyf_flux(short int f, const cs_cell_mesh_t *cm, const cs_real_t *pot, const cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_real_t *flux)
Compute the normal flux for a face assuming only the knowledge of the potential at cell vertices....
Definition: cs_cdo_diffusion.cpp:3030
void cs_cdo_diffusion_pena_block_dirichlet(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)
Take into account Dirichlet BCs by a weak enforcement by a penalization technique with a huge value....
Definition: cs_cdo_diffusion.cpp:784
void cs_cdo_diffusion_wbs_get_cell_flux(const cs_cell_mesh_t *cm, const cs_real_t *pot, const cs_hodge_t *hodge, cs_cell_builder_t *cb, cs_real_t *flx)
Compute the diffusive flux inside a given primal cell Use the WBS algo. for approximating the gradien...
Definition: cs_cdo_diffusion.cpp:3236
void cs_cdo_diffusion_sfb_weak_dirichlet(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)
Take into account Dirichlet BCs by a weak enforcement using Nitsche technique. Case of scalar-valued ...
Definition: cs_cdo_diffusion.cpp:1153
void cs_cdo_diffusion_pena_dirichlet(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)
Take into account Dirichlet BCs by a weak enforcement by a penalization technique with a huge value....
Definition: cs_cdo_diffusion.cpp:734
void cs_cdo_diffusion_svb_wbs_robin(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)
Take into account Robin BCs. Case of scalar-valued CDO-Vb schemes with a WBS algorithm....
Definition: cs_cdo_diffusion.cpp:2401
#define BEGIN_C_DECLS
Definition: cs_defs.h:542
double cs_real_t
Floating-point value.
Definition: cs_defs.h:342
#define END_C_DECLS
Definition: cs_defs.h:543
@ fm
Definition: cs_field_pointer.h:129
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:192
Set of local quantities and connectivities related to a mesh face Structure used to get a better memo...
Definition: cs_cdo_local.h:280
Structure associated to a discrete Hodge operator *.
Definition: cs_hodge.h:183
Definition: cs_macfb_builder.h:54
Structure associated to the definition of a property relying on the cs_xdef_t structure.