96 |
|
|
97 |
PureFluid *fprops_prepare(const EosData *E,const char *corrtype){ |
PureFluid *fprops_prepare(const EosData *E,const char *corrtype){ |
98 |
PureFluid *P = NULL; |
PureFluid *P = NULL; |
99 |
|
FpropsError err = FPROPS_NO_ERROR; |
100 |
MSG("Working with EosData name '%s', source '%s", E->name, E->source); |
MSG("Working with EosData name '%s', source '%s", E->name, E->source); |
101 |
MSG("Chosen correlation: %d (requested %s)", fprops_corr_avail(E,corrtype),corrtype); |
MSG("Chosen correlation: %d (requested %s)", fprops_corr_avail(E,corrtype),corrtype); |
102 |
switch(fprops_corr_avail(E,corrtype)){ |
switch(fprops_corr_avail(E,corrtype)){ |
116 |
/* next: add preparation of viscosity, thermal conductivity, surface tension, ... */ |
/* next: add preparation of viscosity, thermal conductivity, surface tension, ... */ |
117 |
|
|
118 |
MSG("Preparing viscosity data..."); |
MSG("Preparing viscosity data..."); |
|
FpropsError err = FPROPS_NO_ERROR; |
|
119 |
P->visc = visc_prepare(E,P,&err); |
P->visc = visc_prepare(E,P,&err); |
120 |
if(err){ |
if(err){ |
121 |
ERRMSG("Invalid viscosity data for '%s",P->name); |
ERRMSG("Invalid viscosity data for '%s",P->name); |
122 |
/* visc_prepare should return NULL if there was an error, so result is |
/* visc_prepare should return NULL if there was an error, so result is |
123 |
same as when there is no viscosity data at all */ |
same as when there is no viscosity data at all */ |
124 |
} |
} |
125 |
|
|
126 |
|
MSG("Preparing thermal conductivity data..."); |
127 |
|
err = FPROPS_NO_ERROR; |
128 |
|
thcond_prepare(P,E->thcond,&err); |
129 |
|
if(err){ |
130 |
|
ERRMSG("Invalid viscosity data for '%s",P->name); |
131 |
|
/* visc_prepare should return NULL if there was an error, so result is |
132 |
|
same as when there is no viscosity data at all */ |
133 |
|
} |
134 |
|
|
135 |
|
|
136 |
|
|
137 |
return P; |
return P; |
138 |
} |
} |
139 |
|
|
224 |
} |
} |
225 |
|
|
226 |
/// TODO reimplement with function pointer? |
/// TODO reimplement with function pointer? |
227 |
double fprops_k(FluidState state, FpropsError *err){ |
double fprops_lam(FluidState state, FpropsError *err){ |
228 |
if(NULL!=state.fluid->thcond){ |
if(NULL!=state.fluid->thcond){ |
229 |
switch(state.fluid->thcond->type){ |
switch(state.fluid->thcond->type){ |
230 |
case FPROPS_THCOND_1: |
case FPROPS_THCOND_1: |
231 |
return thcond1_k(state,err); |
return thcond1_lam(state,err); |
232 |
default: |
default: |
233 |
break; |
break; |
234 |
} |
} |