TALK=T;RUN(1,1) Updated 10.03.13 by dbs to facilitate accuracy assessment and to allow loading of library case 089 rather than copying lines from it here boolean(use089) ! logical causig 089.htm to be loaded JCL 26.09.18 if 089 is used, conductivity is set for TEM1 not TEMP (==H1) as expected by rest of Q1 use089=f by way of ratios of properties computed from various formulae 763.htm

  PHOTON USE
  p;;;;;
 
  vi z
  con temp z 5 fi;0.0001
  pause; cl;  con cp1 z 5 fi;0.0001
  msg                         specific heat formulae
  pause; cl;  con s5cp z 5 fi;0.0001
  msg                         specific heat formulae
  pause; cl;  con l3cp z 5 fi;0.0001
  msg                         specific heat formulae
  pause; cl;  con lfcp z 5 fi;0.0001
  msg                         specific heat formulae
  pause; cl;  con enul z 5 fi;0.0001
  msg                       kinematic viscosity formulae
  pause; cl;  con s5en z 5 fi;0.0001
  msg                       kinematic viscosity formulae
  pause; cl;  con l3en z 5 fi;0.0001
  msg                       kinematic viscosity formulae
  pause; cl;  con lfen z 5 fi;0.0001
  msg                       kinematic viscosity formulae
  pause; cl;  cl; con rho1 z 5 fi;0.0001 
  msg                           density formulae
  pause; cl;  con s5rh z 5 fi;0.0001
  msg                           density formulae
  pause; cl;  con l3rh z 5 fi;0.0001
  msg                           density formulae
  pause; cl;  con lfrh z 5 fi;0.0001
  msg                           density formulae
  pause; cl;  con cond z 5 fi;0.0001
  msg                       thermal conductity formulae
  pause; cl;  con s5cn z 5 fi;0.0001
  msg                       thermal conductity formulae
  pause; cl;  con l3cn z 5 fi;0.0001
  msg                       thermal conductity formulae
  pause; cl;  con lfcn z 5 fi;0.0001
  msg                       thermal conductity formulae
  pause; cl;  con ent1 z 5 fi;0.0001
  msg              enthalpy
  ENDUSE  
  
text(Set Props Using POL3, PWL3, PWLF And SPL5)
title
  Load case 277. 
LOAD($277)
  Clear the screen, so that only the following display is seen
#CLS
  Switch off expert which would distract attention
EXPERT=F
    GROUP 1. Run title and other preliminaries
