stardis-solver

Solve coupled heat transfers
git clone git://git.meso-star.fr/stardis-solver.git
Log | Files | Refs | README | LICENSE

sdis_heat_path_conductive.c (2966B)


      1 /* Copyright (C) 2016-2025 |Méso|Star> (contact@meso-star.com)
      2  *
      3  * This program is free software: you can redistribute it and/or modify
      4  * it under the terms of the GNU General Public License as published by
      5  * the Free Software Foundation, either version 3 of the License, or
      6  * (at your option) any later version.
      7  *
      8  * This program is distributed in the hope that it will be useful,
      9  * but WITHOUT ANY WARRANTY; without even the implied warranty of
     10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
     11  * GNU General Public License for more details.
     12  *
     13  * You should have received a copy of the GNU General Public License
     14  * along with this program. If not, see <http://www.gnu.org/licenses/>. */
     15 
     16 #include "sdis_log.h"
     17 #include "sdis_heat_path_conductive_c.h"
     18 #include "sdis_medium_c.h"
     19 #include "sdis_scene_c.h"
     20 
     21 /*******************************************************************************
     22  * Local function
     23  ******************************************************************************/
     24 res_T
     25 check_solid_constant_properties
     26   (struct sdis_device* dev,
     27    const int evaluate_green,
     28    const int use_wos_diffusion,
     29    const struct solid_props* props_ref,
     30    const struct solid_props* props)
     31 {
     32   res_T res = RES_OK;
     33   ASSERT(dev && props_ref && props);
     34 
     35   if(props_ref->lambda != props->lambda) {
     36     log_err(dev,
     37       "%s: invalid thermal conductivity. One assumes a constant conductivity "
     38       "for the whole solid.\n", FUNC_NAME);
     39     res = RES_BAD_ARG;
     40     goto error;
     41   }
     42 
     43   if(props_ref->rho != props->rho) {
     44     log_err(dev,
     45       "%s: invalid volumic mass. One assumes a constant volumic mass for "
     46       "the whole solid.\n", FUNC_NAME);
     47     res = RES_BAD_ARG;
     48     goto error;
     49   }
     50 
     51   if(props_ref->cp != props->cp) {
     52     log_err(dev,
     53        "%s: invalid calorific capacity. One assumes a constant calorific "
     54        "capacity for the whole solid.\n", FUNC_NAME);
     55     res = RES_BAD_ARG;
     56     goto error;
     57   }
     58 
     59   if((evaluate_green || use_wos_diffusion) && props_ref->power != props->power) {
     60     log_err(dev,
     61       "%s: invalid variable power density. Stardis expects a constant power "
     62       "density per solid when using WoS diffusion and/or green function "
     63       "evaluation.", FUNC_NAME);
     64     res = RES_BAD_ARG;
     65     goto error;
     66   }
     67 
     68 exit:
     69   return res;
     70 error:
     71   goto exit;
     72 }
     73 
     74 /* Generate the conductive path functions */
     75 #define SDIS_XD_DIMENSION 2
     76 #include "sdis_heat_path_conductive_Xd.h"
     77 #define SDIS_XD_DIMENSION 3
     78 #include "sdis_heat_path_conductive_Xd.h"
     79 #define SDIS_XD_DIMENSION 2
     80 #include "sdis_heat_path_conductive_custom_Xd.h"
     81 #define SDIS_XD_DIMENSION 3
     82 #include "sdis_heat_path_conductive_custom_Xd.h"
     83 #define SDIS_XD_DIMENSION 2
     84 #include "sdis_heat_path_conductive_delta_sphere_Xd.h"
     85 #define SDIS_XD_DIMENSION 3
     86 #include "sdis_heat_path_conductive_delta_sphere_Xd.h"
     87 #define SDIS_XD_DIMENSION 2
     88 #include "sdis_heat_path_conductive_wos_Xd.h"
     89 #define SDIS_XD_DIMENSION 3
     90 #include "sdis_heat_path_conductive_wos_Xd.h"