programmer's 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-2018 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.h"
38 #include "cs_quadrature.h"
39 #include "cs_time_step.h"
40 #include "cs_xdef.h"
41 
42 /*----------------------------------------------------------------------------*/
43 
45 
46 /*============================================================================
47  * Macro definitions
48  *============================================================================*/
49 
50 #define CS_N_MAX_SOURCE_TERMS 8 // Max number of source terms in an equation
51 
52 /*============================================================================
53  * Type definitions
54  *============================================================================*/
55 
56 /*----------------------------------------------------------------------------*/
67 /*----------------------------------------------------------------------------*/
68 
69 typedef void
71  const cs_cell_mesh_t *cm,
73  void *input,
74  double *values);
75 
76 
77 /*============================================================================
78  * Public function prototypes
79  *============================================================================*/
80 
81 /*----------------------------------------------------------------------------*/
89 /*----------------------------------------------------------------------------*/
90 
91 void
93  const cs_cdo_connect_t *connect,
94  const cs_time_step_t *time_step);
95 
96 /*----------------------------------------------------------------------------*/
105 /*----------------------------------------------------------------------------*/
106 
107 cs_flag_t
109 
110 /*----------------------------------------------------------------------------*/
118 /*----------------------------------------------------------------------------*/
119 
120 void
122  cs_flag_t flag);
123 
124 /*----------------------------------------------------------------------------*/
132 /*----------------------------------------------------------------------------*/
133 
134 cs_flag_t
136 
137 /*----------------------------------------------------------------------------*/
151 /*----------------------------------------------------------------------------*/
152 
153 cs_flag_t
155  const int n_source_terms,
156  const cs_xdef_t **source_terms,
157  cs_source_term_cellwise_t *compute_source[],
158  cs_flag_t *sys_flag,
159  cs_mask_t *source_mask[]);
160 
161 /*----------------------------------------------------------------------------*/
175 /*----------------------------------------------------------------------------*/
176 
177 void
178 cs_source_term_compute_cellwise(const int n_source_terms,
179  const cs_xdef_t **source_terms,
180  const cs_cell_mesh_t *cm,
181  const cs_mask_t *source_mask,
182  cs_source_term_cellwise_t *compute_source[],
183  void *input,
184  cs_cell_builder_t *cb,
185  cs_cell_sys_t *csys);
186 
187 /*----------------------------------------------------------------------------*/
196 /*----------------------------------------------------------------------------*/
197 
198 void
200  const cs_xdef_t *source,
201  double *p_values[]);
202 
203 /*----------------------------------------------------------------------------*/
212 /*----------------------------------------------------------------------------*/
213 
214 void
216  const cs_xdef_t *source,
217  double *p_values[]);
218 
219 /*----------------------------------------------------------------------------*/
234 /*----------------------------------------------------------------------------*/
235 
236 void
238  const cs_cell_mesh_t *cm,
239  cs_cell_builder_t *cb,
240  void *input,
241  double *values);
242 
243 /*----------------------------------------------------------------------------*/
258 /*----------------------------------------------------------------------------*/
259 
260 void
262  const cs_cell_mesh_t *cm,
263  cs_cell_builder_t *cb,
264  void *input,
265  double *values);
266 
267 /*----------------------------------------------------------------------------*/
279 /*----------------------------------------------------------------------------*/
280 
281 void
283  const cs_cell_mesh_t *cm,
284  cs_cell_builder_t *cb,
285  void *input,
286  double *values);
287 
288 /*----------------------------------------------------------------------------*/
303 /*----------------------------------------------------------------------------*/
304 
305 void
307  const cs_cell_mesh_t *cm,
308  cs_cell_builder_t *cb,
309  void *input,
310  double *values);
311 
312 /*----------------------------------------------------------------------------*/
327 /*----------------------------------------------------------------------------*/
328 
329 void
331  const cs_cell_mesh_t *cm,
332  cs_cell_builder_t *cb,
333  void *input,
334  double *values);
335 
336 /*----------------------------------------------------------------------------*/
351 /*----------------------------------------------------------------------------*/
352 
353 void
355  const cs_cell_mesh_t *cm,
356  cs_cell_builder_t *cb,
357  void *input,
358  double *values);
359 
360 /*----------------------------------------------------------------------------*/
377 /*----------------------------------------------------------------------------*/
378 
379 void
381  const cs_cell_mesh_t *cm,
382  cs_cell_builder_t *cb,
383  void *input,
384  double *values);
385 
386 /*----------------------------------------------------------------------------*/
401 /*----------------------------------------------------------------------------*/
402 
403 void
405  const cs_cell_mesh_t *cm,
406  cs_cell_builder_t *cb,
407  void *input,
408  double *values);
409 
410 /*----------------------------------------------------------------------------*/
425 /*----------------------------------------------------------------------------*/
426 
427 void
429  const cs_cell_mesh_t *cm,
430  cs_cell_builder_t *cb,
431  void *input,
432  double *values);
433 
434 /*----------------------------------------------------------------------------*/
447 /*----------------------------------------------------------------------------*/
448 
449 void
451  const cs_cell_mesh_t *cm,
452  cs_cell_builder_t *cb,
453  void *input,
454  double *values);
455 
456 /*----------------------------------------------------------------------------*/
470 /*----------------------------------------------------------------------------*/
471 
472 void
474  const cs_cell_mesh_t *cm,
475  cs_cell_builder_t *cb,
476  void *input,
477  double *values);
478 
479 /*----------------------------------------------------------------------------*/
495 /*----------------------------------------------------------------------------*/
496 
497 void
499  const cs_cell_mesh_t *cm,
500  cs_cell_builder_t *cb,
501  void *input,
502  double *values);
503 
504 /*----------------------------------------------------------------------------*/
520 /*----------------------------------------------------------------------------*/
521 
522 void
524  const cs_cell_mesh_t *cm,
525  cs_cell_builder_t *cb,
526  void *input,
527  double *values);
528 
529 /*----------------------------------------------------------------------------*/
542 /*----------------------------------------------------------------------------*/
543 
544 void
546  const cs_cell_mesh_t *cm,
547  cs_cell_builder_t *cb,
548  void *input,
549  double *values);
550 
551 /*----------------------------------------------------------------------------*/
565 /*----------------------------------------------------------------------------*/
566 
567 void
569  const cs_cell_mesh_t *cm,
570  cs_cell_builder_t *cb,
571  void *input,
572  double *values);
573 
574 /*----------------------------------------------------------------------------*/
575 
577 
578 #endif /* __CS_SOURCE_TERM_H__ */
void cs_source_term_compute_from_potential(cs_flag_t loc, const cs_xdef_t *source, double *p_values[])
Compute the contribution related to a source term in the case of an input data which is a potential...
Definition: cs_source_term.c:790
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:387
void cs_source_term_vcsp_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1459
time step descriptor
Definition: cs_time_step.h:51
void cs_source_term_dcsd_q1o1_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1083
void cs_source_term_compute_from_density(cs_flag_t loc, const cs_xdef_t *source, double *p_values[])
Compute the contribution related to a source term in the case of an input data which is a density...
Definition: cs_source_term.c:726
unsigned char cs_mask_t
Definition: cs_flag.h:128
void cs_source_term_fbvd_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1598
void cs_source_term_dcsd_bary_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:993
void cs_source_term_pvsp_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:904
#define BEGIN_C_DECLS
Definition: cs_defs.h:461
Definition: cs_cdo_local.h:133
Definition: cs_cdo_connect.h:69
void() cs_source_term_cellwise_t(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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.h:70
void cs_source_term_compute_cellwise(const int n_source_terms, const cs_xdef_t **source_terms, const cs_cell_mesh_t *cm, const cs_mask_t *source_mask, cs_source_term_cellwise_t *compute_source[], void *input, cs_cell_builder_t *cb, cs_cell_sys_t *csys)
Compute the local contributions of source terms in a cell.
Definition: cs_source_term.c:667
void cs_source_term_fbvd_bary_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1683
Definition: cs_cdo_quantities.h:94
Definition: cs_cdo_local.h:94
void cs_source_term_dcsd_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:953
void cs_source_term_pvsp_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:855
void cs_source_term_set_shared_pointers(const cs_cdo_quantities_t *quant, const cs_cdo_connect_t *connect, const cs_time_step_t *time_step)
Set shared pointers to main domain members.
Definition: cs_source_term.c:270
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:332
cs_flag_t cs_source_term_init(cs_param_space_scheme_t space_scheme, const int n_source_terms, const cs_xdef_t **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:412
void cs_source_term_dcsd_q10o2_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1162
static int input(void)
void cs_source_term_vcsp_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1508
Definition: cs_cdo_local.h:71
Structure storing medata for defining a quantity in a very flexible way.
Definition: cs_xdef.h:122
cs_flag_t cs_source_term_set_default_flag(cs_param_space_scheme_t scheme)
Set the default flag related to a source term according to the numerical scheme chosen for discretizi...
Definition: cs_source_term.c:292
void cs_source_term_fbsd_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1562
void cs_source_term_dcsd_q5o3_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1362
void cs_source_term_fbsd_bary_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1636
#define END_C_DECLS
Definition: cs_defs.h:462
unsigned short int cs_flag_t
Definition: cs_defs.h:299
cs_param_space_scheme_t
Type of numerical scheme for the discretization in space.
Definition: cs_param.h:122
void cs_source_term_hhosd_by_analytic(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1857
void cs_source_term_hhosd_by_value(const cs_xdef_t *source, const cs_cell_mesh_t *cm, 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:1729