00001 #ifndef UTS_MAT_H
00002 #define UTS_MAT_H
00003
00004 #ifndef ANALYTIC_EXPRESSIONS
00005 #define ANALYTIC_EXPRESSIONS
00006 #endif
00007
00008 #include <stdlib.h>
00009
00010 #ifdef __cplusplus
00011 extern "C"
00012 {
00013 #endif
00014
00015
00071
00072
00073
00074
00075 extern const char* utc_mat_database_filename;
00076
00078 #ifndef PHASE_TRANSFORMATION
00079 typedef struct {
00080
00081 int matnum;
00082 char name[80];
00083 char is_fluid;
00084
00085 double *Tfor_dynamic_viscosity;
00086 double *atT_dynamic_viscosity;
00087 void* expression_of_dynamic_viscosity_from_T;
00088 int dynamic_viscosity_num;
00089
00090 double *Tfor_density;
00091 double *atT_density;
00092 void* expression_of_density_from_T;
00093 int density_num;
00094
00095 double *Tfor_thermal_conductivity;
00096 double *atT_thermal_conductivity;
00097 int thermal_conductivity_num;
00098
00099 double *Tfor_specific_heat;
00100 double *atT_specific_heat;
00101 int specific_heat_num;
00102
00103 double *Tfor_enthalpy;
00104 double *atT_enthalpy;
00105 int enthalpy_num;
00106
00107 double *Tfor_thermal_expansion_coefficient;
00108 double *atT_thermal_expansion_coefficient;
00109 int thermal_expansion_coefficient_num;
00110
00111 double *Tfor_electrical_resistivity;
00112 double *atT_electrical_resistivity;
00113 int electrical_resistivity_num;
00114
00115 double *Tfor_VOF;
00116 double *atT_VOF;
00117 int VOF_num;
00118
00119 double *Tfor_dg_dT;
00120 double *atT_dg_dT;
00121 int dg_dT_num;
00122
00123 double temp_solidus;
00124 double temp_liquidus;
00125 double temp_vaporization;
00126
00127 double latent_heat_of_fusion;
00128 double latent_heat_of_vaporization;
00129
00130 double composition;
00131
00132 double *TSfor_flow_stress;
00133 double *atTS_flow_stress;
00134 void* expression_of_flow_stress_from_S;
00135 int flow_stress_num;
00136
00137 double Young_mod;
00138 double Poisson_rat;
00139 double bulk_mod;
00140 double shear_mod;
00141
00142 } utt_material_data;
00143 #else
00144 typedef struct {
00145
00146 int matnum;
00147 char name[20];
00148 char is_fluid;
00149
00150 double *Tfor_dynamic_viscosity;
00151 double *atT_dynamic_viscosity;
00152 void* expression_of_dynamic_viscosity_from_T;
00153 int dynamic_viscosity_num;
00154
00155 double *Tfor_density;
00156 double *atT_density;
00157 void* expression_of_density_from_T;
00158 int density_num;
00159
00160 double *Tfor_thermal_conductivity;
00161 double *atT_thermal_conductivity;
00162 int thermal_conductivity_num;
00163
00164 double *Tfor_specific_heat;
00165 double *atT_specific_heat;
00166 int specific_heat_num;
00167
00168 double *Tfor_enthalpy;
00169 double *atT_enthalpy;
00170 int enthalpy_num;
00171
00172 double *Tfor_thermal_expansion_coefficient;
00173 double *atT_thermal_expansion_coefficient;
00174 int thermal_expansion_coefficient_num;
00175
00176 double *Tfor_electrical_resistivity;
00177 double *atT_electrical_resistivity;
00178 int electrical_resistivity_num;
00179
00180 double *Tfor_VOF;
00181 double *atT_VOF;
00182 int VOF_num;
00183
00184 double *Tfor_dg_dT;
00185 double *atT_dg_dT;
00186 int dg_dT_num;
00187
00188 double temp_solidus;
00189 double temp_liquidus;
00190 double temp_vaporization;
00191
00192 double latent_heat_of_fusion;
00193 double latent_heat_of_vaporization;
00194
00195 double composition;
00196
00197 double *TSfor_flow_stress;
00198 double *atTS_flow_stress;
00199 void* expression_of_flow_stress_from_S;
00200 int flow_stress_num;
00201
00202 double Young_mod;
00203 double Poisson_rat;
00204 double bulk_mod;
00205 double shear_mod;
00206
00207 double *tfor_T_Fs;
00208 double *att_T_Fs;
00209 void* expression_of_T_Fs_from_t;
00210 int T_Fs_num;
00211
00212 double *tfor_T_Ff;
00213 double *att_T_Ff;
00214 void* expression_of_T_Ff_from_t;
00215 int T_Ff_num;
00216
00217 double *tfor_T_Ps;
00218 double *att_T_Ps;
00219 void* expression_of_T_Ps_from_t;
00220 int T_Ps_num;
00221
00222 double *tfor_T_Pf;
00223 double *att_T_Pf;
00224 void* expression_of_T_Pf_from_t;
00225 int T_Pf_num;
00226
00227 double *tfor_T_Bs;
00228 double *att_T_Bs;
00229 void* expression_of_T_Bs_from_t;
00230 int T_Bs_num;
00231
00232 double *tfor_T_Bf;
00233 double *att_T_Bf;
00234 void* expression_of_T_Bf_from_t;
00235 int T_Bf_num;
00236
00237 double *tfor_T_Ms;
00238 double *att_T_Ms;
00239 void* expression_of_T_Ms_from_t;
00240 int T_Ms_num;
00241
00242 double *tfor_T_Mf;
00243 double *att_T_Mf;
00244 void* expression_of_T_Mf_from_t;
00245 int T_Mf_num;
00246
00247 double *Vcfor_M_Vc;
00248 double *atVc_M_Vc;
00249 int M_Vc_num;
00250
00251 double *Vcfor_B_Vc;
00252 double *atVc_B_Vc;
00253 int B_Vc_num;
00254
00255 double *Vcfor_F_Vc;
00256 double *atVc_F_Vc;
00257 int F_Vc_num;
00258
00259 double *Vcfor_P_Vc;
00260 double *atVc_P_Vc;
00261 int P_Vc_num;
00262
00263 double *Tfor_H_A_F;
00264 double *atT_H_A_F;
00265 void* expression_of_H_A_F_from_T;
00266 int H_A_F_num;
00267
00268 double *Tfor_H_A_P;
00269 double *atT_H_A_P;
00270 void* expression_of_H_A_P_from_T;
00271 int H_A_P_num;
00272
00273 double *Tfor_H_A_B;
00274 double *atT_H_A_B;
00275 void* expression_of_H_A_B_from_T;
00276 int H_A_B_num;
00277
00278 double *Tfor_H_A_M;
00279 double *atT_H_A_M;
00280 void* expression_of_H_A_M_from_T;
00281 int H_A_M_num;
00282
00283 double tB_lim;
00284 double tM_lim;
00285
00286 } utt_material_data;
00287 #endif
00288
00289 typedef enum {
00290 QUERY_NODE,
00291 QUERY_POINT
00292 } utt_query_type;
00293
00294 typedef enum {
00295 NOT_FLUID=0,
00296 FLUID=1
00297 } utt_is_fluid;
00298
00300 typedef struct{
00301 char * name;
00302 int group_idx;
00303 double temperature;
00304 double strain_intensity;
00305 double xg[3];
00306 utt_query_type query_type;
00307 int cell_id;
00308 int node_id;
00309 double time;
00310 double Vc;
00311
00312 } utt_material_query_params;
00313
00317
00318 #ifndef PHASE_TRANSFORMATION
00319 typedef struct{
00320 char name[80];
00321 char is_fluid;
00322 double dynamic_viscosity;
00323 double density;
00324 double thermal_conductivity;
00325 double specific_heat;
00326 double enthalpy;
00327 double thermal_expansion_coefficient;
00328 double electrical_resistivity;
00329 double VOF;
00330 double dg_dT;
00331 double temp_solidus;
00332 double temp_liquidus;
00333 double temp_vaporization;
00334 double latent_heat_of_fusion;
00335 double latent_heat_of_vaporization;
00336
00337 double composition;
00338 double flow_stress;
00339 double Young_mod;
00340 double Poisson_rat;
00341 double bulk_mod;
00342 double shear_mod;
00343 } utt_material_query_result;
00344 #else
00345 typedef struct{
00346 char name[20];
00347 char is_fluid;
00348 double dynamic_viscosity;
00349 double density;
00350 double thermal_conductivity;
00351 double specific_heat;
00352 double enthalpy;
00353 double thermal_expansion_coefficient;
00354 double electrical_resistivity;
00355 double VOF;
00356 double dg_dT;
00357 double temp_solidus;
00358 double temp_liquidus;
00359 double temp_vaporization;
00360 double latent_heat_of_fusion;
00361 double latent_heat_of_vaporization;
00362
00363 double composition;
00364 double flow_stress;
00365 double Young_mod;
00366 double Poisson_rat;
00367 double bulk_mod;
00368 double shear_mod;
00369
00370 double T_Fs;
00371 double T_Ff;
00372 double T_Ps;
00373 double T_Pf;
00374 double T_Bs;
00375 double T_Bf;
00376 double T_Ms;
00377 double T_Mf;
00378
00379 double M_Vc;
00380 double B_Vc;
00381 double F_Vc;
00382 double P_Vc;
00383
00384 double H_A_F;
00385 double H_A_P;
00386 double H_A_B;
00387 double H_A_M;
00388
00389 double tB_lim;
00390 double tM_lim;
00391
00392 } utt_material_query_result;
00393 #endif
00394
00396 #define UTC_MAT_QUERY_RESULT_NOT_NEEDED -1.0
00398 #define UTC_MAT_QUERY_RESULT_REQUIRED -3.0
00399
00401 typedef enum {
00402 UTE_GROUP_ID_NOT_ASSIGNED = -1,
00403 UTE_GROUP_ID_DEFAULT_BLOCK = 1
00404 } ute_mat_groupID_flag;
00405
00406 typedef enum {
00407 UTE_SUCCESS = EXIT_SUCCESS,
00408 UTE_FAIL = -1,
00409 UTE_REF_TEMP_MUST_BE_GEQ_ZERO = -2,
00410 UTE_NOT_NEED_MATERIAL_DATABASE = 1
00411 } ute_mat_read_result;
00412
00413
00414
00415 ute_mat_read_result utr_mat_read(const char *Work_dir,
00416 const char *Filename,
00417 FILE *Interactive_output);
00418
00419 void utr_mat_init_query_result(utt_material_query_result* result);
00420
00428 int utr_material_query(const utt_material_query_params *Params,
00429 utt_material_query_result *Result);
00430
00437 int utr_mat_get_matID(int groupID);
00438
00439
00440
00446 int utr_mat_get_n_materials();
00447
00453 int utr_mat_get_materials_IDs(int *materialIDs);
00454
00455
00461 void utr_mat_clear_material(utt_material_data* mat);
00462
00463
00469 void utr_mat_clear_all();
00470
00471
00472
00473
00474
00475
00483 const utt_material_data* utr_mat_get_material(const int groupID);
00484
00492 const utt_material_data *utr_mat_get_material_by_matID(int matID);
00493
00494
00496
00497 #ifdef __cplusplus
00498 }
00499 #endif
00500
00501 #endif //UTS_MAT_H