My Project
programmer's 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-2019 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_param.h"
40
41/*----------------------------------------------------------------------------*/
42
44
45/*============================================================================
46 * Macro definitions
47 *============================================================================*/
48
49/*============================================================================
50 * Type definitions
51 *============================================================================*/
52
53/*----------------------------------------------------------------------------*/
62/*----------------------------------------------------------------------------*/
63
64typedef void
66 const cs_real_t *pot,
68 cs_real_t *flx);
69
70/*============================================================================
71 * Public function prototypes
72 *============================================================================*/
73
74/*----------------------------------------------------------------------------*/
85/*----------------------------------------------------------------------------*/
86
87void
89 const cs_cell_mesh_t *cm,
92 cs_cell_sys_t *csys);
93
94/*----------------------------------------------------------------------------*/
106/*----------------------------------------------------------------------------*/
107
108void
110 const cs_cell_mesh_t *cm,
113 cs_cell_sys_t *csys);
114
115/*----------------------------------------------------------------------------*/
135/*----------------------------------------------------------------------------*/
136
137void
139 const cs_cell_mesh_t *cm,
142 cs_cell_sys_t *csys);
143
144/*----------------------------------------------------------------------------*/
165/*----------------------------------------------------------------------------*/
166
167void
169 const cs_cell_mesh_t *cm,
172 cs_cell_sys_t *csys);
173
174/*----------------------------------------------------------------------------*/
186/*----------------------------------------------------------------------------*/
187
188void
190 const cs_cell_mesh_t *cm,
193 cs_cell_sys_t *csys);
194
195/*----------------------------------------------------------------------------*/
209/*----------------------------------------------------------------------------*/
210
211void
213 const cs_cell_mesh_t *cm,
216 cs_cell_sys_t *csys);
217
218/*----------------------------------------------------------------------------*/
230/*----------------------------------------------------------------------------*/
231
232void
234 const cs_cell_mesh_t *cm,
237 cs_cell_sys_t *csys);
238
239/*----------------------------------------------------------------------------*/
253/*----------------------------------------------------------------------------*/
254
255void
257 const cs_cell_mesh_t *cm,
260 cs_cell_sys_t *csys);
261
262/*----------------------------------------------------------------------------*/
274/*----------------------------------------------------------------------------*/
275
276void
278 const cs_cell_mesh_t *cm,
281 cs_cell_sys_t *csys);
282
283/*----------------------------------------------------------------------------*/
294/*----------------------------------------------------------------------------*/
295
296void
298 const cs_cell_mesh_t *cm,
301 cs_cell_sys_t *csys);
302
303/*----------------------------------------------------------------------------*/
314/*----------------------------------------------------------------------------*/
315
316void
318 const cs_cell_mesh_t *cm,
321 cs_cell_sys_t *csys);
322
323/*----------------------------------------------------------------------------*/
336/*----------------------------------------------------------------------------*/
337
338void
340 const cs_cell_mesh_t *cm,
343 cs_cell_sys_t *csys);
344
345/*----------------------------------------------------------------------------*/
356/*----------------------------------------------------------------------------*/
357
358void
360 const cs_cell_mesh_t *cm,
363 cs_cell_sys_t *csys);
364
365/*----------------------------------------------------------------------------*/
378/*----------------------------------------------------------------------------*/
379
380void
382 const cs_cell_mesh_t *cm,
385 cs_cell_sys_t *csys);
386
387/*----------------------------------------------------------------------------*/
398/*----------------------------------------------------------------------------*/
399
400void
402 const cs_cell_mesh_t *cm,
405 cs_cell_sys_t *csys);
406
407/*----------------------------------------------------------------------------*/
419/*----------------------------------------------------------------------------*/
420
421void
423 const cs_cell_mesh_t *cm,
426 cs_cell_sys_t *csys);
427
428/*----------------------------------------------------------------------------*/
439/*----------------------------------------------------------------------------*/
440
441void
443 const cs_cell_mesh_t *cm,
446 cs_cell_sys_t *csys);
447
448/*----------------------------------------------------------------------------*/
460/*----------------------------------------------------------------------------*/
461
462void
464 const cs_cell_mesh_t *cm,
467 cs_cell_sys_t *csys);
468
469/*----------------------------------------------------------------------------*/
480/*----------------------------------------------------------------------------*/
481
482void
484 const cs_cell_mesh_t *cm,
487 cs_cell_sys_t *csys);
488
489/*----------------------------------------------------------------------------*/
501/*----------------------------------------------------------------------------*/
502
503void
505 const cs_cell_mesh_t *cm,
508 cs_cell_sys_t *csys);
509
510/*----------------------------------------------------------------------------*/
523/*----------------------------------------------------------------------------*/
524
525void
527 const double *pot,
529 double *flx);
530
531/*----------------------------------------------------------------------------*/
543/*----------------------------------------------------------------------------*/
544
545void
547 const double *pot,
549 double *flx);
550
551/*----------------------------------------------------------------------------*/
564/*----------------------------------------------------------------------------*/
565
566void
568 const cs_equation_param_t *eqp,
569 const cs_cell_mesh_t *cm,
570 const cs_real_t *pot,
572 cs_real_t *flux);
573
574/*----------------------------------------------------------------------------*/
586/*----------------------------------------------------------------------------*/
587
588void
590 const cs_real_t *pot,
592 cs_real_t *flx);
593
594/*----------------------------------------------------------------------------*/
606/*----------------------------------------------------------------------------*/
607
608void
610 const cs_real_t *pot,
612 cs_real_t *flx);
613
614/*----------------------------------------------------------------------------*/
628/*----------------------------------------------------------------------------*/
629
630void
632 const cs_equation_param_t *eqp,
633 const cs_cell_mesh_t *cm,
634 const cs_real_t *pot,
636 cs_real_t *flux);
637
638/*----------------------------------------------------------------------------*/
652/*----------------------------------------------------------------------------*/
653
654double
656 const cs_real_t pty_tens[3][3],
657 const double *p_v,
658 const double p_f,
659 const double p_c,
661
662/*----------------------------------------------------------------------------*/
676/*----------------------------------------------------------------------------*/
677
678void
680 const cs_equation_param_t *eqp,
681 const cs_cell_mesh_t *cm,
682 const cs_real_t *pot,
684 cs_real_t *flux);
685
686/*----------------------------------------------------------------------------*/
700/*----------------------------------------------------------------------------*/
701
702void
703cs_cdovb_diffusion_p0_face_flux(const short int f,
704 const cs_cell_mesh_t *cm,
705 const cs_real_3_t *diff_tensor,
706 const cs_real_t *pot_values,
707 cs_real_t *fluxes);
708
709/*----------------------------------------------------------------------------*/
710
712
713#endif /* __CS_CDO_DIFFUSION_H__ */
void cs_cdo_diffusion_wbs_get_cell_flux(const cs_cell_mesh_t *cm, const cs_real_t *pot, 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:2992
void cs_cdo_diffusion_svb_cost_vbyf_flux(short int f, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_real_t *pot, 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:2799
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_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:2472
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_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:2398
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_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:1348
void() cs_cdo_diffusion_cw_flux_t(const cs_cell_mesh_t *cm, const cs_real_t *pot, 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_svb_cost_get_cell_flux(const cs_cell_mesh_t *cm, const double *pot, cs_cell_builder_t *cb, double *flx)
Compute the constant approximation of the diffusive flux inside a (primal) cell. Use the CO+ST algo....
Definition cs_cdo_diffusion.c:2755
void cs_cdo_diffusion_svb_cost_get_dfbyc_flux(const cs_cell_mesh_t *cm, const double *pot, cs_cell_builder_t *cb, double *flx)
Compute the diffusive flux across dual faces for a given cell The discrete Hodge operator has been pr...
Definition cs_cdo_diffusion.c:2716
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_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:1241
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_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:2630
void cs_cdo_diffusion_vvb_cost_weak_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, 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:2000
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_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:1041
void cs_cdovb_diffusion_p0_face_flux(const short int f, const cs_cell_mesh_t *cm, const cs_real_3_t *diff_tensor, 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:3273
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_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:2301
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_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:2556
void cs_cdo_diffusion_wbs_vbyf_flux(short int f, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_real_t *pot, 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:3028
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:3126
void cs_cdo_diffusion_pena_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, 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:848
void cs_cdo_diffusion_svb_cost_weak_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, 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:1924
void cs_cdo_diffusion_sfb_cost_flux(short int f, const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, const cs_real_t *pot, 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:3201
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_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:1710
void cs_cdo_diffusion_alge_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, 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:965
void cs_cdo_diffusion_vvb_cost_sliding(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, 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 CO+ST algorithm.
Definition cs_cdo_diffusion.c:2102
void cs_cdo_diffusion_svb_cost_generic(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Take into account generic BCs by a weak enforcement using Nitsche technique. According to the setting...
Definition cs_cdo_diffusion.c:1801
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_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:1454
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_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:1588
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_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:894
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_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:1149
void cs_cdo_diffusion_wbs_get_dfbyc_flux(const cs_cell_mesh_t *cm, const cs_real_t *pot, 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:2890
void cs_cdo_diffusion_svb_cost_wsym_dirichlet(const cs_equation_param_t *eqp, const cs_cell_mesh_t *cm, cs_face_mesh_t *fm, 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:2220
#define BEGIN_C_DECLS
Definition cs_defs.h:467
double cs_real_t
Floating-point value.
Definition cs_defs.h:302
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition cs_defs.h:315
#define END_C_DECLS
Definition cs_defs.h:468
Structure and routines handling the specific settings related to a cs_equation_t structure.
@ fm
Definition cs_field_pointer.h:134
Set of local and temporary buffers useful for building the algebraic system with a cellwise process....
Definition cs_cdo_local.h:56
Set of local quantities and connectivities related to a mesh cell This is a key structure for all cel...
Definition cs_cdo_local.h:146
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:93
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources.
Definition cs_equation_param.h:148
Set of local quantities and connectivities related to a mesh face Structure used to get a better memo...
Definition cs_cdo_local.h:212