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

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

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

revision 2758 by jpye, Thu Mar 20 06:07:13 2014 UTC revision 2759 by jpye, Fri Mar 21 11:25:55 2014 UTC
# Line 51  double visc1_ci1(const ViscCI1Data *ci1, Line 51  double visc1_ci1(const ViscCI1Data *ci1,
51  }  }
52    
53  // TODO implement this for thcond calc...  // TODO implement this for thcond calc...
54  // double visc1_mu0(FluidState state, FpropsError *err){  double visc1_mu0(FluidState state, FpropsError *err){
           
 double visc1_mu(FluidState state, FpropsError *err){  
55      if(state.fluid->visc->type != FPROPS_VISC_1){      if(state.fluid->visc->type != FPROPS_VISC_1){
56          *err = FPROPS_INVALID_REQUEST;          *err = FPROPS_INVALID_REQUEST;
57          return NAN;          return NAN;
58      }      }
   
     MSG("T = %e, rho = %e", state.T, state.rho);  
     MSG("  (--> p = %e MPa)",fprops_p(state,err)/1e6);  
     double Omega;  
59      const ViscosityData1 *v1 = &(state.fluid->visc->data.v1);      const ViscosityData1 *v1 = &(state.fluid->visc->data.v1);
60        double Omega;
61      switch(v1->ci.type){      switch(v1->ci.type){
62          case FPROPS_CI_1:          case FPROPS_CI_1:
63              Omega = visc1_ci1(&(v1->ci.data.ci1),state.T / v1->eps_over_k);              Omega = visc1_ci1(&(v1->ci.data.ci1),state.T / v1->eps_over_k);
# Line 72  double visc1_mu(FluidState state, Fprops Line 67  double visc1_mu(FluidState state, Fprops
67              return NAN;              return NAN;
68      }      }
69      MSG("M = %f, sigma = %f, Omega = %f, eps/k = %f",v1->M, v1->sigma, Omega,v1->eps_over_k);      MSG("M = %f, sigma = %f, Omega = %f, eps/k = %f",v1->M, v1->sigma, Omega,v1->eps_over_k);
70      double mu0 = 0.0266958 * sqrt(v1->M * state.T) / SQ(v1->sigma) / Omega;      double mu0 = v1->mu_star * 0.0266958 * sqrt(v1->M * state.T) / SQ(v1->sigma) / Omega;
71      MSG("mu0 = %e",mu0);      MSG("mu0 = %e",mu0);
72        return mu0;
73    }
74            
75    double visc1_mu(FluidState state, FpropsError *err){
76        if(state.fluid->visc->type != FPROPS_VISC_1){
77            *err = FPROPS_INVALID_REQUEST;
78            return NAN;
79        }
80    
81        MSG("T = %e, rho = %e", state.T, state.rho);
82        MSG("  (--> p = %e MPa)",fprops_p(state,err)/1e6);
83        const ViscosityData1 *v1 = &(state.fluid->visc->data.v1);
84        double mu0 = visc1_mu0(state,err);
85      double mur = 0;      double mur = 0;
86      MSG("T_star = %f",v1->T_star);      MSG("T_star = %f",v1->T_star);
87      MSG("rho_star = %f",v1->rho_star);      MSG("rho_star = %f",v1->rho_star);
# Line 92  double visc1_mu(FluidState state, Fprops Line 100  double visc1_mu(FluidState state, Fprops
100          }          }
101      }      }
102      /* TODO something about critical point terms? */      /* TODO something about critical point terms? */
103      MSG("mur = %e",mur);      MSG("mur/mu* = %e",mur);
104      MSG("mustar = %e",v1->mu_star);      MSG("mustar = %e",v1->mu_star);
105      return v1->mu_star * (mu0 + mur);      return mu0 + (v1->mu_star * mur);
106  }  }
107    
108    

Legend:
Removed from v.2758  
changed lines
  Added in v.2759

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