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-2016 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_time_step.h"
34 #include "cs_mesh.h"
35 #include "cs_field.h"
36 #include "cs_cdo_connect.h"
37 #include "cs_cdo_quantities.h"
38 #include "cs_equation_param.h"
39 #include "cs_source_term.h"
40 
41 /*----------------------------------------------------------------------------*/
42 
44 
45 /*============================================================================
46  * Macro definitions
47  *============================================================================*/
48 
49 /*============================================================================
50  * Type definitions
51  *============================================================================*/
52 
53 /* Algebraic system for CDO vertex-based discretization */
54 typedef struct _cs_cdovb_scaleq_t cs_cdovb_scaleq_t;
55 
56 /*============================================================================
57  * Public function prototypes
58  *============================================================================*/
59 
60 /*----------------------------------------------------------------------------*/
68 /*----------------------------------------------------------------------------*/
69 
70 void
72  const cs_cdo_connect_t *connect,
73  const cs_time_step_t *time_step);
74 
75 /*----------------------------------------------------------------------------*/
80 /*----------------------------------------------------------------------------*/
81 
82 void
84 
85 /*----------------------------------------------------------------------------*/
90 /*----------------------------------------------------------------------------*/
91 
92 void
94 
95 /*----------------------------------------------------------------------------*/
102 /*----------------------------------------------------------------------------*/
103 
104 cs_real_t *
106 
107 /*----------------------------------------------------------------------------*/
116 /*----------------------------------------------------------------------------*/
117 
118 void *
120  const cs_mesh_t *mesh);
121 
122 /*----------------------------------------------------------------------------*/
130 /*----------------------------------------------------------------------------*/
131 
132 void *
133 cs_cdovb_scaleq_free(void *builder);
134 
135 /*----------------------------------------------------------------------------*/
142 /*----------------------------------------------------------------------------*/
143 
144 void
145 cs_cdovb_scaleq_free_sysmat(void *builder,
147 
148 /*----------------------------------------------------------------------------*/
154 /*----------------------------------------------------------------------------*/
155 
156 void
157 cs_cdovb_scaleq_compute_source(void *builder);
158 
159 /*----------------------------------------------------------------------------*/
172 /*----------------------------------------------------------------------------*/
173 
174 void
176  const cs_real_t *field_val,
177  double dt_cur,
178  void *builder,
179  cs_real_t **rhs,
180  cs_sla_matrix_t **sla_mat);
181 
182 /*----------------------------------------------------------------------------*/
192 /*----------------------------------------------------------------------------*/
193 
194 void
196  const cs_real_t *rhs,
197  void *builder,
198  cs_real_t *field_val);
199 
200 /*----------------------------------------------------------------------------*/
211 /*----------------------------------------------------------------------------*/
212 
213 void
215  const cs_real_t *pdi,
216  int ml_id,
217  const cs_real_t direction[],
218  double *diff_flux,
219  double *conv_flux);
220 
221 /*----------------------------------------------------------------------------*/
229 /*----------------------------------------------------------------------------*/
230 
231 void
233  void *builder,
234  cs_real_t *diff_flux);
235 
236 /*----------------------------------------------------------------------------*/
244 /*----------------------------------------------------------------------------*/
245 
246 void
247 cs_cdovb_scaleq_extra_op(const char *eqname,
248  const cs_field_t *field,
249  void *builder);
250 
251 /*----------------------------------------------------------------------------*/
252 
254 
255 #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:757
Field descriptor.
Definition: cs_field.h:121
Definition: cs_equation_param.h:102
#define BEGIN_C_DECLS
Definition: cs_defs.h:448
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:1479
void cs_cdovb_scaleq_initialize(void)
Allocate work buffer and general structures related to CDO vertex-based schemes.
Definition: cs_cdovb_scaleq.c:739
Definition: cs_cdo_connect.h:67
Definition: field.f90:27
void * cs_cdovb_scaleq_free(void *builder)
Destroy a cs_cdovb_scaleq_t structure.
Definition: cs_cdovb_scaleq.c:1009
double cs_real_t
Floating-point value.
Definition: cs_defs.h:296
Definition: cs_cdo_quantities.h:100
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
Definition: cs_sla.h:86
Definition: cs_mesh.h:62
void cs_cdovb_scaleq_compute_flux_across_plane(const void *builder, const cs_real_t *pdi, int ml_id, const cs_real_t direction[], double *diff_flux, double *conv_flux)
Compute the diffusive and convective flux across a list of faces.
Definition: cs_cdovb_scaleq.c:1529
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_sla_matrix_t **sla_mat)
Build the linear system arising from a scalar convection/diffusion equation with a CDO vertex-based s...
Definition: cs_cdovb_scaleq.c:1185
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:1810
cs_real_t * cs_cdovb_scaleq_get_tmpbuf(void)
Retrieve a pointer to a temporary buffer related to scalar equations discretized with CDO vertex-base...
void cs_cdovb_scaleq_cellwise_diff_flux(const cs_real_t *values, void *builder, cs_real_t *diff_flux)
Cellwise computation of the diffusive flux across all dual faces.
Definition: cs_cdovb_scaleq.c:1669
#define END_C_DECLS
Definition: cs_defs.h:449
void cs_cdovb_scaleq_free_sysmat(void *builder, cs_sla_matrix_t *matrix)
Destroy a cs_sla_matrix_t related to the system to solve.
Definition: cs_cdovb_scaleq.c:1074
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:778
void cs_cdovb_scaleq_compute_source(void *builder)
Compute the contributions of source terms (store inside builder)
Definition: cs_cdovb_scaleq.c:1092
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:721