8.0
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-2023 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 
64 typedef 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 
90 void
92  const cs_cell_mesh_t *cm,
94  cs_hodge_t *hodge,
96  cs_cell_sys_t *csys);
97 
98 /*----------------------------------------------------------------------------*/
113 /*----------------------------------------------------------------------------*/
114 
115 void
117  const cs_cell_mesh_t *cm,
119  cs_hodge_t *hodge,
120  cs_cell_builder_t *cb,
121  cs_cell_sys_t *csys);
122 
123 /*----------------------------------------------------------------------------*/
146 /*----------------------------------------------------------------------------*/
147 
148 void
150  const cs_cell_mesh_t *cm,
152  cs_hodge_t *hodge,
153  cs_cell_builder_t *cb,
154  cs_cell_sys_t *csys);
155 
156 /*----------------------------------------------------------------------------*/
180 /*----------------------------------------------------------------------------*/
181 
182 void
184  const cs_cell_mesh_t *cm,
186  cs_hodge_t *hodge,
187  cs_cell_builder_t *cb,
188  cs_cell_sys_t *csys);
189 
190 /*----------------------------------------------------------------------------*/
205 /*----------------------------------------------------------------------------*/
206 
207 void
209  const cs_cell_mesh_t *cm,
211  cs_hodge_t *hodge,
212  cs_cell_builder_t *cb,
213  cs_cell_sys_t *csys);
214 
215 /*----------------------------------------------------------------------------*/
232 /*----------------------------------------------------------------------------*/
233 
234 void
236  const cs_cell_mesh_t *cm,
238  cs_hodge_t *hodge,
239  cs_cell_builder_t *cb,
240  cs_cell_sys_t *csys);
241 
242 /*----------------------------------------------------------------------------*/
257 /*----------------------------------------------------------------------------*/
258 
259 void
261  const cs_cell_mesh_t *cm,
263  cs_hodge_t *hodge,
264  cs_cell_builder_t *cb,
265  cs_cell_sys_t *csys);
266 
267 /*----------------------------------------------------------------------------*/
284 /*----------------------------------------------------------------------------*/
285 
286 void
288  const cs_cell_mesh_t *cm,
290  cs_hodge_t *hodge,
291  cs_cell_builder_t *cb,
292  cs_cell_sys_t *csys);
293 
294 /*----------------------------------------------------------------------------*/
309 /*----------------------------------------------------------------------------*/
310 
311 void
313  const cs_cell_mesh_t *cm,
315  cs_hodge_t *hodge,
316  cs_cell_builder_t *cb,
317  cs_cell_sys_t *csys);
318 
319 /*----------------------------------------------------------------------------*/
333 /*----------------------------------------------------------------------------*/
334 
335 void
337  const cs_cell_mesh_t *cm,
339  cs_hodge_t *hodge,
340  cs_cell_builder_t *cb,
341  cs_cell_sys_t *csys);
342 
343 /*----------------------------------------------------------------------------*/
357 /*----------------------------------------------------------------------------*/
358 
359 void
361  const cs_cell_mesh_t *cm,
363  cs_hodge_t *hodge,
364  cs_cell_builder_t *cb,
365  cs_cell_sys_t *csys);
366 
367 /*----------------------------------------------------------------------------*/
382 /*----------------------------------------------------------------------------*/
383 
384 void
386  const cs_cell_mesh_t *cm,
388  cs_hodge_t *hodge,
389  cs_cell_builder_t *cb,
390  cs_cell_sys_t *csys);
391 
392 /*----------------------------------------------------------------------------*/
408 /*----------------------------------------------------------------------------*/
409 
410 void
412  const cs_cell_mesh_t *cm,
414  cs_hodge_t *hodge,
415  cs_cell_builder_t *cb,
416  cs_cell_sys_t *csys);
417 
418 /*----------------------------------------------------------------------------*/
433 /*----------------------------------------------------------------------------*/
434 
435 void
437  const cs_cell_mesh_t *cm,
439  cs_hodge_t *hodge,
440  cs_cell_builder_t *cb,
441  cs_cell_sys_t *csys);
442 
443 /*----------------------------------------------------------------------------*/
459 /*----------------------------------------------------------------------------*/
460 
461 void
463  const cs_cell_mesh_t *cm,
465  cs_hodge_t *hodge,
466  cs_cell_builder_t *cb,
467  cs_cell_sys_t *csys);
468 
469 /*----------------------------------------------------------------------------*/
483 /*----------------------------------------------------------------------------*/
484 
485 void
487  const cs_cell_mesh_t *cm,
489  cs_hodge_t *hodge,
490  cs_cell_builder_t *cb,
491  cs_cell_sys_t *csys);
492 
493 /*----------------------------------------------------------------------------*/
507 /*----------------------------------------------------------------------------*/
508 
509 void
511  const cs_cell_mesh_t *cm,
513  cs_hodge_t *hodge,
514  cs_cell_builder_t *cb,
515  cs_cell_sys_t *csys);
516 
517 /*----------------------------------------------------------------------------*/
532 /*----------------------------------------------------------------------------*/
533 
534 void
536  const cs_cell_mesh_t *cm,
538  cs_hodge_t *hodge,
539  cs_cell_builder_t *cb,
540  cs_cell_sys_t *csys);
541 
542 /*----------------------------------------------------------------------------*/
556 /*----------------------------------------------------------------------------*/
557 
558 void
560  const cs_cell_mesh_t *cm,
562  cs_hodge_t *hodge,
563  cs_cell_builder_t *cb,
564  cs_cell_sys_t *csys);
565 
566 /*----------------------------------------------------------------------------*/
581 /*----------------------------------------------------------------------------*/
582 
583 void
585  const cs_cell_mesh_t *cm,
587  cs_hodge_t *hodge,
588  cs_cell_builder_t *cb,
589  cs_cell_sys_t *csys);
590 
591 /*----------------------------------------------------------------------------*/
607 /*----------------------------------------------------------------------------*/
608 
609 void
611  const double *pot,
612  const cs_hodge_t *hodge,
613  cs_cell_builder_t *cb,
614  double *flx);
615 
616 /*----------------------------------------------------------------------------*/
632 /*----------------------------------------------------------------------------*/
633 
634 void
636  const double *pot,
637  const cs_hodge_t *hodge,
638  cs_cell_builder_t *cb,
639  double *flx);
640 
641 /*----------------------------------------------------------------------------*/
657 /*----------------------------------------------------------------------------*/
658 
659 void
661  const double *pot,
662  const cs_hodge_t *hodge,
663  cs_cell_builder_t *cb,
664  double *flx);
665 
666 /*----------------------------------------------------------------------------*/
682 /*----------------------------------------------------------------------------*/
683 
684 void
686  const cs_cell_mesh_t *cm,
687  const cs_real_t *pot,
688  const cs_hodge_t *hodge,
689  cs_cell_builder_t *cb,
690  cs_real_t *flux);
691 
692 /*----------------------------------------------------------------------------*/
707 /*----------------------------------------------------------------------------*/
708 
709 void
711  const cs_real_t *pot,
712  const cs_hodge_t *hodge,
713  cs_cell_builder_t *cb,
714  cs_real_t *flx);
715 
716 /*----------------------------------------------------------------------------*/
731 /*----------------------------------------------------------------------------*/
732 
733 void
735  const cs_real_t *pot,
736  const cs_hodge_t *hodge,
737  cs_cell_builder_t *cb,
738  cs_real_t *flx);
739 
740 /*----------------------------------------------------------------------------*/
753 /*----------------------------------------------------------------------------*/
754 
755 void
757  const cs_cell_mesh_t *cm,
758  const cs_real_t *pot,
759  const cs_hodge_t *hodge,
760  cs_cell_builder_t *cb,
761  cs_real_t *flux);
762 
763 /*----------------------------------------------------------------------------*/
777 /*----------------------------------------------------------------------------*/
778 
779 double
781  const cs_real_t pty_tens[3][3],
782  const double *p_v,
783  const double p_f,
784  const double p_c,
785  cs_cell_builder_t *cb);
786 
787 /*----------------------------------------------------------------------------*/
801 /*----------------------------------------------------------------------------*/
802 
803 void
805  const cs_cell_mesh_t *cm,
806  const cs_real_t *pot,
807  const cs_hodge_t *hodge,
808  cs_cell_builder_t *cb,
809  cs_real_t *flux);
810 
811 /*----------------------------------------------------------------------------*/
825 /*----------------------------------------------------------------------------*/
826 
827 void
828 cs_cdovb_diffusion_p0_face_flux(const short int f,
829  const cs_cell_mesh_t *cm,
830  const cs_real_t diff_tensor[3][3],
831  const cs_real_t *pot_values,
832  cs_real_t *fluxes);
833 
834 /*----------------------------------------------------------------------------*/
835 
837 
838 #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:2588
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:3127
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:2040
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_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:2690
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:3451
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:1791
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:1654
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:2877
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:1254
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:1949
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:2918
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:2967
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:3370
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:1860
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:1031
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:2501
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:1501
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:3270
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:2298
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:1379
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:3529
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:944
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:2777
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:2164
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:3025
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:868
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:3231
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:1148
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:818
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:2396
#define BEGIN_C_DECLS
Definition: cs_defs.h:509
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
#define END_C_DECLS
Definition: cs_defs.h:510
@ fm
Definition: cs_field_pointer.h:128
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:279
Structure associated to a discrete Hodge operator *.
Definition: cs_hodge.h:183