/[ascend]/trunk/models/johnpye/fprops/fprops.c
ViewVC logotype

Diff of /trunk/models/johnpye/fprops/fprops.c

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 2773 by jpye, Thu Mar 20 05:51:57 2014 UTC revision 2774 by jpye, Thu Mar 27 11:42:30 2014 UTC
# Line 96  int fprops_corr_avail(const EosData *E, Line 96  int fprops_corr_avail(const EosData *E,
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)){
# Line 115  PureFluid *fprops_prepare(const EosData Line 116  PureFluid *fprops_prepare(const EosData
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    
# Line 212  double fprops_mu(FluidState state, Fprop Line 224  double fprops_mu(FluidState state, Fprop
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          }            }  

Legend:
Removed from v.2773  
changed lines
  Added in v.2774

john.pye@anu.edu.au
ViewVC Help
Powered by ViewVC 1.1.22