TEXT(3D SQUARE CAVITY; various fluids: 763
TITLE
libref=763
  DISPLAY
  Here the configuration of case 277 is used, for the purpose of
  showing the various ways in which In-Form allows fluid properties
  to be set.
  The fluid is ethylene glycol.
  
  Specifically illustrated are:
  * properties from the polynomials in case 089
    (these are the properties used in the solution for velocity 
     and temperature)
  * a 3-part piece-wise linear function
  * a spline function
  * a multi-part piece-wise linear function from files, here called:
      DENPRP,  ENUPRP,  CPPRP and  CNDPRP,
      
  These files are provided in /phoenics/d_earth/d_core/inplib
  To make comparison easy, the properties computed in these four 
  different ways have been divided by the values actually used.
  Their closeness to unity therefore measures their agreement. 

  The Q1 contains PHOTON USE commands    
  ENDDIS

REAL(THOT,TCOLD); THOT=420; TCOLD=280
  Note that temperatures  are absolute, measured in degrees K
    GROUP 7. Variables stored, solved & named
  Arange the variables in such an order as aids comparison  
STORE(RHO1,L3RH,S5RH,LFRH)
STORE(ENUL,L3EN,S5EN,LFEN)
STORE(CP1 ,L3CP,S5CP,LFCP)
STORE(COND,L3CN,S5CN,LFCN)
STORE(ENT1)

NAME(H1)=temp
  
  INFORM7BEGIN
  The LONGNAME feature provides reminders at RESULT-reading time  
(LONGNAME of L3RH print as 3-Piece-Wise_Linear_Density/rho1)
(LONGNAME of L3EN print as 3-Piece-Wise_Linear_Viscosity/enul)
(LONGNAME of L3CP print as 3-Piece-Wise_Linear_Specific_Heat/cp1)
(LONGNAME of L3CN print as 3-Piece-Wise_Linear_Conductivity/cond)

(LONGNAME of S5RH print as Spline_Curve_Density/rho1)
(LONGNAME of S5EN print as Spline_Curve_Viscosity/enul)
(LONGNAME of S5CP print as Spline_Curve_Specific_Heat/cp1)
(LONGNAME of S5CN print as Spline_Curve_Conductivity/cond)

(LONGNAME of LFRH print as Piece-Wise_Linear_Density_From_File/rho1)
(LONGNAME of LFEN print as Piece-Wise_Linear_Visc_From_File/enul)
(LONGNAME of LFCP print as Piece-Wise_Linear_Spe_Heat_From_File/cp1)
(LONGNAME of LFCN print as Piece-Wise_Linear_Cond_From_File/cond)

(LONGNAME of temp print as The_H1_Store_Is_Used_For_This)
(LONGNAME of ENT1 print as The_Enthalpy_I.E._CP*temp)
(LONGNAME of ENUL print as The_Viscosity_Actually_Used)
(LONGNAME of RHO1 print as The_Density_Actually_Used)
(LONGNAME of CP1 print as The_Specific_Heat_Actually_Used)
(LONGNAME of COND print as The_Conductivity_Actually_Used)
  INFORM7END
    GROUP 11. Initialization of variable or porosity fields
FIINIT(temp)=0.5*(THOT+TCOLD)
    GROUP 13. Boundary conditions and special sources
  ** South wall, at rest
COVAL(SOUTH,temp,1.0,TCOLD)
  ** North wall, moving
COVAL(MOVING,temp,1.0,THOT)
  Use a smaller wall velocity so as to allow larger temperature 
  variations within the cavity
COVAL(MOVING,U1,1.0,0.01)
  ** West wall, at rest
COVAL(WEST,temp,1.0,TCOLD)
  ** East wall, at rest
COVAL(EAST,temp,1.0,TCOLD)
  INFORM13BEGIN
(STORED var ENT1 is temp*CP1)
  

abt=temp ! This differs from the tem1 + temp0 default 
         ! provided in 014.htm

if(use089) then
fluid_name=ethylene_glycol
#$089
  ! alternatively, include rather than load
  incl(\phoenics\d_earth\d_core\inplib\089.htm)
else

char(rho_expression)
char(emu_expression)
char(enu_expression)
char(cp_expression)  
char(cond_expression)
   --------------------------------------------
   Ethylene Glycol [C2H4(OH)2] saturated liquid
   --------------------------------------------
  In-Form statemnts
     
    ***  polynomial ***

rho_expression=POL3(:abt:,1082.22,1.34031,-5.63885e-3,4.97135E-6)
(property rho1 is :rho_expression:)

enu_expression=10.^(POL3(:abt:,21.5824,-.149,3.40615e-4,-2.71336E$
-7)-2)/RHO1
(property enul is :enu_expression:) 

cp_expression=POL3(:abt:&889.59&5.27817&-9.16533e-4&8.80859E-7)
(property cp1 is :cp_expression:) 

cond_expression=.001*POL3(:abt:,526.92,-.88347,3.1519E-4,-2.42873E-7)
(stored cond is :cond_expression:) 
(property prndtl(temp) is cond/CP1)
endif    
  
    ***  piece-wise linear ***
(stored L3RH is PWL3(:abt:,280.,1125.,320.,1096.,370.,1060.,420.,101$
9.)/rho1)
(stored L3EN is PWL3(:abt:,280.,.0409,320.,.00781,370.,.00268,420.,.$
00097)/(RHO1*enul))
(stored L3CP is PWL3(:abt:,280.,2315.,320.,2514.,370.,2762.,420.,301$
0.)/cp1)
(stored L3CN is PWL3(:abt:,280.,.2989,320.,.2685,370.,.2309,420.,.19$
35)/cond)
     
    ***  spline curve  ***
(stored S5RH is SPL5(:abt:,280.,1125.,310.,1104.,340.,1082.,380.,105$
1.,420.,1019.)/rho1)
(stored S5EN is SPL5(:abt:,280.,.0409,310.,.0107,340.,.00428,380.,.0$
0182,420.,.00097)/(RHO1*enul))
(stored S5CP is SPL5(:abt:,280.,2315.,310.,2464.,340.,2613.,380.,281$
1.,420.,3010.)/cp1)
(stored S5CN is SPL5(:abt:,280.,.2989,310.,.2761,340.,.2534,380.,.22$
34,420.,.1935)/cond)
   
    ***  piece-wise linear from files  ***
 
(stored LFRH is PWLF(/phoenics/d_earth/d_core/inplib/denprp.txt,:abt:)$
/rho1)
(stored LFEN is PWLF(/phoenics/d_earth/d_core/inplib/enuprp.txt,:abt:)/$
 (rho1*enul))
(stored LFCP is PWLF(/phoenics/d_earth/d_core/inplib/cpprp.txt,:abt:)/$
cp1)
(stored LFCN is PWLF(/phoenics/d_earth/d_core/inplib/cndprp.txt,:abt:)$
/cond)
  INFORM13END
LSWEEP=250;resfac=1.e-6;ISWC1=1
RELAX(U1,FALSDT,0.1);RELAX(V1,FALSDT,0.1);RELAX(W1,LINRLX,0.1)
TSTSWP=-1;LIBREF  =     763
libref
XZPR=F;IZPRF=NZ/2;IZPRL=NZ/2;NZPRIN=1
DISTIL=T
 EX(P1  )=3.798E-03;  EX(U1  )=6.416E-04;  EX(V1  )=1.697E-04
 EX(W1  )=1.482E-05;  EX(TEMP)=3.013E+02;  EX(ENT1)=7.360E+05
 EX(LFCN)=9.999E-01;  EX(S5CN)=1.000E+00;  EX(L3CN)=1.000E+00
 EX(LFCP)=1.000E+00;  EX(S5CP)=1.000E+00;  EX(L3CP)=1.000E+00
 EX(LFEN)=1.013E+00;  EX(S5EN)=1.020E+00;  EX(L3EN)=1.149E+00
 EX(ENUL)=2.479E-05;  EX(LFRH)=1.000E+00;  EX(S5RH)=1.000E+00
 EX(L3RH)=1.000E+00;  EX(COND)=2.828E-01;  EX(CP1 )=2.421E+03
 EX(RHO1)=1.109E+03
STOP