programmer's documentation
cs_cdovcb_scaleq.h
Go to the documentation of this file.
1 #ifndef __CS_CDOVCB_SCALEQ_H__
2 #define __CS_CDOVCB_SCALEQ_H__
3 
4 /*============================================================================
5  * Build an algebraic CDO vertex+cell-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_cdovcb_scaleq_t cs_cdovcb_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_cdovcb_scaleq_free(void *builder);
134 
135 /*----------------------------------------------------------------------------*/
142 /*----------------------------------------------------------------------------*/
143 
144 void
145 cs_cdovcb_scaleq_free_sysmat(void *builder,
147 
148 /*----------------------------------------------------------------------------*/
154 /*----------------------------------------------------------------------------*/
155 
156 void
157 cs_cdovcb_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 /*----------------------------------------------------------------------------*/
210 /*----------------------------------------------------------------------------*/
211 
212 double *
213 cs_cdovcb_scaleq_get_cell_values(const void *builder);
214 
215 /*----------------------------------------------------------------------------*/
226 /*----------------------------------------------------------------------------*/
227 
228 void
230  const cs_real_t *pdi,
231  int ml_id,
232  const cs_real_t direction[],
233  double *diff_flux,
234  double *conv_flux);
235 
236 /*----------------------------------------------------------------------------*/
244 /*----------------------------------------------------------------------------*/
245 
246 void
248  void *builder,
249  cs_real_t *diff_flux);
250 
251 /*----------------------------------------------------------------------------*/
259 /*----------------------------------------------------------------------------*/
260 
261 void
262 cs_cdovcb_scaleq_extra_op(const char *eqname,
263  const cs_field_t *field,
264  void *builder);
265 
266 /*----------------------------------------------------------------------------*/
267 
269 
270 #endif /* __CS_CDOVCB_SCALEQ_H__ */
time step descriptor
Definition: cs_time_step.h:51
void cs_cdovcb_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_cdovcb_scaleq.c:710
void cs_cdovcb_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_cdovcb_scaleq.c:1537
void cs_cdovcb_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_cdovcb_scaleq.c:1712
void cs_cdovcb_scaleq_compute_source(void *builder)
Compute the contributions of source terms (store inside builder)
Definition: cs_cdovcb_scaleq.c:1085
Field descriptor.
Definition: cs_field.h:121
void * cs_cdovcb_scaleq_init(const cs_equation_param_t *eqp, const cs_mesh_t *mesh)
Initialize a cs_cdovcb_scaleq_t structure.
Definition: cs_cdovcb_scaleq.c:789
Definition: cs_equation_param.h:102
#define BEGIN_C_DECLS
Definition: cs_defs.h:448
void cs_cdovcb_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_cdovcb_scaleq.c:1469
Definition: cs_cdo_connect.h:67
void * cs_cdovcb_scaleq_free(void *builder)
Destroy a cs_cdovcb_scaleq_t structure.
Definition: cs_cdovcb_scaleq.c:999
Definition: field.f90:27
void cs_cdovcb_scaleq_initialize(void)
Allocate work buffer and general structures related to CDO vertex+cell-based schemes.
Definition: cs_cdovcb_scaleq.c:728
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
cs_real_t * cs_cdovcb_scaleq_get_tmpbuf(void)
Retrieve a pointer to a temporary buffer related to scalar equations discretized with CDO vertex-base...
void cs_cdovcb_scaleq_extra_op(const char *eqname, const cs_field_t *field, void *builder)
Predefined extra-operations related to this equation.
Definition: cs_cdovcb_scaleq.c:1787
void cs_cdovcb_scaleq_free_sysmat(void *builder, cs_sla_matrix_t *matrix)
Destroy a cs_sla_matrix_t related to the system to solve.
Definition: cs_cdovcb_scaleq.c:1061
void cs_cdovcb_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_cdovcb_scaleq.c:1160
#define END_C_DECLS
Definition: cs_defs.h:449
void cs_cdovcb_scaleq_finalize(void)
Free buffers and generic structures related to CDO vertex+cell-based schemes.
Definition: cs_cdovcb_scaleq.c:764
double * cs_cdovcb_scaleq_get_cell_values(const void *builder)
Get the computed values at cell centers (DoF used in the linear system are located at primal vertices...
Definition: cs_cdovcb_scaleq.c:1513
Definition: mesh.f90:26