8.3
general documentation
cs_source_term.h
Go to the documentation of this file.
1#ifndef __CS_SOURCE_TERM_H__
2#define __CS_SOURCE_TERM_H__
3
4/*============================================================================
5 * Functions and structures to deal with source term computation
6 *============================================================================*/
7
8/*
9 This file is part of code_saturne, a general-purpose CFD tool.
10
11 Copyright (C) 1998-2024 EDF S.A.
12
13 This program is free software; you can redistribute it and/or modify it under
14 the terms of the GNU General Public License as published by the Free Software
15 Foundation; either version 2 of the License, or (at your option) any later
16 version.
17
18 This program is distributed in the hope that it will be useful, but WITHOUT
19 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
20 FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
21 details.
22
23 You should have received a copy of the GNU General Public License along with
24 this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
25 Street, Fifth Floor, Boston, MA 02110-1301, USA.
26*/
27
28/*----------------------------------------------------------------------------*/
29
30/*----------------------------------------------------------------------------
31 * Local headers
32 *----------------------------------------------------------------------------*/
33
34#include "cs_base.h"
35#include "cs_cdo_quantities.h"
36#include "cs_cdo_local.h"
37#include "cs_param_types.h"
38#include "cs_quadrature.h"
39#include "cs_xdef.h"
40
41/*----------------------------------------------------------------------------*/
42
44
45/*============================================================================
46 * Macro definitions
47 *============================================================================*/
48
49#define CS_N_MAX_SOURCE_TERMS 8 // Max number of source terms in an equation
50
51/*============================================================================
52 * Type definitions
53 *============================================================================*/
54
55/*----------------------------------------------------------------------------*/
67/*----------------------------------------------------------------------------*/
68
69typedef void
71 const cs_cell_mesh_t *cm,
72 cs_real_t time_eval,
74 void *input,
75 double *values);
76
77
78/*============================================================================
79 * Public function prototypes
80 *============================================================================*/
81
82/*----------------------------------------------------------------------------*/
89/*----------------------------------------------------------------------------*/
90
91void
93 const cs_cdo_connect_t *connect);
94
95/*----------------------------------------------------------------------------*/
104/*----------------------------------------------------------------------------*/
105
106void
108 cs_flag_t *state_flag,
109 cs_flag_t *meta_flag);
110
111/*----------------------------------------------------------------------------*/
119/*----------------------------------------------------------------------------*/
120
121void
123 cs_flag_t flag);
124
125/*----------------------------------------------------------------------------*/
133/*----------------------------------------------------------------------------*/
134
137
138/*----------------------------------------------------------------------------*/
152/*----------------------------------------------------------------------------*/
153
156 const int n_source_terms,
157 cs_xdef_t *const *source_terms,
158 cs_source_term_cellwise_t *compute_source[],
159 cs_flag_t *sys_flag,
160 cs_mask_t *source_mask[]);
161
162/*----------------------------------------------------------------------------*/
177/*----------------------------------------------------------------------------*/
178
179void
180cs_source_term_compute_cellwise(const int n_source_terms,
181 cs_xdef_t *const *source_terms,
182 const cs_cell_mesh_t *cm,
183 const cs_mask_t *source_mask,
184 cs_source_term_cellwise_t *compute_source[],
185 cs_real_t time_eval,
186 void *input,
188 cs_real_t *result);
189
190/*----------------------------------------------------------------------------*/
206/*----------------------------------------------------------------------------*/
207
208void
210 const cs_cell_mesh_t *cm,
211 cs_real_t time_eval,
213 void *input,
214 double *values);
215
216/*----------------------------------------------------------------------------*/
232/*----------------------------------------------------------------------------*/
233
234void
236 const cs_cell_mesh_t *cm,
237 cs_real_t time_eval,
239 void *input,
240 double *values);
241
242/*----------------------------------------------------------------------------*/
257/*----------------------------------------------------------------------------*/
258
259void
261 const cs_cell_mesh_t *cm,
262 cs_real_t time_eval,
264 void *input,
265 double *values);
266
267/*----------------------------------------------------------------------------*/
282/*----------------------------------------------------------------------------*/
283
284void
286 const cs_cell_mesh_t *cm,
287 cs_real_t time_eval,
289 void *input,
290 double *values);
291
292/*----------------------------------------------------------------------------*/
305/*----------------------------------------------------------------------------*/
306
307void
309 const cs_cell_mesh_t *cm,
310 cs_real_t time_eval,
312 void *input,
313 double *values);
314
315/*----------------------------------------------------------------------------*/
328/*----------------------------------------------------------------------------*/
329
330void
332 const cs_cell_mesh_t *cm,
333 cs_real_t time_eval,
335 void *input,
336 double *values);
337
338/*----------------------------------------------------------------------------*/
352/*----------------------------------------------------------------------------*/
353
354void
356 const cs_cell_mesh_t *cm,
357 cs_real_t time_eval,
359 void *input,
360 double *values);
361
362/*----------------------------------------------------------------------------*/
376/*----------------------------------------------------------------------------*/
377
378void
380 const cs_cell_mesh_t *cm,
381 cs_real_t time_eval,
383 void *input,
384 double *values);
385
386/*----------------------------------------------------------------------------*/
400/*----------------------------------------------------------------------------*/
401
402void
404 const cs_cell_mesh_t *cm,
405 cs_real_t time_eval,
407 void *input,
408 double *values);
409
410/*----------------------------------------------------------------------------*/
424/*----------------------------------------------------------------------------*/
425
426void
428 const cs_cell_mesh_t *cm,
429 cs_real_t time_eval,
431 void *input,
432 double *values);
433
434/*----------------------------------------------------------------------------*/
447/*----------------------------------------------------------------------------*/
448
449void
451 const cs_cell_mesh_t *cm,
452 cs_real_t time_eval,
454 void *input,
455 double *values);
456
457/*----------------------------------------------------------------------------*/
471/*----------------------------------------------------------------------------*/
472
473void
475 const cs_cell_mesh_t *cm,
476 cs_real_t time_eval,
478 void *input,
479 double *values);
480
481/*----------------------------------------------------------------------------*/
497/*----------------------------------------------------------------------------*/
498
499void
501 const cs_cell_mesh_t *cm,
502 cs_real_t time_eval,
504 void *input,
505 double *values);
506
507/*----------------------------------------------------------------------------*/
523/*----------------------------------------------------------------------------*/
524
525void
527 const cs_cell_mesh_t *cm,
528 cs_real_t time_eval,
530 void *input,
531 double *values);
532
533/*----------------------------------------------------------------------------*/
549/*----------------------------------------------------------------------------*/
550
551void
553 const cs_cell_mesh_t *cm,
554 cs_real_t time_eval,
556 void *input,
557 double *values);
558
559/*----------------------------------------------------------------------------*/
577/*----------------------------------------------------------------------------*/
578
579void
581 const cs_cell_mesh_t *cm,
582 cs_real_t time_eval,
584 void *input,
585 double *values);
586
587/*----------------------------------------------------------------------------*/
603/*----------------------------------------------------------------------------*/
604
605void
607 const cs_cell_mesh_t *cm,
608 cs_real_t time_eval,
610 void *input,
611 double *values);
612
613/*----------------------------------------------------------------------------*/
629/*----------------------------------------------------------------------------*/
630
631void
633 const cs_cell_mesh_t *cm,
634 cs_real_t time_eval,
636 void *input,
637 double *values);
638
639/*----------------------------------------------------------------------------*/
653/*----------------------------------------------------------------------------*/
654
655void
657 const cs_cell_mesh_t *cm,
658 cs_real_t time_eval,
660 void *input,
661 double *values);
662
663/*----------------------------------------------------------------------------*/
677/*----------------------------------------------------------------------------*/
678
679void
681 const cs_cell_mesh_t *cm,
682 cs_real_t time_eval,
684 void *input,
685 double *values);
686
687/*----------------------------------------------------------------------------*/
701/*----------------------------------------------------------------------------*/
702
703void
705 const cs_cell_mesh_t *cm,
706 cs_real_t time_eval,
708 void *input,
709 double *values);
710
711/*----------------------------------------------------------------------------*/
726/*----------------------------------------------------------------------------*/
727
728void
730 const cs_cell_mesh_t *cm,
731 cs_real_t time_eval,
733 void *input,
734 double *values);
735
736/*----------------------------------------------------------------------------*/
753/*----------------------------------------------------------------------------*/
754
755void
757 const cs_cell_mesh_t *cm,
758 cs_real_t time_eval,
760 void *input,
761 double *values);
762
763/*----------------------------------------------------------------------------*/
778/*----------------------------------------------------------------------------*/
779
780void
782 const cs_cell_mesh_t *cm,
783 cs_real_t time_eval,
785 void *input,
786 double *values);
787
788/*----------------------------------------------------------------------------*/
802/*----------------------------------------------------------------------------*/
803
804void
806 const cs_cell_mesh_t *cm,
807 cs_real_t time_eval,
809 void *input,
810 double *values);
811
812/*----------------------------------------------------------------------------*/
829/*----------------------------------------------------------------------------*/
830
831void
833 const cs_cell_mesh_t *cm,
834 cs_real_t time_eval,
836 void *input,
837 double *values);
838
839/*----------------------------------------------------------------------------*/
854/*----------------------------------------------------------------------------*/
855
856void
858 const cs_cell_mesh_t *cm,
859 cs_real_t time_eval,
861 void *input,
862 double *values);
863
864/*----------------------------------------------------------------------------*/
879/*----------------------------------------------------------------------------*/
880
882 const cs_cell_mesh_t *cm,
883 cs_real_t time_eval,
885 void *input,
886 double *values);
887
888/*----------------------------------------------------------------------------*/
902/*----------------------------------------------------------------------------*/
903
904void
906 const cs_cell_mesh_t *cm,
907 cs_real_t time_eval,
909 void *input,
910 double *values);
911
912/*----------------------------------------------------------------------------*/
926/*----------------------------------------------------------------------------*/
927
928void
930 const cs_cell_mesh_t *cm,
931 cs_real_t time_eval,
933 void *input,
934 double *values);
935
936/*----------------------------------------------------------------------------*/
951/*----------------------------------------------------------------------------*/
952
953void
955 const cs_cell_mesh_t *cm,
956 cs_real_t time_eval,
958 void *input,
959 double *values);
960
961/*----------------------------------------------------------------------------*/
976/*----------------------------------------------------------------------------*/
977
978void
980 const cs_cell_mesh_t *cm,
981 cs_real_t time_eval,
983 void *input,
984 double *values);
985
986/*----------------------------------------------------------------------------*/
999/*----------------------------------------------------------------------------*/
1000
1001void
1003 const cs_cell_mesh_t *cm,
1004 cs_real_t time_eval,
1006 void *input,
1007 double *values);
1008
1009/*----------------------------------------------------------------------------*/
1010
1011
1012
1014
1015#endif /* __CS_SOURCE_TERM_H__ */
#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
unsigned short int cs_flag_t
Definition: cs_defs.h:344
unsigned char cs_mask_t
Definition: cs_flag.h:159
unsigned int cs_eflag_t
Definition: cs_flag.h:192
cs_param_space_scheme_t
Type of numerical scheme for the discretization in space.
Definition: cs_param_types.h:215
void cs_source_term_set_default_flag(cs_param_space_scheme_t scheme, cs_flag_t *state_flag, cs_flag_t *meta_flag)
Set the default flag related to a source term according to the numerical scheme chosen for discretizi...
Definition: cs_source_term.cpp:511
void cs_source_term_pvsp_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:1066
void cs_source_term_hhosd_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution of a source term for a cell and add it to the given array of values....
Definition: cs_source_term.cpp:3031
void cs_source_term_fcb_pcsd_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution of a source term for a cell and add it to the given array of values....
Definition: cs_source_term.cpp:2540
void cs_source_term_init_sharing(const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect)
Set shared pointers to main domain members.
Definition: cs_source_term.cpp:492
void cs_source_term_fb_pcvd_bary_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:2708
void cs_source_term_dcsd_q1o1_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:1768
void cs_source_term_set_reduction(cs_xdef_t *st, cs_flag_t flag)
Set advanced parameters which are defined by default in a source term structure.
Definition: cs_source_term.cpp:559
void cs_source_term_dcsd_none_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:1606
void cs_source_term_compute_cellwise(const int n_source_terms, cs_xdef_t *const *source_terms, const cs_cell_mesh_t *cm, const cs_mask_t *source_mask, cs_source_term_cellwise_t *compute_source[], cs_real_t time_eval, void *input, cs_cell_builder_t *cb, cs_real_t *result)
Compute the local contributions of source terms in a cell.
Definition: cs_source_term.cpp:1002
void cs_source_term_pvsp_by_c2v_array(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:1236
void cs_source_term_dcsd_by_dof_func(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:1554
void cs_source_term_dfsf_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:3392
cs_flag_t cs_source_term_get_flag(const cs_xdef_t *st)
Get metadata related to the given source term structure.
Definition: cs_source_term.cpp:616
void cs_source_term_fcb_pcsd_by_array(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:2665
void cs_source_term_hhosd_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution of a source term for a cell and add it to the given array of values....
Definition: cs_source_term.cpp:3158
void cs_source_term_fb_pcvd_by_dof_func(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:2398
void cs_source_term_dcsd_by_c2v_array(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution of a source term in a cell and add it to the given array of values....
Definition: cs_source_term.cpp:1463
void cs_source_term_hhovd_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution of a source term for a cell and add it to the given array of values....
Definition: cs_source_term.cpp:3277
void cs_source_term_fb_pcvd_by_array(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution of a source term for a cell and add it to the given array of values....
Definition: cs_source_term.cpp:2985
void cs_source_term_fb_pcvd_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it the given array of values....
Definition: cs_source_term.cpp:2449
void cs_source_term_vcsp_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:2243
void cs_source_term_fcb_pcsd_bary_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:2490
void cs_source_term_vcsp_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:2187
void cs_source_term_dcsd_q5o3_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:2080
void cs_source_term_fb_pcvd_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution of a source term for a cell and add it to the given array of values....
Definition: cs_source_term.cpp:2852
void cs_source_term_dcsd_bary_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:1658
void cs_source_term_dcsd_by_pc_array(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:1512
void cs_source_term_dcvd_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:1330
cs_eflag_t cs_source_term_init(cs_param_space_scheme_t space_scheme, const int n_source_terms, cs_xdef_t *const *source_terms, cs_source_term_cellwise_t *compute_source[], cs_flag_t *sys_flag, cs_mask_t *source_mask[])
Initialize data to build the source terms.
Definition: cs_source_term.cpp:641
void cs_source_term_fcb_pcsd_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:2310
void cs_source_term_dcsd_q10o2_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:1847
void cs_source_term_macfb_pcvd_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution of a source term for a cell and add it to the given array of values....
Definition: cs_source_term.cpp:2763
void cs_source_term_pvsp_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:1122
void() cs_source_term_cellwise_t(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values.
Definition: cs_source_term.h:70
void cs_source_term_dcvd_by_pv_array(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:1415
void cs_source_term_pvsp_by_array(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:1177
void cs_source_term_dcsd_by_pv_array(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:1371
void cs_source_term_dcsd_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:1290
void cs_source_term_fcb_pcsd_by_dof_func(const cs_xdef_t *source, const cs_cell_mesh_t *cm, cs_real_t time_eval, cs_cell_builder_t *cb, void *input, double *values)
Compute the contribution for a cell related to a source term and add it to the given array of values....
Definition: cs_source_term.cpp:2349
Definition: cs_cdo_connect.h:61
Definition: cs_cdo_quantities.h:139
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
Structure storing medata for defining a quantity in a very flexible way.
Definition: cs_xdef.h:160