8.0
general documentation
Loading...
Searching...
No Matches
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-2023 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/*----------------------------------------------------------------------------*/
423/*----------------------------------------------------------------------------*/
424
425void
427 const cs_cell_mesh_t *cm,
428 cs_real_t time_eval,
430 void *input,
431 double *values);
432
433/*----------------------------------------------------------------------------*/
447/*----------------------------------------------------------------------------*/
448
449void
451 const cs_cell_mesh_t *cm,
452 cs_real_t time_eval,
454 void *input,
455 double *values);
456
457/*----------------------------------------------------------------------------*/
473/*----------------------------------------------------------------------------*/
474
475void
477 const cs_cell_mesh_t *cm,
478 cs_real_t time_eval,
480 void *input,
481 double *values);
482
483/*----------------------------------------------------------------------------*/
499/*----------------------------------------------------------------------------*/
500
501void
503 const cs_cell_mesh_t *cm,
504 cs_real_t time_eval,
506 void *input,
507 double *values);
508
509/*----------------------------------------------------------------------------*/
525/*----------------------------------------------------------------------------*/
526
527void
529 const cs_cell_mesh_t *cm,
530 cs_real_t time_eval,
532 void *input,
533 double *values);
534
535/*----------------------------------------------------------------------------*/
553/*----------------------------------------------------------------------------*/
554
555void
557 const cs_cell_mesh_t *cm,
558 cs_real_t time_eval,
560 void *input,
561 double *values);
562
563/*----------------------------------------------------------------------------*/
579/*----------------------------------------------------------------------------*/
580
581void
583 const cs_cell_mesh_t *cm,
584 cs_real_t time_eval,
586 void *input,
587 double *values);
588
589/*----------------------------------------------------------------------------*/
605/*----------------------------------------------------------------------------*/
606
607void
609 const cs_cell_mesh_t *cm,
610 cs_real_t time_eval,
612 void *input,
613 double *values);
614
615/*----------------------------------------------------------------------------*/
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/*----------------------------------------------------------------------------*/
702/*----------------------------------------------------------------------------*/
703
704void
706 const cs_cell_mesh_t *cm,
707 cs_real_t time_eval,
709 void *input,
710 double *values);
711
712/*----------------------------------------------------------------------------*/
729/*----------------------------------------------------------------------------*/
730
731void
733 const cs_cell_mesh_t *cm,
734 cs_real_t time_eval,
736 void *input,
737 double *values);
738
739/*----------------------------------------------------------------------------*/
754/*----------------------------------------------------------------------------*/
755
756void
758 const cs_cell_mesh_t *cm,
759 cs_real_t time_eval,
761 void *input,
762 double *values);
763
764/*----------------------------------------------------------------------------*/
778/*----------------------------------------------------------------------------*/
779
780void
782 const cs_cell_mesh_t *cm,
783 cs_real_t time_eval,
785 void *input,
786 double *values);
787
788/*----------------------------------------------------------------------------*/
805/*----------------------------------------------------------------------------*/
806
807void
809 const cs_cell_mesh_t *cm,
810 cs_real_t time_eval,
812 void *input,
813 double *values);
814
815/*----------------------------------------------------------------------------*/
830/*----------------------------------------------------------------------------*/
831
832void
834 const cs_cell_mesh_t *cm,
835 cs_real_t time_eval,
837 void *input,
838 double *values);
839
840/*----------------------------------------------------------------------------*/
854/*----------------------------------------------------------------------------*/
855
856void
858 const cs_cell_mesh_t *cm,
859 cs_real_t time_eval,
861 void *input,
862 double *values);
863
864/*----------------------------------------------------------------------------*/
878/*----------------------------------------------------------------------------*/
879
880void
882 const cs_cell_mesh_t *cm,
883 cs_real_t time_eval,
885 void *input,
886 double *values);
887
888/*----------------------------------------------------------------------------*/
903/*----------------------------------------------------------------------------*/
904
905void
907 const cs_cell_mesh_t *cm,
908 cs_real_t time_eval,
910 void *input,
911 double *values);
912
913/*----------------------------------------------------------------------------*/
928/*----------------------------------------------------------------------------*/
929
930void
932 const cs_cell_mesh_t *cm,
933 cs_real_t time_eval,
935 void *input,
936 double *values);
937
938/*----------------------------------------------------------------------------*/
951/*----------------------------------------------------------------------------*/
952
953void
955 const cs_cell_mesh_t *cm,
956 cs_real_t time_eval,
958 void *input,
959 double *values);
960
961/*----------------------------------------------------------------------------*/
962
963
964
966
967#endif /* __CS_SOURCE_TERM_H__ */
#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
unsigned short int cs_flag_t
Definition cs_defs.h:321
unsigned char cs_mask_t
Definition cs_flag.h:158
unsigned int cs_eflag_t
Definition cs_flag.h:187
cs_param_space_scheme_t
Type of numerical scheme for the discretization in space.
Definition cs_param_types.h:211
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.c:532
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.c:1053
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.c:2839
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.c:2438
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.c:513
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.c:2609
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.c:1702
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.c:578
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.c:1540
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.c:988
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.c:1223
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.c:1488
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.c:3199
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.c:635
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.c:2567
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.c:2969
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.c:2299
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.c:1399
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.c:3086
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.c:2794
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.c:2350
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.c:2150
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.c:2391
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.c:2094
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.c:1993
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.c:2659
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.c:1592
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.c:1447
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.c:1317
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.c:660
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.c:2211
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.c:1781
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.c:1109
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_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.c:1164
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.c:1358
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.c:1277
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.c:2250
Definition cs_cdo_connect.h:61
Definition cs_cdo_quantities.h:137
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