stardis

Perform coupled heat transfer calculations
git clone git://git.meso-star.fr/stardis.git
Log | Files | Refs | README | LICENSE

stardis-green-types.h.in (3493B)


      1 /* Copyright (C) 2018-2022 |Meso|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 #ifndef SDIS_GREEN_H
     17 #define SDIS_GREEN_H
     18 
     19 #include <stddef.h>
     20 
     21 /* The number of the file format as presented thereafter */
     22 #define GREEN_FILE_FORMAT_VERSION @STARDIS_GREEN_TYPES_VERSION@
     23 
     24 /* The max length for a description name *WITHOUT* null char */
     25 #define DESC_NAME_MAX_LEN @STARDIS_MAX_NAME_LENGTH@
     26 
     27 /* The string at the beginning of a binary Green file that identifies it */
     28 #define BIN_FILE_IDENT_STRING "GREEN_BIN_FILE:"
     29 
     30 /* The header of a binary Green file */
     31 struct green_file_header {
     32   char green_string[sizeof(BIN_FILE_IDENT_STRING)];
     33   unsigned file_format_version;
     34   unsigned description_count;
     35   unsigned solid_count;
     36   unsigned fluid_count;
     37   unsigned hbound_count;
     38   unsigned tbound_count;
     39   unsigned fbound_count;
     40   unsigned sfconnect_count;
     41   unsigned ssconnect_count;
     42   size_t ok_count;
     43   size_t failed_count;
     44   double ambient_radiative_temperature;
     45   double ambient_radiative_temperature_reference;
     46   double time_range[2];
     47 };
     48 
     49 /* Different types of descriptions */
     50 enum green_description_type {
     51   GREEN_MAT_SOLID,
     52   GREEN_MAT_FLUID,
     53   GREEN_BOUND_H,
     54   GREEN_BOUND_T,
     55   GREEN_BOUND_F,
     56   GREEN_SOLID_FLUID_CONNECT,
     57   GREEN_SOLID_SOLID_CONNECT
     58 };
     59 
     60 struct green_solid {
     61   char name[DESC_NAME_MAX_LEN+1];
     62   double conductivity;
     63   double volumic_mass;
     64   double calorific_capacity;
     65   double volumic_power;
     66   double initial_temperature;
     67   double imposed_temperature;
     68 };
     69 
     70 struct green_fluid {
     71   char name[DESC_NAME_MAX_LEN+1];
     72   double volumic_mass;
     73   double calorific_capacity;
     74   double initial_temperature;
     75   double imposed_temperature;
     76 };
     77 
     78 struct green_h_boundary {
     79   char name[DESC_NAME_MAX_LEN+1];
     80   double reference_temperature;
     81   double emissivity;
     82   double specular_fraction;
     83   double convection_coefficient;
     84   double imposed_temperature;
     85 };
     86 
     87 struct green_t_boundary {
     88   char name[DESC_NAME_MAX_LEN+1];
     89   double imposed_temperature;
     90 };
     91 
     92 struct green_f_boundary {
     93   char name[DESC_NAME_MAX_LEN+1];
     94   double imposed_flux;
     95 };
     96 
     97 struct green_solid_fluid_connect {
     98   char name[DESC_NAME_MAX_LEN+1];
     99   double reference_temperature;
    100   double emissivity;
    101   double specular_fraction;
    102   double convection_coefficient;
    103 };
    104 
    105 struct green_solid_solid_connect {
    106   char name[DESC_NAME_MAX_LEN+1];
    107   double thermal_contact_resistance;
    108 };
    109 
    110 struct green_description {
    111   enum green_description_type type;
    112   union {
    113     struct green_fluid fluid;
    114     struct green_solid solid;
    115     struct green_t_boundary t_boundary;
    116     struct green_f_boundary f_boundary;
    117     struct green_h_boundary h_boundary;
    118     struct green_solid_fluid_connect sf_connect;
    119     struct green_solid_solid_connect ss_connect;
    120   } d;
    121 };
    122 
    123 /* The header of a Green sample */
    124 struct green_sample_header {
    125   unsigned pw_count;
    126   unsigned fx_count;
    127   unsigned sample_end_description_id;
    128   int at_initial;
    129 };
    130 
    131 #endif