1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 420 421 422 423
|
/*============================================================================
* Code_Saturne documentation page
*============================================================================*/
/*
This file is part of Code_Saturne, a general-purpose CFD tool.
Copyright (C) 1998-2018 EDF S.A.
This program is free software; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation; either version 2 of the License, or (at your option) any later
version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU General Public License for more
details.
You should have received a copy of the GNU General Public License along with
this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
/*-----------------------------------------------------------------------------*/
/*!
\page user_initialization cs_user_initialization.f90
\section user_initialization_intro Introduction
This page provides several examples of code blocks that may be used
to initialize variables in \ref cs_user_initialization.
These subroutines are called at beginning of the computation
(restart or not) before the loop time step.
These subroutines enable to initialize or modify (for restart)
unkown variables and time step values.
rom and viscl values are equal to ro0 and viscl0 or initialize
by reading the restart file:
- viscls and cp variables (when there are defined) have no value
- excepted if they are read from a restart file.
Modification of the behaviour law of physical quantities (rom, viscl,
viscls, cp) is not done here. It is the purpose of the user subroutine
usphyv.
Cells identification
Cells may be identified using the 'getcel' subroutine.
The syntax of this subroutine is described in the
\ref cs_user_boundary_conditions subroutine,
but a more thorough description can be found in the user guide.
\section cs_user_init_examples Initialization examples
Here is the list of examples dedicated to different physics:
- \subpage user_initialization_base
- \subpage user_initialization_atmospheric
- \subpage user_initialization_compressible
- \subpage user_initialization_electric_arcs
- \subpage user_initialization_fuel
- \subpage user_initialization_gas_3ptchem
- \subpage user_initialization_gas_ebu
- \subpage user_initialization_gas_libby_williams
- \subpage user_initialization_pulverized_coal
- \subpage user_initialization_time_step
- \subpage user_initialization_unified_combustion
*/
// __________________________________________________________________________________
/*!
\page user_initialization_base Basic example
\section base Basic example
\subsection user_initialization_base_loc_var_dec Local variables to be added
The following local variables need to be defined for the examples
in this section:
\snippet cs_user_initialization-base.f90 loc_var_dec
\subsection alloc Allocation
Before user initialization, work arrays must be allocated.
\snippet cs_user_initialization-base.f90 alloc
\subsection user_initialization_base_s_init Initialization
isca(1) is the number related to the first user-defined scalar variable.
rtp(iel,isca(1)) is the value of this variable in cell number iel.
ONLY done if there is no restart computation.
\snippet cs_user_initialization-base.f90 init
\subsection user_initialization_base_finalize Finalization
At the end of the subroutine, it is recommended to deallocate the work array:
\snippet cs_user_initialization-base.f90 finalize
*/
// __________________________________________________________________________________
/*!
\page user_initialization_atmospheric Atmospheric example
\section atmospheric Atmospheric example
\subsection user_initialization_atmo_loc_var_dec Local variables to be added
The following local variables need to be defined for the examples
in this section:
\snippet cs_user_initialization-atmospheric.f90 loc_var_dec
\subsection user_initialization_atmo_alloc Allocation
Before user initialization, work arrays lstelt must be allocated,
like in basic example.
\subsection user_initialization_atmo_s_init Initialization
The following initialization block needs to be added for the following examples:
\snippet cs_user_initialization-atmospheric.f90 init
\subsection user_initialization_atmo_finalize Finalization
At the end of the subroutine, it is recommended to deallocate the work array lstelt,
like in basic example.
*/
// __________________________________________________________________________________
/*!
\page user_initialization_compressible Compressible example
\section compressible Compressible example
\subsection user_initialization_comp_loc_var_dec Local variables to be added
The following local variables need to be defined for the examples
in this section:
\snippet cs_user_initialization-compressible.f90 loc_var_dec
\subsection user_initialization_comp_alloc Allocation
Before user initialization, work arrays must be allocated.
\snippet cs_user_initialization-base.f90 alloc
\subsection user_initialization_comp_s_init Initialization
The following initialization block needs to be added for the following examples:
\snippet cs_user_initialization-compressible.f90 init
\subsection user_initialization_comp_finalize Finalization
At the end of the subroutine, it is recommended to deallocate the work arrays:
\snippet cs_user_initialization-compressible.f90 finalize
*/
// __________________________________________________________________________________
/*!
\page user_initialization_electric_arcs Electric arcs example
\section electric_arcs Electric arcs example
\subsection user_initialization_ea_loc_var_dec Local variables to be added
The following local variables need to be defined for the examples
in this section:
\snippet cs_user_initialization-electric_arcs.f90 loc_var_dec
\subsection user_initialization_ea_alloc Allocation
Before user initialization, work arrays lstelt must be allocated,
like in basic example.
\subsection user_initialization_ea_s_init Initialization
Classical initialization:
\snippet cs_user_initialization-electric_arcs.f90 init2
\subsection user_initialization_ea_finalize Finalization
At the end of the subroutine, it is recommended to deallocate the work array lstelt,
like in basic example.
*/
// __________________________________________________________________________________
/*!
\page user_initialization_fuel Fuel example
\section fuel Fuel example
\subsection user_initialization_fuel_loc_var_dec Local variables to be added
The following local variables need to be defined for the examples
in this section:
\snippet cs_user_initialization-fuel.f90 loc_var_dec
\subsection user_initialization_fuel_alloc Allocation
Before user initialization, work arrays lstelt must be allocated,
like in basic example.
\subsection user_initialization_fuel_s_init Initialization
The following initialization block needs to be added for the following examples:
\snippet cs_user_initialization-fuel.f90 init
\subsection user_initialization_fuel_finalize Finalization
There is no work array in this subroutine, thus nothing to do.
*/
// __________________________________________________________________________________
/*!
\page user_initialization_gas_3ptchem Gas 3 PTCHEM example
\section gas_3ptchem Gas 3 PTCHEM example
\subsection user_initialization_gas_3p_loc_var_dec Local variables to be added
The following local variables need to be defined for the examples
in this section:
\snippet cs_user_initialization-gas_3ptchem.f90 loc_var_dec
\subsection user_initialization_gas_3p_alloc Allocation
Before user initialization, work arrays lstelt must be allocated,
like in basic example.
\subsection user_initialization_gas_3p_s_init Initialization
The following initialization block needs to be added for the following examples:
\snippet cs_user_initialization-gas_3ptchem.f90 init
\subsection user_initialization_gas_3p_finalize Finalization
At the end of the subroutine, it is recommended to deallocate the work array lstelt,
like in basic example.
*/
// __________________________________________________________________________________
/*!
\page user_initialization_gas_ebu Gas EBU example
\section gas_ebu Gas EBU example
\subsection user_initialization_gas_ebu_loc_var_dec Local variables to be added
The following local variables need to be defined for the examples
in this section:
\snippet cs_user_initialization-gas_ebu.f90 loc_var_dec
\subsection user_initialization_gas_ebu_alloc Allocation
Before user initialization, work arrays lstelt must be allocated,
like in basic example.
\subsection user_initialization_gas_ebu_s_init Initialization
The following initialization block needs to be added for the following examples:
\snippet cs_user_initialization-gas_ebu.f90 init
\subsection user_initialization_gas_ebu_finalize Finalization
At the end of the subroutine, it is recommended to deallocate the work array lstelt,
like in basic example.
*/
// __________________________________________________________________________________
/*!
\page user_initialization_gas_libby_williams Libby-Williams gas example
\section gas_libby_williams Libby-Williams gas example
\subsection user_initialization_gas_lb_loc_var_dec Local variables to be added
The following local variables need to be defined for the examples
in this section:
\snippet cs_user_initialization-gas_libby_williams.f90 loc_var_dec
\subsection user_initialization_gas_lb_alloc Allocation
Before user initialization, work arrays lstelt must be allocated,
like in basic example.
\subsection user_initialization_gas_lb_s_init Initialization
The following initialization block needs to be added for the following examples:
\snippet cs_user_initialization-gas_libby_williams.f90 init
\subsection user_initialization_gas_lb_finalize Finalization
At the end of the subroutine, it is recommended to deallocate the work array lstelt,
like in basic example.
*/
// __________________________________________________________________________________
/*!
\page user_initialization_pulverized_coal pulverized_coal example
\section pulverized_coal pulverized_coal example
\subsection user_initialization_coal_loc_var_dec Local variables to be added
The following local variables need to be defined for the examples
in this section:
\snippet cs_user_initialization-pulverized_coal.f90 loc_var_dec
\subsection user_initialization_coal_alloc Allocation
Before user initialization, work arrays lstelt must be allocated,
like in basic example.
\subsection user_initialization_coal_s_init Initialization
The following initialization block needs to be added for the following examples:
\snippet cs_user_initialization-pulverized_coal.f90 init
\subsection user_initialization_coal_finalize Finalization
At the end of the subroutine, it is recommended to deallocate the work array lstelt,
like in basic example.
*/
// __________________________________________________________________________________
/*!
\page user_initialization_time_step Time step modification
\section time_step Time step modification
\subsection user_initialization_time_loc_var_dec Local variables to be added
The following local variables need to be defined for the examples
in this section:
\snippet cs_user_initialization-time_step.f90 loc_var_dec
\subsection user_initialization_time_alloc Allocation
Before user initialization, work arrays lstelt must be allocated,
like in basic example.
\subsection user_initialization_time_s_init Initialization
The following initialization block needs to be added for the following examples:
\snippet cs_user_initialization-time_step.f90 init
\subsection user_initialization_time_finalize Finalization
At the end of the subroutine, it is recommended to deallocate the work array lstelt,
like in basic example.
*/
// __________________________________________________________________________________
/*!
\page user_initialization_unified_combustion Unified combustion coal example
isca(1) is the number related to the first user-defined scalar variable.
rtp(iel,isca(1)) is the value of this variable in cell number iel.
ONLY done if there is no restart computation
\section unified_combustion Unified combustion coal example
\subsection user_initialization_comb_loc_var_dec Local variables to be added
The following local variables need to be defined for the examples
in this section:
\snippet cs_user_initialization-unified_combustion_coal.f90 loc_var_dec
\subsection user_initialization_comb_alloc Allocation
Before user initialization, work arrays lstelt must be allocated,
like in basic example.
\subsection user_initialization_comb_s_init Initialization
The following initialization block needs to be added for the following examples:
\snippet cs_user_initialization-unified_combustion_coal.f90 init
\subsection user_initialization_comb_finalize Finalization
At the end of the subroutine, it is recommended to deallocate the work array lstelt,
like in basic example.
*/
|