00001 /************************************************************************ 00002 File pdh_heat_materials.h - types and functions related to materials 00003 handling 00004 00005 Contains declarations of routines: 00006 pdr_heat_material_read - reads materials file and fills structures 00007 pdr_heat_material_query - gets material data 00008 pdr_heat_material_free - free materials structures 00009 00010 ------------------------------ 00011 History: 00012 2011 - Przemyslaw Plaszewski (pplaszew@agh.edu.pl) 00013 2011 - Aleksander Siwek (Aleksander.Siwek@agh.edu.pl) 00014 2012 - Krzysztof Banas (pobanas@cyf-kr.edu.pl) 00015 2016 - Aleksander Siwek (Aleksander.Siwek@agh.edu.pl) 00016 *************************************************************************/ 00017 00018 #ifndef PDH_HEAT_MATERIALS_H 00019 #define PDH_HEAT_MATERIALS_H 00020 00021 #include <stdio.h> 00022 00023 #include "uth_mat.h" 00024 00025 #ifdef __cplusplus 00026 extern "C"{ 00027 #endif 00028 00029 #ifdef PHASE_TRANSFORMATION 00030 /* types of phase transformations */ 00031 typedef enum { 00032 PT_HEAT_UNKNOWN, 00033 PT_HEAT_FERRITE_START, 00034 PT_HEAT_FERRITE_STOP, 00035 PT_HEAT_PEARLITE_START, 00036 PT_HEAT_PEARLITE_STOP, 00037 PT_HEAT_BAINITE_START, 00038 PT_HEAT_BAINITE_STOP, 00039 PT_HEAT_MARTENSITE_START, 00040 PT_HEAT_MARTENSITE_STOP, 00041 PT_HEAT_FINISHED 00042 } pdt_heat_pt_type; 00043 00044 /* types of phases */ 00045 typedef enum { 00046 P_HEAT_AUSTENITE, 00047 P_HEAT_FERRITE, 00048 P_HEAT_PEARLITE, 00049 P_HEAT_BAINITE, 00050 P_HEAT_MARTENSITE, 00051 P_HEAT_FIELDS_NB 00052 } pdt_heat_p_type; 00053 00054 00055 #endif 00056 00062 00064 //typedef struct { 00065 00066 // int matnum; 00067 // char name[20]; 00068 00069 // /* double *Tfor_dynamic_viscosity; */ 00070 // /* double *atT_dynamic_viscosity; */ 00071 // /* int dynamic_viscosity_num; */ 00072 00073 // double *Tfor_density; 00074 // double *atT_density; 00075 // int density_num; 00076 00077 // double *Tfor_thermal_conductivity; 00078 // double *atT_thermal_conductivity; 00079 // int thermal_conductivity_num; 00080 00081 // double *Tfor_specific_heat; 00082 // double *atT_specific_heat; 00083 // int specific_heat_num; 00084 00085 // double *Tfor_enthalpy; 00086 // double *atT_enthalpy; 00087 // int enthalpy_num; 00088 00089 // double *Tfor_thermal_expansion_coefficient; 00090 // double *atT_thermal_expansion_coefficient; 00091 // int thermal_expansion_coefficient_num; 00092 00093 // double *Tfor_electrical_resistivity; 00094 // double *atT_electrical_resistivity; 00095 // int electrical_resistivity_num; 00096 00097 // double *Tfor_VOF; 00098 // double *atT_VOF; 00099 // int VOF_num; 00100 00101 // double *Tfor_dg_dT; 00102 // double *atT_dg_dT; 00103 // int dg_dT_num; 00104 00105 // double temp_solidus; 00106 // double temp_liquidus; 00107 // double temp_vaporization; 00108 00109 // double latent_heat_of_fusion; 00110 // double latent_heat_of_vaporization; 00111 00112 //} pdt_heat_material_data; 00113 00115 //typedef struct{ 00116 // int materials_num; 00117 // char **material_names; 00118 // pdt_heat_material_data *material_data; 00119 // //TODO: cache 00120 //} pdt_heat_materials; 00121 00122 //typedef enum { 00123 // QUERY_HEAT_NODE, 00124 // QUERY_HEAT_POINT 00125 //} pdt_heat_query_type; 00126 00128 //typedef struct{ 00129 // char * name; //if searching by idx (idx >= 0) set to anything 00130 // int material_idx; //set -1 if you want to search by name 00131 // double temperature; 00132 // double xg[3]; 00133 // pdt_heat_query_type query_type; 00134 // int cell_id; 00135 // int node_id; 00136 // double aux; 00137 // //in future: elem no., coordinates etc. 00138 //} pdt_heat_material_query_params; 00139 00140 /* output of pdr_material_query */ 00141 //typedef struct{ 00142 // char name[20]; 00143 // //double dynamic_viscosity; 00144 // double thermal_conductivity; 00145 // double specific_heat; 00146 // double density; 00147 // double enthalpy; 00148 // double thermal_expansion_coefficient; 00149 // double electrical_resistivity; 00150 // double VOF; 00151 // //double dg_dT; 00152 // double temp_solidus; 00153 // double temp_liquidus; 00154 // double temp_vaporization; 00155 // double latent_heat_of_fusion; 00156 // double latent_heat_of_vaporization; 00157 //} pdt_heat_material_query_result; 00158 00159 00160 /**************************************/ 00161 /* INTERNAL PROCEDURES */ 00162 /**************************************/ 00163 /* Rules: 00164 /* - name always begins with pdr_ */ 00165 /* - argument names start uppercase */ 00166 00170 int pdr_heat_material_read( 00171 char *Work_dir, 00172 char *Filename, 00173 FILE *Interactive_output 00174 //pdt_heat_materials *Materials_db /* out: materials structure to be filled */ 00175 ); 00176 00180 int pdr_heat_material_query( 00181 //const pdt_heat_materials *Materials_db, /*in:materials structure to read from*/ 00182 const utt_material_query_params *Params, /* in: query parameters */ 00183 utt_material_query_result *Result /* out: material data */ 00184 ); 00185 00189 //int pdr_heat_material_free(pdt_heat_materials *Materials_db); 00190 00191 #ifdef PHASE_TRANSFORMATION 00192 00195 int pdr_phases_field_init(int Problem_id); 00196 #endif 00197 00198 #ifdef __cplusplus 00199 } 00200 #endif 00201 00202 00203 #endif