1 /*============================================================================
2  * Radiation solver operations.
3  *============================================================================*/
4 
5 /* VERS */
6 
7 /*
8   This file is part of Code_Saturne, a general-purpose CFD tool.
9 
10   Copyright (C) 1998-2021 EDF S.A.
11 
12   This program is free software; you can redistribute it and/or modify it under
13   the terms of the GNU General Public License as published by the Free Software
14   Foundation; either version 2 of the License, or (at your option) any later
15   version.
16 
17   This program is distributed in the hope that it will be useful, but WITHOUT
18   ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
19   FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
20   details.
21 
22   You should have received a copy of the GNU General Public License along with
23   this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
24   Street, Fifth Floor, Boston, MA 02110-1301, USA.
25  */
26 
27 /*----------------------------------------------------------------------------*/
28 
29 #include "cs_defs.h"
30 
31 /*----------------------------------------------------------------------------
32  * Standard C library headers
33  *----------------------------------------------------------------------------*/
34 
35 #include <assert.h>
36 #include <string.h>
37 #include <math.h>
38 
39 #if defined(HAVE_MPI)
40 #include <mpi.h>
41 #endif
42 
43 /*----------------------------------------------------------------------------
44  * Local headers
45  *----------------------------------------------------------------------------*/
46 
47 #include "cs_headers.h"
48 
49 /*----------------------------------------------------------------------------*/
50 
51 BEGIN_C_DECLS
52 
53 /*=============================================================================
54  * Additional Doxygen documentation
55  *============================================================================*/
56 
57 /*! \file cs_user_radiative_transfer.c
58  *
59  * \brief User function for input of radiative transfer parameters:
60  *        absorption coefficient and net radiation flux.
61  *
62  *  See \ref cs_user_radiative_transfer for examples.
63  */
64 
65 /*=============================================================================
66  * Public function definitions
67  *============================================================================*/
68 
69 /*----------------------------------------------------------------------------*/
70 /*!
71  * \brief User function for input of radiative transfer module options.
72  */
73 /*----------------------------------------------------------------------------*/
74 
75 #pragma weak cs_user_radiative_transfer_parameters
76 void
cs_user_radiative_transfer_parameters(void)77 cs_user_radiative_transfer_parameters(void)
78 {
79 
80 }
81 
82 /*-----------------------------------------------------------------------------*/
83 /*!
84  * \brief Absorption coefficient for radiative module
85  *
86  * It is necessary to define the value of the fluid's absorption coefficient Ck.
87  *
88  * This value is defined automatically for specific physical models, such
89  * as gas and coal combustion, so this function is not used by these models.
90  *
91  * For a transparent medium, the coefficient should be set to 0.
92  *
93  * In the case of the P-1 model, we check that the optical length is at
94  * least of the order of 1.
95  *
96  * \param[in]   bc_type  boundary face types
97  * \param[out]  ck       medium's absorption coefficient (zero if transparent)
98  */
99 /*----------------------------------------------------------------------------*/
100 
101 #pragma weak cs_user_rad_transfer_absorption
102 void
cs_user_rad_transfer_absorption(const int bc_type[],cs_real_t ck[])103 cs_user_rad_transfer_absorption(const int  bc_type[],
104                                 cs_real_t  ck[])
105 {
106   CS_UNUSED(bc_type);
107   CS_UNUSED(ck);
108 }
109 
110 /*----------------------------------------------------------------------------*/
111 /*!
112  * \brief Compute the net radiation flux.
113  *
114  * The density of net radiation flux must be calculated
115  * consistently with the boundary conditions of the intensity.
116  * The density of net flux is the balance between the radiative
117  * emiting part of a boundary face (and not the reflecting one)
118  * and the radiative absorbing part.
119  *
120  * \param[in]   bc_type   boundary face types
121  * \param[in]   coefap    boundary condition work array for the luminance
122  *                         (explicit part)
123  * \param[in]   coefbp    boundary condition work array for the luminance
124  *                         (implicit part)
125  * \param[in]   cofafp    boundary condition work array for the diffusion
126  *                        of the luminance (explicit part)
127  * \param[in]   cofbfp    boundary condition work array for the diffusion
128  *                        of the luminance (implicit part)
129  * \param[in]   twall     inside current wall temperature (K)
130  * \param[in]   qincid    radiative incident flux  (W/m2)
131  * \param[in]   xlam      conductivity (W/m/K)
132  * \param[in]   epa       thickness (m)
133  * \param[in]   eps       emissivity (>0)
134  * \param[in]   ck        absorption coefficient
135  * \param[out]  net_flux  net flux (W/m2)
136  */
137 /*----------------------------------------------------------------------------*/
138 
139 #pragma weak cs_user_rad_transfer_net_flux
140 void
cs_user_rad_transfer_net_flux(const int bc_type[],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[])141 cs_user_rad_transfer_net_flux(const int        bc_type[],
142                               const cs_real_t  coefap[],
143                               const cs_real_t  coefbp[],
144                               const cs_real_t  cofafp[],
145                               const cs_real_t  cofbfp[],
146                               const cs_real_t  twall[],
147                               const cs_real_t  qincid[],
148                               const cs_real_t  xlam[],
149                               const cs_real_t  epa[],
150                               const cs_real_t  eps[],
151                               const cs_real_t  ck[],
152                               cs_real_t        net_flux[])
153 {
154   CS_UNUSED(bc_type);
155   CS_UNUSED(coefap);
156   CS_UNUSED(coefbp);
157   CS_UNUSED(cofafp);
158   CS_UNUSED(cofbfp);
159   CS_UNUSED(twall);
160   CS_UNUSED(qincid);
161   CS_UNUSED(xlam);
162   CS_UNUSED(epa);
163   CS_UNUSED(eps);
164   CS_UNUSED(ck);
165   CS_UNUSED(net_flux);
166 }
167 
168 /*----------------------------------------------------------------------------*/
169 
170 END_C_DECLS
171