8.2
general documentation
Loading...
Searching...
No Matches
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
40/*----------------------------------------------------------------------------*/
41
43
44/*============================================================================
45 * Macro definitions
46 *============================================================================*/
47
48/*============================================================================
49 * Type definitions
50 *============================================================================*/
51
52/*----------------------------------------------------------------------------*/
62/*----------------------------------------------------------------------------*/
63
64typedef void
66 const cs_real_t *pot,
67 const cs_hodge_t *hodge,
69 cs_real_t *flx);
70
71/*============================================================================
72 * Public function prototypes
73 *============================================================================*/
74
75/*----------------------------------------------------------------------------*/
88/*----------------------------------------------------------------------------*/
89
90void
92 const cs_cell_mesh_t *cm,
94 cs_hodge_t *hodge,
96 cs_cell_sys_t *csys);
97
98/*----------------------------------------------------------------------------*/
113/*----------------------------------------------------------------------------*/
114
115void
117 const cs_cell_mesh_t *cm,
119 cs_hodge_t *hodge,
121 cs_cell_sys_t *csys);
122
123/*----------------------------------------------------------------------------*/
146/*----------------------------------------------------------------------------*/
147
148void
150 const cs_cell_mesh_t *cm,
152 cs_hodge_t *hodge,
154 cs_cell_sys_t *csys);
155
156/*----------------------------------------------------------------------------*/
183/*----------------------------------------------------------------------------*/
184
185void
187 const cs_cell_mesh_t *cm,
189 cs_hodge_t *hodge,
191 cs_cell_sys_t *csys);
192
193/*----------------------------------------------------------------------------*/
217/*----------------------------------------------------------------------------*/
218
219void
221 const cs_cell_mesh_t *cm,
223 cs_hodge_t *hodge,
225 cs_cell_sys_t *csys);
226
227/*----------------------------------------------------------------------------*/
242/*----------------------------------------------------------------------------*/
243
244void
246 const cs_cell_mesh_t *cm,
248 cs_hodge_t *hodge,
250 cs_cell_sys_t *csys);
251
252/*----------------------------------------------------------------------------*/
269/*----------------------------------------------------------------------------*/
270
271void
273 const cs_cell_mesh_t *cm,
275 cs_hodge_t *hodge,
277 cs_cell_sys_t *csys);
278
279/*----------------------------------------------------------------------------*/
294/*----------------------------------------------------------------------------*/
295
296void
298 const cs_cell_mesh_t *cm,
300 cs_hodge_t *hodge,
302 cs_cell_sys_t *csys);
303
304/*----------------------------------------------------------------------------*/
321/*----------------------------------------------------------------------------*/
322
323void
325 const cs_cell_mesh_t *cm,
327 cs_hodge_t *hodge,
329 cs_cell_sys_t *csys);
330
331/*----------------------------------------------------------------------------*/
346/*----------------------------------------------------------------------------*/
347
348void
350 const cs_cell_mesh_t *cm,
352 cs_hodge_t *hodge,
354 cs_cell_sys_t *csys);
355
356/*----------------------------------------------------------------------------*/
370/*----------------------------------------------------------------------------*/
371
372void
374 const cs_cell_mesh_t *cm,
376 cs_hodge_t *hodge,
378 cs_cell_sys_t *csys);
379
380/*----------------------------------------------------------------------------*/
394/*----------------------------------------------------------------------------*/
395
396void
398 const cs_cell_mesh_t *cm,
400 cs_hodge_t *hodge,
402 cs_cell_sys_t *csys);
403
404/*----------------------------------------------------------------------------*/
419/*----------------------------------------------------------------------------*/
420
421void
423 const cs_cell_mesh_t *cm,
425 cs_hodge_t *hodge,
427 cs_cell_sys_t *csys);
428
429/*----------------------------------------------------------------------------*/
445/*----------------------------------------------------------------------------*/
446
447void
449 const cs_cell_mesh_t *cm,
451 cs_hodge_t *hodge,
453 cs_cell_sys_t *csys);
454
455/*----------------------------------------------------------------------------*/
470/*----------------------------------------------------------------------------*/
471
472void
474 const cs_cell_mesh_t *cm,
476 cs_hodge_t *hodge,
478 cs_cell_sys_t *csys);
479
480/*----------------------------------------------------------------------------*/
496/*----------------------------------------------------------------------------*/
497
498void
500 const cs_cell_mesh_t *cm,
502 cs_hodge_t *hodge,
504 cs_cell_sys_t *csys);
505
506/*----------------------------------------------------------------------------*/
520/*----------------------------------------------------------------------------*/
521
522void
524 const cs_cell_mesh_t *cm,
526 cs_hodge_t *hodge,
528 cs_cell_sys_t *csys);
529
530/*----------------------------------------------------------------------------*/
544/*----------------------------------------------------------------------------*/
545
546void
548 const cs_cell_mesh_t *cm,
550 cs_hodge_t *hodge,
552 cs_cell_sys_t *csys);
553
554/*----------------------------------------------------------------------------*/
569/*----------------------------------------------------------------------------*/
570
571void
573 const cs_cell_mesh_t *cm,
575 cs_hodge_t *hodge,
577 cs_cell_sys_t *csys);
578
579/*----------------------------------------------------------------------------*/
593/*----------------------------------------------------------------------------*/
594
595void
597 const cs_cell_mesh_t *cm,
599 cs_hodge_t *hodge,
601 cs_cell_sys_t *csys);
602
603/*----------------------------------------------------------------------------*/
618/*----------------------------------------------------------------------------*/
619
620void
622 const cs_cell_mesh_t *cm,
624 cs_hodge_t *hodge,
626 cs_cell_sys_t *csys);
627
628/*----------------------------------------------------------------------------*/
644/*----------------------------------------------------------------------------*/
645
646void
648 const double *pot,
649 const cs_hodge_t *hodge,
651 double *flx);
652
653/*----------------------------------------------------------------------------*/
669/*----------------------------------------------------------------------------*/
670
671void
673 const double *pot,
674 const cs_hodge_t *hodge,
676 double *flx);
677
678/*----------------------------------------------------------------------------*/
694/*----------------------------------------------------------------------------*/
695
696void
698 const double *pot,
699 const cs_hodge_t *hodge,
701 double *flx);
702
703/*----------------------------------------------------------------------------*/
719/*----------------------------------------------------------------------------*/
720
721void
723 const cs_cell_mesh_t *cm,
724 const cs_real_t *pot,
725 const cs_hodge_t *hodge,
727 cs_real_t *flux);
728
729/*----------------------------------------------------------------------------*/
744/*----------------------------------------------------------------------------*/
745
746void
748 const cs_real_t *pot,
749 const cs_hodge_t *hodge,
751 cs_real_t *flx);
752
753/*----------------------------------------------------------------------------*/
768/*----------------------------------------------------------------------------*/
769
770void
772 const cs_real_t *pot,
773 const cs_hodge_t *hodge,
775 cs_real_t *flx);
776
777/*----------------------------------------------------------------------------*/
790/*----------------------------------------------------------------------------*/
791
792void
794 const cs_cell_mesh_t *cm,
795 const cs_real_t *pot,
796 const cs_hodge_t *hodge,
798 cs_real_t *flux);
799
800/*----------------------------------------------------------------------------*/
814/*----------------------------------------------------------------------------*/
815
816double
818 const cs_real_t pty_tens[3][3],
819 const double *p_v,
820 const double p_f,
821 const double p_c,
823
824/*----------------------------------------------------------------------------*/
838/*----------------------------------------------------------------------------*/
839
840void
842 const cs_cell_mesh_t *cm,
843 const cs_real_t *pot,
844 const cs_hodge_t *hodge,
846 cs_real_t *flux);
847
848/*----------------------------------------------------------------------------*/
862/*----------------------------------------------------------------------------*/
863
864void
865cs_cdovb_diffusion_p0_face_flux(const short int f,
866 const cs_cell_mesh_t *cm,
867 const cs_real_t diff_tensor[3][3],
868 const cs_real_t *pot_values,
869 cs_real_t *fluxes);
870
871/*----------------------------------------------------------------------------*/
872
874
875#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.c:2678
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.c:3217
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.c:2130
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.c:2780
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.c:3541
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.c:1881
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:65
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.c:1035
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.c:1744
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.c:2967
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.c:1344
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.c:2039
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.c:3008
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.c:3057
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.c:3460
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.c:1950
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.c:1121
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.c:2591
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.c:1591
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.c:3360
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.c:2388
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.c:1469
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.c:3619
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.c:945
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.c:2867
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.c:2254
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.c:3115
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.c:869
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.c:3321
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.c:1238
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.c:819
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.c:2486
#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
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 associated to a discrete Hodge operator *.
Definition cs_hodge.h:183