programmer's 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-2018 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 
64 typedef void
66  const cs_real_t *pot,
68  cs_real_t *flx);
69 
70 /*----------------------------------------------------------------------------*/
82 /*----------------------------------------------------------------------------*/
83 
84 typedef void
86  const cs_cell_mesh_t *cm,
89  cs_cell_sys_t *csys);
90 
91 /*============================================================================
92  * Public function prototypes
93  *============================================================================*/
94 
95 /*----------------------------------------------------------------------------*/
107 /*----------------------------------------------------------------------------*/
108 
109 void
111  const cs_cell_mesh_t *cm,
112  cs_face_mesh_t *fm,
113  cs_cell_builder_t *cb,
114  cs_cell_sys_t *csys);
115 
116 /*----------------------------------------------------------------------------*/
130 /*----------------------------------------------------------------------------*/
131 
132 void
134  const cs_cell_mesh_t *cm,
135  cs_face_mesh_t *fm,
136  cs_cell_builder_t *cb,
137  cs_cell_sys_t *csys);
138 
139 /*----------------------------------------------------------------------------*/
151 /*----------------------------------------------------------------------------*/
152 
153 void
155  const cs_cell_mesh_t *cm,
156  cs_face_mesh_t *fm,
157  cs_cell_builder_t *cb,
158  cs_cell_sys_t *csys);
159 
160 /*----------------------------------------------------------------------------*/
174 /*----------------------------------------------------------------------------*/
175 
176 void
178  const cs_cell_mesh_t *cm,
179  cs_face_mesh_t *fm,
180  cs_cell_builder_t *cb,
181  cs_cell_sys_t *csys);
182 
183 /*----------------------------------------------------------------------------*/
194 /*----------------------------------------------------------------------------*/
195 
196 void
198  const cs_cell_mesh_t *cm,
199  cs_face_mesh_t *fm,
200  cs_cell_builder_t *cb,
201  cs_cell_sys_t *csys);
202 
203 /*----------------------------------------------------------------------------*/
215 /*----------------------------------------------------------------------------*/
216 
217 void
219  const cs_cell_mesh_t *cm,
220  cs_face_mesh_t *fm,
221  cs_cell_builder_t *cb,
222  cs_cell_sys_t *csys);
223 
224 /*----------------------------------------------------------------------------*/
235 /*----------------------------------------------------------------------------*/
236 
237 void
239  const cs_cell_mesh_t *cm,
240  cs_face_mesh_t *fm,
241  cs_cell_builder_t *cb,
242  cs_cell_sys_t *csys);
243 
244 /*----------------------------------------------------------------------------*/
256 /*----------------------------------------------------------------------------*/
257 
258 void
260  const cs_cell_mesh_t *cm,
261  cs_face_mesh_t *fm,
262  cs_cell_builder_t *cb,
263  cs_cell_sys_t *csys);
264 
265 /*----------------------------------------------------------------------------*/
276 /*----------------------------------------------------------------------------*/
277 
278 void
280  const cs_cell_mesh_t *cm,
281  cs_face_mesh_t *fm,
282  cs_cell_builder_t *cb,
283  cs_cell_sys_t *csys);
284 
285 /*----------------------------------------------------------------------------*/
297 /*----------------------------------------------------------------------------*/
298 
299 void
301  const cs_cell_mesh_t *cm,
302  cs_face_mesh_t *fm,
303  cs_cell_builder_t *cb,
304  cs_cell_sys_t *csys);
305 
306 /*----------------------------------------------------------------------------*/
326 /*----------------------------------------------------------------------------*/
327 
328 void
330  const cs_cell_mesh_t *cm,
331  cs_face_mesh_t *fm,
332  cs_cell_builder_t *cb,
333  cs_cell_sys_t *csys);
334 
335 /*----------------------------------------------------------------------------*/
356 /*----------------------------------------------------------------------------*/
357 
358 void
360  const cs_cell_mesh_t *cm,
361  cs_face_mesh_t *fm,
362  cs_cell_builder_t *cb,
363  cs_cell_sys_t *csys);
364 
365 /*----------------------------------------------------------------------------*/
376 /*----------------------------------------------------------------------------*/
377 
378 void
380  const cs_cell_mesh_t *cm,
381  cs_face_mesh_t *fm,
382  cs_cell_builder_t *cb,
383  cs_cell_sys_t *csys);
384 
385 /*----------------------------------------------------------------------------*/
397 /*----------------------------------------------------------------------------*/
398 
399 void
401  const cs_cell_mesh_t *cm,
402  cs_face_mesh_t *fm,
403  cs_cell_builder_t *cb,
404  cs_cell_sys_t *csys);
405 
406 /*----------------------------------------------------------------------------*/
418 /*----------------------------------------------------------------------------*/
419 
420 void
422  const double *pot,
423  cs_cell_builder_t *cb,
424  double *flx);
425 
426 /*----------------------------------------------------------------------------*/
438 /*----------------------------------------------------------------------------*/
439 
440 void
442  const double *pot,
443  cs_cell_builder_t *cb,
444  double *flx);
445 
446 /*----------------------------------------------------------------------------*/
458 /*----------------------------------------------------------------------------*/
459 
460 void
462  const cs_real_t *pot,
463  cs_cell_builder_t *cb,
464  cs_real_t *flx);
465 
466 /*----------------------------------------------------------------------------*/
478 /*----------------------------------------------------------------------------*/
479 
480 void
482  const cs_real_t *pot,
483  cs_cell_builder_t *cb,
484  cs_real_t *flx);
485 
486 /*----------------------------------------------------------------------------*/
501 /*----------------------------------------------------------------------------*/
502 
503 void
505  const cs_real_3_t *diff_tensor,
506  const cs_real_t *pot_values,
507  short int f,
508  cs_real_t t_eval,
509  cs_real_t *fluxes);
510 
511 /*----------------------------------------------------------------------------*/
525 /*----------------------------------------------------------------------------*/
526 
527 double
529  const cs_real_t pty_tens[3][3],
530  const double *p_v,
531  const double p_f,
532  const double p_c,
533  cs_cell_builder_t *cb);
534 
535 /*----------------------------------------------------------------------------*/
550 /*----------------------------------------------------------------------------*/
551 
552 double
554  const cs_cell_mesh_t *cm,
555  const cs_real_3_t *diff_tensor,
556  const cs_real_t *pot_values,
557  double beta,
558  cs_cell_builder_t *cb);
559 
560 /*----------------------------------------------------------------------------*/
561 
563 
564 #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:2105
void cs_cdo_diffusion_vbcost_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:1960
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:894
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:1665
Set of parameters to handle an unsteady convection-diffusion-reaction equation with term sources...
Definition: cs_equation_param.h:159
void cs_cdo_diffusion_vbcost_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 Use the COST algo. for computing the di...
Definition: cs_cdo_diffusion.c:1922
void cs_cdovb_diffusion_p0_face_flux(const cs_cell_mesh_t *cm, const cs_real_3_t *diff_tensor, const cs_real_t *pot_values, short int f, cs_real_t t_eval, 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:2142
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:2190
#define BEGIN_C_DECLS
Definition: cs_defs.h:462
double cs_cdo_diffusion_vbcost_face_flux(short int f, const cs_cell_mesh_t *cm, const cs_real_3_t *diff_tensor, const cs_real_t *pot_values, double beta, cs_cell_builder_t *cb)
Compute the normal flux for a face assuming only the knowledge of the potential at cell vertices...
Definition: cs_cdo_diffusion.c:2266
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:1738
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:1465
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:1003
Set of local quantities and connectivities related to a mesh cell This is a key structure for all cel...
Definition: cs_cdo_local.h:163
double precision, dimension(ncharm), save beta
Definition: cpincl.f90:99
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:2003
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:1617
double cs_real_t
Floating-point value.
Definition: cs_defs.h:297
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:112
void cs_cdo_diffusion_vbcost_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:1139
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:782
Definition: cs_field_pointer.h:123
void() cs_cdo_cellwise_diffusion_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_enforce_dir_t(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)
Enforce the Dirichlet BCs when a diffusion term is present. This routine define an operator which rec...
Definition: cs_cdo_diffusion.h:85
Set of local and temporary buffers useful for building the algebraic system with a cellwise process...
Definition: cs_cdo_local.h:75
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:310
void cs_cdo_diffusion_vbcost_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:1222
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:685
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:1814
#define END_C_DECLS
Definition: cs_defs.h:463
void cs_cdo_diffusion_vbwbs_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:1385
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:1537
Set of local quantities and connectivities related to a mesh face Structure used to get a better memo...
Definition: cs_cdo_local.h:224
Structure and routines handling the specific settings related to a cs_equation_t structure.
void cs_cdo_diffusion_vbwbs_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:1313