8.1
general documentation
cs_prototypes.h
Go to the documentation of this file.
1 #ifndef __CS_PROTOTYPES_H__
2 #define __CS_PROTOTYPES_H__
3 
4 /*============================================================================
5  * Prototypes for Fortran functions and subroutines callable from C
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_domain.h"
36 #include "cs_field.h"
37 #include "cs_mesh.h"
38 #include "cs_mesh_quantities.h"
39 #include "cs_mesh_bad_cells.h"
40 #include "cs_probe.h"
41 #include "cs_time_control.h"
42 #include "cs_volume_zone.h"
43 
44 /*----------------------------------------------------------------------------*/
45 
47 
48 /*============================================================================
49  * Macro definitions
50  *============================================================================*/
51 
52 /*=============================================================================
53  * Fortran function/subroutine prototypes
54  *============================================================================*/
55 
56 /*----------------------------------------------------------------------------
57  * Main Fortran subroutine
58  *----------------------------------------------------------------------------*/
59 
60 extern void CS_PROCF (caltri, CALTRI)
61 (
62  void
63 );
64 
65 /*----------------------------------------------------------------------------
66  * Convert gas temperature to and from enthalpy based on concentrations
67  *----------------------------------------------------------------------------*/
68 
69 extern void CS_PROCF (cpthp1, CPTHP1)
70 (
71  const int *mode, /* <-- 1: h to t, 2: t to h */
72  cs_real_t *eh, /* <-> enthalpy of gas mix */
73  cs_real_t *xesp, /* <-- mas fraction of species */
74  cs_real_t *f1mc, /* <-- mean f1 */
75  cs_real_t *f2mc, /* <-- mean f2 */
76  cs_real_t *tp /* <-- gas temperature (K) */
77 );
78 
79 /*----------------------------------------------------------------------------
80  * Initialize Fortran base common block values
81  *----------------------------------------------------------------------------*/
82 
83 extern void CS_PROCF (csinit, CSINIT)
84 (
85  const int *irgpar, /* <-- MPI Rank in parallel, -1 otherwise */
86  const int *nrgpar /* <-- Number of MPI processes, or 1 */
87 );
88 
89 /*----------------------------------------------------------------------------
90  * Find the nearest cell's center from a node
91  *----------------------------------------------------------------------------*/
92 
93 extern void CS_PROCF (findpt, FINDPT)
94 (
95  const cs_lnum_t *ncelet, /* <-- number of extended (real + ghost) cells */
96  const cs_lnum_t *ncel, /* <-- number of cells */
97  const cs_real_t *xyzcen, /* <-- cell centers */
98  const cs_real_t *xx, /* <-- node coordinate X */
99  const cs_real_t *yy, /* <-- node coordinate Y */
100  const cs_real_t *zz, /* <-- node coordinate Z */
101  cs_lnum_t *node, /* --> node we are looking for, zero if error */
102  int *ndrang /* --> rank of associated process */
103 );
104 
105 /*----------------------------------------------------------------------------
106  * Main Fortran options initialization
107  *----------------------------------------------------------------------------*/
108 
109 extern void CS_PROCF (initi1, INITI1)
110 (
111  void
112 );
113 
114 /*----------------------------------------------------------------------------
115  * Add field indexes associated with a new non-user solved variable,
116  * with default options
117  *
118  * parameters:
119  * f_id <-- field id
120  *
121  * returns:
122  * scalar number for defined field
123  *----------------------------------------------------------------------------*/
124 
125 int
127 
128 /*----------------------------------------------------------------------------
129  * Add field indexes associated with a new solved thermal variable,
130  * with default options
131  *
132  * parameters:
133  * f_id <-- field id
134  *----------------------------------------------------------------------------*/
135 
136 void
138 
139 /*----------------------------------------------------------------------------
140  * Computes the explicit chemical source term for atmospheric chemistry in
141  * case of a semi-coupled resolution
142  *----------------------------------------------------------------------------*/
143 
144 void
146  cs_real_t st_exp[],
147  cs_real_t st_imp[]);
148 
149 /*----------------------------------------------------------------------------*/
154 /*----------------------------------------------------------------------------*/
155 
156 void
158 
159 /*----------------------------------------------------------------------------*/
182 /*----------------------------------------------------------------------------*/
183 
184 void
186  const cs_real_t voidf[]);
187 
188 /*----------------------------------------------------------------------------*/
197 /*----------------------------------------------------------------------------*/
198 
199 void
201  cs_real_t dt[],
202  cs_real_t vela[][3]);
203 
204 /*----------------------------------------------------------------------------*/
214 /*----------------------------------------------------------------------------*/
215 
216 void
218  const cs_lnum_t face_ids[],
219  const cs_real_t t[],
220  cs_real_t h[]);
221 
222 /*----------------------------------------------------------------------------*/
232 /*----------------------------------------------------------------------------*/
233 
234 void
235 cs_coal_thfieldconv1(int location_id,
236  const cs_real_t eh[],
237  cs_real_t tp[]);
238 
239 /*----------------------------------------------------------------------------*/
249 /*----------------------------------------------------------------------------*/
250 
251 void
253  const cs_real_t dt[],
254  cs_real_t imasfl[],
255  cs_real_t bmasf[],
256  cs_real_t divflu[]);
257 
258 /*----------------------------------------------------------------------------*/
264 /*----------------------------------------------------------------------------*/
265 
266 cs_real_t *
268 
269 /*----------------------------------------------------------------------------*/
275 /*----------------------------------------------------------------------------*/
276 
277 cs_real_t *
279 
280 /*----------------------------------------------------------------------------*/
289 /*----------------------------------------------------------------------------*/
290 
291 void
293  int iterns);
294 
295 /*----------------------------------------------------------------------------
296  * Return Lagrangian model status.
297  *
298  * parameters:
299  * model_flag --> 0 without Lagrangian, 1 or 2 with Lagrangian
300  * restart_flag --> 1 for Lagrangian restart, 0 otherwise
301  * frozen_flag --> 1 for frozen Eulerian flow, 0 otherwise
302  *----------------------------------------------------------------------------*/
303 
304 void
305 cs_lagr_status(int *model_flag,
306  int *restart_flag,
307  int *frozen_flag);
308 
309 /*----------------------------------------------------------------------------*/
313 /*----------------------------------------------------------------------------*/
314 
315 void
317 
318 /*----------------------------------------------------------------------------*/
337 /*----------------------------------------------------------------------------*/
338 
339 void
341 
342 /*----------------------------------------------------------------------------
343  * Compute source terms for specific physical model scalars.
344  *----------------------------------------------------------------------------*/
345 
346 void
348  cs_real_t st_imp[],
349  cs_real_t st_exp[]);
350 
351 /*----------------------------------------------------------------------------*/
372 /*----------------------------------------------------------------------------*/
373 
374 void
376  cs_lnum_t icetsm[],
377  cs_real_t dt[]);
378 
379 /*----------------------------------------------------------------------------*/
383 /*----------------------------------------------------------------------------*/
384 
385 void
387 
388 /*----------------------------------------------------------------------------
389  * Exchange of coupling variables between tow instances
390  * of code_saturne thanks to cells.
391  *----------------------------------------------------------------------------*/
392 
393 void
395  cs_real_t st_exp[],
396  cs_real_t st_imp[]);
397 
398 /*----------------------------------------------------------------------------*/
427 /*----------------------------------------------------------------------------*/
428 
429 void
431  cs_real_t secvib[]);
432 
433 /*----------------------------------------------------------------------------*/
438 /*----------------------------------------------------------------------------*/
439 
440 void
442 
443 /*----------------------------------------------------------------------------*/
449 /*----------------------------------------------------------------------------*/
450 
451 void
453 
454 /*============================================================================
455  * User function prototypes
456  *============================================================================*/
457 
458 /*----------------------------------------------------------------------------
459  * Data Entry of the 1D wall thermal module.
460  *----------------------------------------------------------------------------*/
461 
462 void
463 cs_user_1d_wall_thermal(int iappel,
464  int isuit1);
465 
466 /*----------------------------------------------------------------------------
467  * Data Entry of the wall condensation module
468  *----------------------------------------------------------------------------*/
469 
470 void
472  int nscal,
473  int iappel);
474 
475 /*----------------------------------------------------------------------------
476  * Setup boundary conditions to be applied.
477  *----------------------------------------------------------------------------*/
478 
479 void
481 
482 /*----------------------------------------------------------------------------
483  * This function is called at each time step for boundary conditions.
484  *----------------------------------------------------------------------------*/
485 
486 void
488  int bc_type[]);
489 
490 /*----------------------------------------------------------------------------
491  * Boundary conditions for (Arbitrary Lagrangian Eulerian).
492  *----------------------------------------------------------------------------*/
493 
494 void
496  int bc_type[],
497  int ale_bc_type[],
498  int impale[]);
499 
500 /*----------------------------------------------------------------------------*/
512 /*----------------------------------------------------------------------------*/
513 
514 void
516 
517 /*----------------------------------------------------------------------------*/
526 /*----------------------------------------------------------------------------*/
527 
528 void
530 
531 /*----------------------------------------------------------------------------*/
540 /*----------------------------------------------------------------------------*/
541 
542 void
544 
545 /*----------------------------------------------------------------------------*/
568 /*----------------------------------------------------------------------------*/
569 
570 void
571 cs_user_fsi_structure_define(int is_restart,
572  int n_structs,
573  int *plot,
574  cs_time_control_t *plot_time_control,
575  cs_real_t *aexxst,
576  cs_real_t *bexxst,
577  cs_real_t *cfopre,
578  cs_real_t xstr0[][3],
579  cs_real_t vstr0[][3],
580  cs_real_t xstreq[][3]);
581 
582 /*----------------------------------------------------------------------------*/
597 /*----------------------------------------------------------------------------*/
598 
599 void
600 cs_user_fsi_structure_values(int n_structs,
601  const cs_time_step_t *ts,
602  const cs_real_t xstreq[][3],
603  const cs_real_t xstr[][3],
604  const cs_real_t vstr[][3],
605  cs_real_t xmstru[][3][3],
606  cs_real_t xcstru[][3][3],
607  cs_real_t xkstru[][3][3],
608  cs_real_t forstr[][3],
609  cs_real_t dtstr[]);
610 
611 /*----------------------------------------------------------------------------*/
624 /*----------------------------------------------------------------------------*/
625 
626 void
628  int structure_num[]);
629 
630 /*----------------------------------------------------------------------------*/
640 /*----------------------------------------------------------------------------*/
641 
642 void
643 cs_user_head_losses(const cs_zone_t *zone,
644  cs_real_t cku[][6]);
645 
646 /*----------------------------------------------------------------------------*/
652 /*----------------------------------------------------------------------------*/
653 
654 void
656 
657 /*----------------------------------------------------------------------------*/
663 /*----------------------------------------------------------------------------*/
664 
665 void
667 
668 /*----------------------------------------------------------------------------*/
677 /*----------------------------------------------------------------------------*/
678 
679 void
681 
682 /*----------------------------------------------------------------------------*/
691 /*----------------------------------------------------------------------------*/
692 
693 void
695 
696 /*----------------------------------------------------------------------------*/
702 /*----------------------------------------------------------------------------*/
703 
704 void
706 
707 /*----------------------------------------------------------------------------*/
725 /*----------------------------------------------------------------------------*/
726 
727 void
729  const cs_zone_t *z,
730  bool z_local,
731  const cs_real_t h[restrict],
732  cs_real_t t[restrict]);
733 
734 /*----------------------------------------------------------------------------*/
752 /*----------------------------------------------------------------------------*/
753 
754 void
756  const cs_zone_t *z,
757  bool z_local,
758  const cs_real_t t[restrict],
759  cs_real_t h[restrict]);
760 
761 /*----------------------------------------------------------------------------*/
774 /*----------------------------------------------------------------------------*/
775 
776 void
778 
779 /*----------------------------------------------------------------------------*/
785 /*----------------------------------------------------------------------------*/
786 
787 void
789 
790 /*----------------------------------------------------------------------------*/
800 /*----------------------------------------------------------------------------*/
801 
802 void
804  int f_id,
805  cs_real_t *st_exp,
806  cs_real_t *st_imp);
807 
808 /*----------------------------------------------------------------------------*/
818 /*----------------------------------------------------------------------------*/
819 
820 void
822 
823 /*----------------------------------------------------------------------------
824  * Define mesh joinings.
825  *----------------------------------------------------------------------------*/
826 
827 void
828 cs_user_join(void);
829 
830 /*----------------------------------------------------------------------------
831  * Define linear solver options.
832  *
833  * This function is called at the setup stage, once user and most model-based
834  * fields are defined.
835  *----------------------------------------------------------------------------*/
836 
837 void
839 
840 /*----------------------------------------------------------------------------*/
846 /*----------------------------------------------------------------------------*/
847 
848 void
850 
851 /*----------------------------------------------------------------------------
852  * Tag bad cells within the mesh based on geometric criteria.
853  *----------------------------------------------------------------------------*/
854 
855 void
857  cs_mesh_quantities_t *mesh_quantities);
858 
859 /*----------------------------------------------------------------------------
860  * Define restart mode for mesh input and preprocessing.
861  *----------------------------------------------------------------------------*/
862 
863 void
865 
866 /*----------------------------------------------------------------------------
867  * Define mesh files to read and optional associated transformations.
868  *----------------------------------------------------------------------------*/
869 
870 void
871 cs_user_mesh_input(void);
872 
873 /*----------------------------------------------------------------------------
874  * Modifiy geometry and mesh.
875  *----------------------------------------------------------------------------*/
876 
877 void
879 
880 /*----------------------------------------------------------------------------
881  * Insert boundary wall into a mesh.
882  *----------------------------------------------------------------------------*/
883 
884 void
886 
887 /*----------------------------------------------------------------------------
888  * Mesh smoothing.
889  *
890  * parameters:
891  * mesh <-> pointer to mesh structure to smoothe
892  *----------------------------------------------------------------------------*/
893 
894 void
896 
897 /*----------------------------------------------------------------------------
898  * Enable or disable mesh saving.
899  *
900  * By default, mesh is saved when modified.
901  *
902  * parameters:
903  * mesh <-> pointer to mesh structure
904  *----------------------------------------------------------------------------*/
905 
906 void
908 
909 /*----------------------------------------------------------------------------
910  * Set options for cutting of warped faces
911  *
912  * parameters:
913  * mesh <-> pointer to mesh structure to smoothe
914  *----------------------------------------------------------------------------*/
915 
916 void
918 
919 /*----------------------------------------------------------------------------*/
927 /*----------------------------------------------------------------------------*/
928 
929 void
931  cs_mesh_quantities_t *mesh_quantities);
932 
933 /*----------------------------------------------------------------------------*/
937 /*----------------------------------------------------------------------------*/
938 
939 void
941 
942 /*----------------------------------------------------------------------------
943  * Select physical model options, including user fields.
944  *
945  * This function is called at the earliest stages of the data setup.
946  *----------------------------------------------------------------------------*/
947 
948 void
949 cs_user_model(void);
950 
951 /*----------------------------------------------------------------------------
952  * Define advanced mesh numbering options.
953  *----------------------------------------------------------------------------*/
954 
955 void
956 cs_user_numbering(void);
957 
958 /*----------------------------------------------------------------------------
959  * Define parallel IO settings.
960  *----------------------------------------------------------------------------*/
961 
962 void
963 cs_user_parallel_io(void);
964 
965 /*----------------------------------------------------------------------------
966  * Define advanced partitioning options.
967  *----------------------------------------------------------------------------*/
968 
969 void
970 cs_user_partition(void);
971 
972 /*----------------------------------------------------------------------------
973  * Define sparse matrix tuning options.
974  *----------------------------------------------------------------------------*/
975 
976 void
978 
979 /*----------------------------------------------------------------------------
980  * Define or modify general numerical and physical user parameters.
981  *
982  * At the calling point of this function, most model-related most variables
983  * and other fields have been defined, so specific settings related to those
984  * fields may be set here.
985  *----------------------------------------------------------------------------*/
986 
987 void
989 
990 /*----------------------------------------------------------------------------
991  * User function for input of radiative transfer module options.
992  *----------------------------------------------------------------------------*/
993 
994 void
996 
997 /*-----------------------------------------------------------------------------
998  * User subroutine for input of radiative transfer boundary conditions
999  *----------------------------------------------------------------------------*/
1000 
1001 void
1003  const int bc_type[],
1004  int isothp[],
1005  cs_real_t *tmin,
1006  cs_real_t *tmax,
1007  cs_real_t *tx,
1008  const cs_real_t dt[],
1009  const cs_real_t thwall[],
1010  const cs_real_t qincid[],
1011  cs_real_t hfcnvp[],
1012  cs_real_t flcnvp[],
1013  cs_real_t xlamp[],
1014  cs_real_t epap[],
1015  cs_real_t epsp[],
1016  cs_real_t textp[]);
1017 
1018 /*----------------------------------------------------------------------------
1019  * Define periodic faces.
1020  *----------------------------------------------------------------------------*/
1021 
1022 void
1023 cs_user_periodicity(void);
1024 
1025 /*----------------------------------------------------------------------------
1026  * Define post-processing writers.
1027  *
1028  * The default output format and frequency may be configured, and additional
1029  * post-processing writers allowing outputs in different formats or with
1030  * different format options and output frequency than the main writer may
1031  * be defined.
1032  *----------------------------------------------------------------------------*/
1033 
1034 void
1036 
1037 /*-----------------------------------------------------------------------------
1038  * Define monitoring probes and profiles. A profile is seen as a set of probes.
1039  *----------------------------------------------------------------------------*/
1040 
1041 void
1043 
1044 /*----------------------------------------------------------------------------
1045  * Define post-processing meshes.
1046  *
1047  * The main post-processing meshes may be configured, and additional
1048  * post-processing meshes may be defined as a subset of the main mesh's
1049  * cells or faces (both interior and boundary).
1050  *----------------------------------------------------------------------------*/
1051 
1052 void
1054 
1055 /*----------------------------------------------------------------------------
1056  * User function for output of values on a post-processing mesh.
1057  *----------------------------------------------------------------------------*/
1058 
1059 void
1060 cs_user_postprocess_values(const char *mesh_name,
1061  int mesh_id,
1062  int cat_id,
1063  cs_probe_set_t *probes,
1064  cs_lnum_t n_cells,
1065  cs_lnum_t n_i_faces,
1066  cs_lnum_t n_b_faces,
1067  cs_lnum_t n_vertices,
1068  const cs_lnum_t cell_list[],
1069  const cs_lnum_t i_face_list[],
1070  const cs_lnum_t b_face_list[],
1071  const cs_lnum_t vertex_list[],
1072  const cs_time_step_t *ts);
1073 
1074 /*----------------------------------------------------------------------------
1075  * Override default frequency or calculation end based output.
1076  *
1077  * This allows fine-grained control of activation or deactivation,
1078  *
1079  * parameters:
1080  * nt_max_abs <-- maximum time step number
1081  * nt_cur_abs <-- current time step number
1082  * t_cur_abs <-- absolute time at the current time step
1083  *----------------------------------------------------------------------------*/
1084 
1085 void
1086 cs_user_postprocess_activate(int nt_max_abs,
1087  int nt_cur_abs,
1088  double t_cur_abs);
1089 
1090 /*----------------------------------------------------------------------------
1091  * Absorption coefficient for radiative module
1092  *----------------------------------------------------------------------------*/
1093 
1094 void
1095 cs_user_rad_transfer_absorption(const int bc_type[],
1096  cs_real_t ck[]);
1097 
1098 /*----------------------------------------------------------------------------
1099  * Compute the net radiation flux
1100  *----------------------------------------------------------------------------*/
1101 
1102 void
1104  const cs_real_t coefap[],
1105  const cs_real_t coefbp[],
1106  const cs_real_t cofafp[],
1107  const cs_real_t cofbfp[],
1108  const cs_real_t twall[],
1109  const cs_real_t qincid[],
1110  const cs_real_t xlam[],
1111  const cs_real_t epa[],
1112  const cs_real_t eps[],
1113  const cs_real_t ck[],
1114  cs_real_t net_flux[]);
1115 
1116 /*----------------------------------------------------------------------------
1117  * Set user solver.
1118  *----------------------------------------------------------------------------*/
1119 
1120 int
1121 cs_user_solver_set(void);
1122 
1123 /*----------------------------------------------------------------------------
1124  * Main call to user solver.
1125  *----------------------------------------------------------------------------*/
1126 
1127 void
1129  const cs_mesh_quantities_t *mesh_quantities);
1130 
1131 /*----------------------------------------------------------------------------
1132  * Define couplings with other instances of code_saturne.
1133  *----------------------------------------------------------------------------*/
1134 
1135 void
1137 
1138 /*----------------------------------------------------------------------------
1139  * Define couplings with SYRTHES code.
1140  *----------------------------------------------------------------------------*/
1141 
1142 void
1144 
1145 /*----------------------------------------------------------------------------*/
1155 /*----------------------------------------------------------------------------*/
1156 
1157 void
1158 cs_user_syrthes_coupling_volume_h(int coupling_id,
1159  const char *syrthes_name,
1160  cs_lnum_t n_elts,
1161  const cs_lnum_t elt_ids[],
1162  cs_real_t h_vol[]);
1163 
1164 /*----------------------------------------------------------------------------
1165  * Define couplings with CATHARE code.
1166  *----------------------------------------------------------------------------*/
1167 
1168 void
1170 
1171 /*----------------------------------------------------------------------------
1172  * Define time moments.
1173  *----------------------------------------------------------------------------*/
1174 
1175 void
1176 cs_user_time_moments(void);
1177 
1178 
1179 /*----------------------------------------------------------------------------
1180  * Define time tables.
1181  *----------------------------------------------------------------------------*/
1182 
1183 void
1184 cs_user_time_table(void);
1185 
1186 /*----------------------------------------------------------------------------
1187  * Define rotor/stator model.
1188  *----------------------------------------------------------------------------*/
1189 
1190 void
1192 
1193 /*----------------------------------------------------------------------------
1194  * Define rotor axes, associated cells, and rotor/stator faces.
1195  *----------------------------------------------------------------------------*/
1196 
1197 void
1199 
1200 /*----------------------------------------------------------------------------
1201  * Define rotation velocity of rotor.
1202  *----------------------------------------------------------------------------*/
1203 
1204 void
1206 
1207 /*----------------------------------------------------------------------------*/
1211 /*----------------------------------------------------------------------------*/
1212 
1213 void
1214 cs_user_zones(void);
1215 
1216 /*----------------------------------------------------------------------------*/
1220 /*----------------------------------------------------------------------------*/
1221 
1222 void
1224  const cs_mesh_quantities_t *mesh_quantities,
1225  cs_real_t *dt);
1226 
1227 /*----------------------------------------------------------------------------
1228  * Computation of the relaxation time-scale to equilibrium in the frame of
1229  * the homogeneous two-phase model.
1230  *----------------------------------------------------------------------------*/
1231 
1232 void
1234  const cs_real_t *alpha_eq,
1235  const cs_real_t *y_eq,
1236  const cs_real_t *z_eq,
1237  const cs_real_t *ei,
1238  const cs_real_t *v,
1239  cs_real_t *relax_tau);
1240 
1241 /*----------------------------------------------------------------------------*/
1245 /*----------------------------------------------------------------------------*/
1246 
1247 void
1249 
1250 /*----------------------------------------------------------------------------*/
1254 /*----------------------------------------------------------------------------*/
1255 
1256 void
1258 
1259 /*----------------------------------------------------------------------------*/
1263 /*----------------------------------------------------------------------------*/
1264 
1265 void
1267 
1268 /*----------------------------------------------------------------------------*/
1269 
1271 
1272 #endif /* __CS_PROTOTYPES_H__ */
#define restrict
Definition: cs_defs.h:139
#define BEGIN_C_DECLS
Definition: cs_defs.h:514
double cs_real_t
Floating-point value.
Definition: cs_defs.h:319
#define CS_PROCF(x, y)
Definition: cs_defs.h:528
cs_real_t cs_real_3_t[3]
vector of 3 floating-point values
Definition: cs_defs.h:334
#define END_C_DECLS
Definition: cs_defs.h:515
int cs_lnum_t
local mesh entity id
Definition: cs_defs.h:313
@ t
Definition: cs_field_pointer.h:92
@ xlam
Definition: cs_field_pointer.h:182
@ eps
Definition: cs_field_pointer.h:71
@ h
Definition: cs_field_pointer.h:91
@ epa
Definition: cs_field_pointer.h:183
@ dt
Definition: cs_field_pointer.h:65
struct _cs_probe_set_t cs_probe_set_t
Definition: cs_probe.h:53
void cs_user_postprocess_meshes(void)
Define post-processing meshes.
Definition: cs_user_postprocess.c:86
void cs_user_rad_transfer_absorption(const int bc_type[], cs_real_t ck[])
Absorption coefficient for radiative module.
Definition: cs_user_radiative_transfer.c:103
void cs_coal_bt2h(cs_lnum_t n_faces, const cs_lnum_t face_ids[], const cs_real_t t[], cs_real_t h[])
Convert temperature to enthalpy at boundary for coal combustion.
void cs_user_mesh_bad_cells_tag(cs_mesh_t *mesh, cs_mesh_quantities_t *mesh_quantities)
Tag bad cells within the mesh based on user-defined geometric criteria.
Definition: cs_user_mesh.c:219
void cs_user_wall_condensation(int nvar, int nscal, int iappel)
Source terms associated at the boundary faces and the neighboring cells with surface condensation.
Definition: cs_user_wall_condensation.c:169
void cs_user_mesh_boundary(cs_mesh_t *mesh)
Insert boundaries into a mesh.
Definition: cs_user_mesh.c:156
void cs_user_zones(void)
Define volume and surface zones.
Definition: cs_user_zones.c:65
void cs_user_model(void)
Select physical model options, including user fields.
Definition: cs_user_parameters.c:84
void cs_add_model_thermal_field_indexes(int f_id)
void cs_physical_model_source_terms(int iscal, cs_real_t st_imp[], cs_real_t st_exp[])
void cs_user_join(void)
Define mesh joinings.
Definition: cs_user_mesh.c:115
void cs_user_extra_operations_finalize(cs_domain_t *domain)
This function is called at the end of the calculation.
Definition: cs_user_extra_operations.c:122
void cs_lagr_status(int *model_flag, int *restart_flag, int *frozen_flag)
void cs_user_internal_coupling(void)
Define internal coupling options.
Definition: cs_user_parameters.c:162
void cs_user_extra_operations(cs_domain_t *domain)
This function is called at the end of each time step.
Definition: cs_user_extra_operations.c:104
void cs_user_syrthes_coupling_volume_h(int coupling_id, const char *syrthes_name, cs_lnum_t n_elts, const cs_lnum_t elt_ids[], cs_real_t h_vol[])
Compute a volume exchange coefficient for SYRTHES couplings.
Definition: cs_user_coupling.c:114
void cs_user_syrthes_coupling(void)
Define couplings with SYRTHES code.
Definition: cs_user_coupling.c:95
void cs_user_parameters(cs_domain_t *domain)
Define or modify general numerical and physical user parameters.
Definition: cs_user_parameters.c:107
void cs_user_boundary_conditions_ale(cs_domain_t *domain, int bc_type[], int ale_bc_type[], int impale[])
User definition of boundary conditions for ALE.
Definition: cs_user_boundary_conditions.c:177
void cs_user_physical_properties_td_pressure(cs_real_t *td_p)
User function to define a custom law for the thermodynamic pressure.
Definition: cs_user_physical_properties.c:179
void cs_user_physical_properties_turb_viscosity(cs_domain_t *domain)
User modification of the turbulence viscosity.
Definition: cs_user_physical_properties.c:157
void cs_user_boundary_conditions_setup(cs_domain_t *domain)
Set boundary conditions to be applied.
Definition: cs_user_boundary_conditions.c:77
void cs_user_turbomachinery_rotor(void)
Define rotor axes, associated cells, and rotor/stator faces.
Definition: cs_user_turbomachinery.c:90
void cs_field_map_and_init_bcs(void)
Initialize all field BC coefficients.
void cs_user_turbomachinery_set_rotation_velocity(void)
Define rotation velocity of rotor.
Definition: cs_user_turbomachinery.c:103
void cs_user_postprocess_activate(int nt_max_abs, int nt_cur_abs, double t_cur_abs)
Definition: cs_user_postprocess.c:177
void cs_secondary_viscosity(cs_real_t secvif[], cs_real_t secvib[])
Computes the secondary viscosity contribution in order to compute:
void cs_user_linear_solvers(void)
Define linear solver options.
Definition: cs_user_parameters.c:130
void cs_user_periodicity(void)
Define periodic faces.
Definition: cs_user_mesh.c:128
void findpt(const cs_lnum_t *ncelet, const cs_lnum_t *ncel, const cs_real_t *xyzcen, const cs_real_t *xx, const cs_real_t *yy, const cs_real_t *zz, cs_lnum_t *node, int *ndrang)
void initi1(void)
Definition: initi1.f90:29
void cs_user_internal_coupling_from_disjoint_meshes(cs_mesh_t *mesh)
Define volumesi from separated meshes as internal coupling zones.
Definition: cs_internal_coupling.c:2969
void cs_user_scaling_elec(const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities, cs_real_t *dt)
Define scaling parameter for electric model.
Definition: cs_user_electric_scaling.c:75
void cs_user_mesh_cartesian_define(void)
Define a cartesian mesh.
Definition: cs_user_mesh.c:253
void cs_fortran_resize_aux_arrays(void)
resize some Fortran auxiliary arrays
void cs_coal_thfieldconv1(int location_id, const cs_real_t eh[], cs_real_t tp[])
Calculation of the gas temperature Function with the gas enthalpy and concentrations.
void cs_user_mesh_modify(cs_mesh_t *mesh)
Modify geometry and mesh.
Definition: cs_user_mesh.c:171
void cs_mass_flux_prediction(cs_real_t dt[])
Update the convective mass flux before the Navier Stokes equations (prediction and correction steps).
void cs_user_fsi_structure_num(cs_domain_t *domain, int structure_num[])
Define structure numbers for faces associated with internal or external (code_aster) structures.
Definition: cs_user_fluid_structure_interaction.c:174
void cs_user_radiative_transfer_bcs(cs_domain_t *domain, const int bc_type[], int isothp[], cs_real_t *tmin, cs_real_t *tmax, cs_real_t *tx, const cs_real_t dt[], const cs_real_t thwall[], const cs_real_t qincid[], cs_real_t hfcnvp[], cs_real_t flcnvp[], cs_real_t xlamp[], cs_real_t epap[], cs_real_t epsp[], cs_real_t textp[])
User definition of radiative transfer boundary conditions.
Definition: cs_user_radiative_transfer_bcs.c:124
void cs_user_postprocess_probes(void)
Define monitoring probes and profiles.
Definition: cs_user_postprocess.c:101
void cs_user_numbering(void)
Define advanced mesh numbering options.
Definition: cs_user_performance_tuning.c:74
void cs_user_1d_wall_thermal(int iappel, int isuit1)
Definition: cs_user_1d_wall_thermal.c:82
void cs_user_physical_properties_h_to_t(cs_domain_t *domain, const cs_zone_t *z, bool z_local, const cs_real_t h[restrict], cs_real_t t[restrict])
User definition of enthalpy to temperature conversion.
void cs_user_fsi_structure_values(int n_structs, const cs_time_step_t *ts, const cs_real_t xstreq[][3], const cs_real_t xstr[][3], const cs_real_t vstr[][3], cs_real_t xmstru[][3][3], cs_real_t xcstru[][3][3], cs_real_t xkstru[][3][3], cs_real_t forstr[][3], cs_real_t dtstr[])
Time-based settings for internal mobile structures.
Definition: cs_user_fluid_structure_interaction.c:134
void cs_user_time_moments(void)
Define time moments.
Definition: cs_user_parameters.c:147
void cs_atmo_chem_source_terms(int iscal, cs_real_t st_exp[], cs_real_t st_imp[])
void cs_user_radiative_transfer_parameters(void)
User function for input of radiative transfer module options.
Definition: cs_user_radiative_transfer.c:77
int cs_user_solver_set(void)
Set user solver.
Definition: cs_user_solver.c:75
void cs_at_source_term_for_inlet(cs_real_3_t st_exp[])
Additional right-hand side source terms for momentum equation in case of free inlet.
void cs_user_mesh_input(void)
Define mesh files to read and optional associated transformations.
Definition: cs_user_mesh.c:102
void cs_user_time_table(void)
Define time tables using C API. This function is called at the begin of the simulation only.
Definition: cs_user_time_table.c:77
int cs_add_model_field_indexes(int f_id)
void cs_wall_condensation_volume_exchange_surf_at_cells(cs_real_t *surf)
Return condensing volume structures surface at each cell.
Definition: cs_wall_condensation.c:1072
void cs_hydrostatic_pressure_prediction(cs_real_t grdphd[][3], int iterns)
Computes a hydrostatic pressure solving an a priori simplified momentum equation:
void cs_user_mesh_restart_mode(void)
Force preprocessing behavior in case of restart.
Definition: cs_user_mesh.c:89
void cs_user_mesh_save(cs_mesh_t *mesh)
Enable or disable mesh saving.
Definition: cs_user_mesh.c:203
void cs_user_porosity(cs_domain_t *domain)
Compute the porosity (volume factor when the porosity model is activated. (cs_glob_porous_model > 0)...
Definition: cs_user_porosity.c:80
void cs_user_source_terms(cs_domain_t *domain, int f_id, cs_real_t *st_exp, cs_real_t *st_imp)
Additional user-defined source terms for variable equations (momentum, scalars, turbulence....
Definition: cs_user_source_terms.c:155
void cs_compressible_convective_mass_flux(int iterns, cs_real_t dt[], cs_real_t vela[][3])
Solves the continuity equation in pressure formulation and then updates the density and the mass flux...
void cs_user_postprocess_values(const char *mesh_name, int mesh_id, int cat_id, cs_probe_set_t *probes, cs_lnum_t n_cells, cs_lnum_t n_i_faces, cs_lnum_t n_b_faces, cs_lnum_t n_vertices, const cs_lnum_t cell_list[], const cs_lnum_t i_face_list[], const cs_lnum_t b_face_list[], const cs_lnum_t vertex_list[], const cs_time_step_t *ts)
User function for output of values on a post-processing mesh.
Definition: cs_user_postprocess.c:134
void cs_prediction_mass_flux(cs_lnum_t ncesmp, cs_lnum_t icetsm[], cs_real_t dt[])
Update the convective mass flux before the Navier Stokes equations (prediction and correction steps).
void cs_user_matrix_tuning(void)
Define sparse matrix tuning options.
Definition: cs_user_performance_tuning.c:113
void cs_user_paramedmem_define_fields(void)
Define fields to couple with ParaMEDMEM.
Definition: cs_user_paramedmem_coupling.c:108
void cs_user_internal_coupling_add_volumes(cs_mesh_t *mesh)
Define volumes as internal coupling zones.
Definition: cs_internal_coupling.c:2950
void cs_user_mesh_modify_partial(cs_mesh_t *mesh, cs_mesh_quantities_t *mesh_quantities)
Apply partial modifications to the mesh after the preprocessing and initial postprocessing mesh build...
Definition: cs_user_mesh.c:238
void cs_user_physical_properties(cs_domain_t *domain)
This function is called each time step to define physical properties.
Definition: cs_user_physical_properties.c:75
void cs_cavitation_compute_source_term(const cs_real_t pressure[], const cs_real_t voidf[])
Compute the vaporization source term using the Merkle model:
cs_real_t * cs_get_cavitation_gam(void)
Return pointer to cavitation "gamcav" array.
void cs_user_head_losses(const cs_zone_t *zone, cs_real_t cku[][6])
Compute GUI-defined head losses for a given volume zone.
Definition: cs_user_head_losses.c:86
void cs_user_fsi_structure_define(int is_restart, int n_structs, int *plot, cs_time_control_t *plot_time_control, cs_real_t *aexxst, cs_real_t *bexxst, cs_real_t *cfopre, cs_real_t xstr0[][3], cs_real_t vstr0[][3], cs_real_t xstreq[][3])
Definition of internal mobile structures and corresponding initial conditions (initial displacement a...
Definition: cs_user_fluid_structure_interaction.c:92
void cs_user_solver(const cs_mesh_t *mesh, const cs_mesh_quantities_t *mesh_quantities)
Main call to user solver.
Definition: cs_user_solver.c:92
cs_real_t * cs_get_cavitation_dgdp_st(void)
Return pointer to cavitation "dgdpca" array.
void cs_user_postprocess_writers(void)
Define post-processing writers.
Definition: cs_user_postprocess.c:69
void cs_user_boundary_conditions(cs_domain_t *domain, int bc_type[])
User definition of boundary conditions.
Definition: cs_user_boundary_conditions.c:123
void cs_user_mesh_smoothe(cs_mesh_t *mesh)
Mesh smoothing.
Definition: cs_user_mesh.c:186
void cs_user_initialization(cs_domain_t *domain)
This function is called one time step to initialize problem.
Definition: cs_user_initialization.c:88
void cs_user_extra_operations_initialize(cs_domain_t *domain)
Initialize variables.
Definition: cs_user_extra_operations.c:86
void cs_user_cathare_coupling(void)
Define couplings with SYRTHES code.
Definition: cs_user_coupling.c:138
void caltri(void)
Definition: caltri.f90:36
void csinit(const int *irgpar, const int *nrgpar)
void cs_user_paramedmem_define_couplings(void)
Define ParaMEDMEM coupling(s)
Definition: cs_user_paramedmem_coupling.c:82
void cs_user_hgn_thermo_relax_time(const cs_mesh_t *mesh, const cs_real_t *alpha_eq, const cs_real_t *y_eq, const cs_real_t *z_eq, const cs_real_t *ei, const cs_real_t *v, cs_real_t *relax_tau)
Computation of the relaxation time-scale.
Definition: cs_user_hgn.c:82
void cs_user_mesh_warping(void)
Set options for cutting of warped faces.
Definition: cs_user_mesh.c:141
void cs_sat_coupling_exchange_at_cells(int f_id, cs_real_t st_exp[], cs_real_t st_imp[])
void cs_user_partition(void)
Define advanced partitioning options.
Definition: cs_user_performance_tuning.c:87
void cs_user_physical_properties_t_to_h(cs_domain_t *domain, const cs_zone_t *z, bool z_local, const cs_real_t t[restrict], cs_real_t h[restrict])
User definition of temperature to enthalpy conversion.
void cs_user_parallel_io(void)
Define parallel IO settings.
Definition: cs_user_performance_tuning.c:100
void cs_turbomachinery_update(void)
Sync turbomachinery module components to global c turbomachinery structure.
void cs_user_paramedmem_define_meshes(void)
Define coupled meshes.
Definition: cs_user_paramedmem_coupling.c:95
void cs_user_finalize_setup(cs_domain_t *domain)
Define or modify output user parameters. For CDO schemes, specify the elements such as properties,...
Definition: cs_user_parameters.c:180
void cs_user_rad_transfer_net_flux(const int itypfb[], const cs_real_t coefap[], const cs_real_t coefbp[], const cs_real_t cofafp[], const cs_real_t cofbfp[], const cs_real_t twall[], const cs_real_t qincid[], const cs_real_t xlam[], const cs_real_t epa[], const cs_real_t eps[], const cs_real_t ck[], cs_real_t net_flux[])
Compute the net radiation flux.
Definition: cs_user_radiative_transfer.c:141
void cs_user_saturne_coupling(void)
Define couplings with other instances of code_saturne.
Definition: cs_user_coupling.c:79
void cs_user_turbomachinery(void)
Define rotor/stator model.
Definition: cs_user_turbomachinery.c:77
void cpthp1(const int *mode, cs_real_t *eh, cs_real_t *xesp, cs_real_t *f1mc, cs_real_t *f2mc, cs_real_t *tp)
void cs_drift_convective_flux(int f_id, const cs_real_t dt[], cs_real_t imasfl[], cs_real_t bmasf[], cs_real_t divflu[])
Compute the modified convective flux for scalars with a drift.
double precision, dimension(:,:,:), allocatable v
Definition: atimbr.f90:114
double precision, dimension(:,:,:), allocatable pressure
Definition: atimbr.f90:122
integer, dimension(:), allocatable, target icetsm
number of the ncetsm cells in which a mass injection is imposed. See iicesm and the cs_equation_add_v...
Definition: pointe.f90:176
integer, dimension(:), pointer, save itypfb
boundary condition type at the boundary face ifac (see cs_user_boundary_conditions)
Definition: pointe.f90:89
integer, save nscal
number of solved user scalars effective number of scalars solutions of an advection equation,...
Definition: dimens.f90:55
integer, save nvar
number of solved variables (must be lower than nvarmx)
Definition: dimens.f90:42
integer, save ncelet
number of extended (real + ghost of the 'halo') cells. See Note 1: ghost cells - (halos)
Definition: mesh.f90:48
double precision, dimension(:,:), pointer xyzcen
coordinate of the cell centers
Definition: mesh.f90:70
integer, save ncel
number of real cells in the mesh
Definition: mesh.f90:52
integer, save isuit1
For the 1D wall thermal module, activation (1) or not(0) of the reading of the mesh and of the wall t...
Definition: optcal.f90:174
Definition: mesh.f90:26
Structure storing the main features of the computational domain and pointers to the main geometrical ...
Definition: cs_domain.h:138
Definition: cs_mesh_quantities.h:92
Definition: cs_mesh.h:85
Definition: cs_time_control.h:96
time step descriptor
Definition: cs_time_step.h:64
Definition: cs_zone.h:55