programmer's documentation
cs_cdovb_scaleq.h
Go to the documentation of this file.
1 #ifndef __CS_CDOVB_SCALEQ_H__
2 #define __CS_CDOVB_SCALEQ_H__
3 
4 /*============================================================================
5  * Build an algebraic CDO vertex-based system for scalar conv./diff. eq.
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  * Local headers
30  *----------------------------------------------------------------------------*/
31 
32 #include "cs_base.h"
33 #include "cs_cdo_connect.h"
34 #include "cs_cdo_quantities.h"
35 #include "cs_equation_param.h"
36 #include "cs_field.h"
37 #include "cs_matrix.h"
38 #include "cs_mesh.h"
39 #include "cs_source_term.h"
40 #include "cs_time_step.h"
41 
42 /*----------------------------------------------------------------------------*/
43 
45 
46 /*============================================================================
47  * Macro definitions
48  *============================================================================*/
49 
50 /*============================================================================
51  * Type definitions
52  *============================================================================*/
53 
54 /* Algebraic system for CDO vertex-based discretization */
55 typedef struct _cs_cdovb_scaleq_t cs_cdovb_scaleq_t;
56 
57 /*============================================================================
58  * Public function prototypes
59  *============================================================================*/
60 
61 /*----------------------------------------------------------------------------*/
69 /*----------------------------------------------------------------------------*/
70 
71 void
73  const cs_cdo_connect_t *connect,
74  const cs_time_step_t *time_step);
75 
76 /*----------------------------------------------------------------------------*/
81 /*----------------------------------------------------------------------------*/
82 
83 void
85 
86 /*----------------------------------------------------------------------------*/
91 /*----------------------------------------------------------------------------*/
92 
93 void
95 
96 /*----------------------------------------------------------------------------*/
105 /*----------------------------------------------------------------------------*/
106 
107 void *
109  const cs_mesh_t *mesh);
110 
111 /*----------------------------------------------------------------------------*/
119 /*----------------------------------------------------------------------------*/
120 
121 void *
122 cs_cdovb_scaleq_free(void *builder);
123 
124 /*----------------------------------------------------------------------------*/
131 /*----------------------------------------------------------------------------*/
132 
133 void
134 cs_cdovb_scaleq_monitor(const char *eqname,
135  const void *builder);
136 
137 /*----------------------------------------------------------------------------*/
143 /*----------------------------------------------------------------------------*/
144 
145 void
146 cs_cdovb_scaleq_compute_source(void *builder);
147 
148 /*----------------------------------------------------------------------------*/
158 /*----------------------------------------------------------------------------*/
159 
160 void
162  cs_matrix_t **system_matrix,
163  cs_real_t **system_rhs);
164 
165 /*----------------------------------------------------------------------------*/
178 /*----------------------------------------------------------------------------*/
179 
180 void
182  const cs_real_t *field_val,
183  double dt_cur,
184  void *builder,
185  cs_real_t *rhs,
187 
188 /*----------------------------------------------------------------------------*/
198 /*----------------------------------------------------------------------------*/
199 
200 void
202  const cs_real_t *rhs,
203  void *builder,
204  cs_real_t *field_val);
205 
206 /*----------------------------------------------------------------------------*/
217 /*----------------------------------------------------------------------------*/
218 
219 void
221  const cs_real_t *pdi,
222  int ml_id,
223  void *builder,
224  double *diff_flux,
225  double *conv_flux);
226 
227 /*----------------------------------------------------------------------------*/
236 /*----------------------------------------------------------------------------*/
237 
238 void
240  void *builder,
241  cs_flag_t location,
242  cs_real_t *diff_flux);
243 
244 /*----------------------------------------------------------------------------*/
252 /*----------------------------------------------------------------------------*/
253 
254 void
255 cs_cdovb_scaleq_extra_op(const char *eqname,
256  const cs_field_t *field,
257  void *builder);
258 
259 /*----------------------------------------------------------------------------*/
260 
262 
263 #endif /* __CS_CDOVB_SCALEQ_H__ */
time step descriptor
Definition: cs_time_step.h:51
void cs_cdovb_scaleq_finalize(void)
Free work buffer and general structure related to CDO vertex-based schemes.
Definition: cs_cdovb_scaleq.c:436
void cs_cdovb_scaleq_initialize_system(void *builder, cs_matrix_t **system_matrix, cs_real_t **system_rhs)
Create the matrix of the current algebraic system. Allocate and initialize the right-hand side associ...
Definition: cs_cdovb_scaleq.c:958
Field descriptor.
Definition: cs_field.h:124
Definition: cs_equation_param.h:100
void cs_cdovb_scaleq_build_system(const cs_mesh_t *mesh, const cs_real_t *field_val, double dt_cur, void *builder, cs_real_t *rhs, cs_matrix_t *matrix)
Build the linear system arising from a scalar convection/diffusion equation with a CDO vertex-based s...
Definition: cs_cdovb_scaleq.c:1000
#define BEGIN_C_DECLS
Definition: cs_defs.h:451
void cs_cdovb_scaleq_update_field(const cs_real_t *solu, const cs_real_t *rhs, void *builder, cs_real_t *field_val)
Store solution(s) of the linear system into a field structure Update extra-field values if required (...
Definition: cs_cdovb_scaleq.c:1355
void cs_cdovb_scaleq_initialize(void)
Allocate work buffer and general structures related to CDO vertex-based schemes.
Definition: cs_cdovb_scaleq.c:384
Definition: cs_cdo_connect.h:56
Definition: field.f90:27
void * cs_cdovb_scaleq_free(void *builder)
Destroy a cs_cdovb_scaleq_t structure.
Definition: cs_cdovb_scaleq.c:799
double cs_real_t
Floating-point value.
Definition: cs_defs.h:297
Definition: cs_cdo_quantities.h:102
void matrix(const int *iconvp, const int *idiffp, const int *ndircp, const int *isym, const cs_real_t *thetap, const int *imucpp, const cs_real_t coefbp[], const cs_real_t cofbfp[], const cs_real_t rovsdt[], const cs_real_t i_massflux[], const cs_real_t b_massflux[], const cs_real_t i_visc[], const cs_real_t b_visc[], const cs_real_t xcpp[], cs_real_t da[], cs_real_t xa[])
Definition: cs_matrix_building.c:111
struct _cs_matrix_t cs_matrix_t
Definition: cs_matrix.h:90
Definition: cs_mesh.h:63
void cs_cdovb_scaleq_cellwise_diff_flux(const cs_real_t *values, void *builder, cs_flag_t location, cs_real_t *diff_flux)
Cellwise computation of the diffusive flux.
Definition: cs_cdovb_scaleq.c:1555
void cs_cdovb_scaleq_extra_op(const char *eqname, const cs_field_t *field, void *builder)
Predefined extra-operations related to this equation.
Definition: cs_cdovb_scaleq.c:1770
void cs_cdovb_scaleq_compute_flux_across_plane(const cs_real_t direction[], const cs_real_t *pdi, int ml_id, void *builder, double *diff_flux, double *conv_flux)
Compute the diffusive and convective flux across a list of faces.
Definition: cs_cdovb_scaleq.c:1388
#define END_C_DECLS
Definition: cs_defs.h:452
unsigned short int cs_flag_t
Definition: cs_defs.h:299
void cs_cdovb_scaleq_monitor(const char *eqname, const void *builder)
Display information related to the monitoring of the current system.
Definition: cs_cdovb_scaleq.c:835
void * cs_cdovb_scaleq_init(const cs_equation_param_t *eqp, const cs_mesh_t *mesh)
Initialize a cs_cdovb_scaleq_t structure.
Definition: cs_cdovb_scaleq.c:470
void cs_cdovb_scaleq_compute_source(void *builder)
Compute the contributions of source terms (store inside builder)
Definition: cs_cdovb_scaleq.c:855
Definition: mesh.f90:26
void cs_cdovb_scaleq_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 from the main domain members.
Definition: cs_cdovb_scaleq.c:366