Difference between revisions of "Examples"

From ZCubes Wiki
Jump to navigation Jump to search
Line 11: Line 11:
 
'''Normal Calculation without using Function'''
 
'''Normal Calculation without using Function'''
 
*An exhaust pipe is 75mm diameter and it is cooled by surrounding it witha water jacket. The exhaust gas enters at 350C and the water enters at 10C. The surface heat transfer coefficients for the gas and water are 300 and 1500 W/m2K respectively. The wall is thin so the temperature drop due to conduction is negligible. The gasses have a mean specific heat capacity Cp of 1130 J/kgK and they must be cooled to 100C. The specific heat capacity of the water is 4190 J/kgK. The flow rate of the gas and water is 200 and 1400 kg/h respectively. Calculate the required length of pipe for parellel flow and contra flow.
 
*An exhaust pipe is 75mm diameter and it is cooled by surrounding it witha water jacket. The exhaust gas enters at 350C and the water enters at 10C. The surface heat transfer coefficients for the gas and water are 300 and 1500 W/m2K respectively. The wall is thin so the temperature drop due to conduction is negligible. The gasses have a mean specific heat capacity Cp of 1130 J/kgK and they must be cooled to 100C. The specific heat capacity of the water is 4190 J/kgK. The flow rate of the gas and water is 200 and 1400 kg/h respectively. Calculate the required length of pipe for parellel flow and contra flow.
 +
 +
 +
'''z3 code:'''<br>
 +
<source lang="cpp">
 +
//Overall Heat transfer coefficient
 +
//U = 1/((1/hg)+(1/hw)+(x/k))
 +
x = 0  //wall very thin
 +
//U = 1</>((1</>hg)+(1</>hw))
 +
 +
hg = 300(W/m2.degK)
 +
hw = 1500(W/m2.degK)
 +
cpg = 1130(J/kg.degK)
 +
cpw = 4190(J/kg.degK)
 +
mg = 200(kg/hr)
 +
mw = 1400(kg/hr)
 +
D = 75mm
 +
tg1 = 350degC<>degK
 +
tg2 = 100degC<>degK
 +
tw1 = 10degC<>degK
 +
 +
U = 1</>((1</>hg)<+>(1</>hw))
 +
delt = tg1<->tg2
 +
φ = mg<*>cpg<*>delt
 +
tw2 = tw1<+>(φ</>(mw<*>cpw))
 +
 +
 +
//Parallel flow
 +
delti = tg1<->tw1
 +
delt0 = tg2<->tw2
 +
A = φ<*>(log(delt0</>delti))</>(U<*>(delt0<->delti))
 +
L = A</>(π<*>D)
 +
//answer:1.48m
 +
 +
 +
//Contra Flow
 +
delti = tg1<->tw2
 +
delt0 = tg2<->tw1
 +
A = φ<*>(log(delt0</>delti))</>(U<*>(delt0<->delti))
 +
L = A</>(π<*>D)
 +
//answer:1.44m</source>

Revision as of 04:53, 29 January 2018

Engineering Examples of Java and z3 Programs


DESCRIPTION

  • Basic Engineering examples in z3.
  • z3 codes with z3 notations are shown below.
  • Set of cases progressively complex on units to show the user how it goes from simple to complex cases.
  • Reflecting different domains like engineering, statistics, medicine, etc.
  • Testing how we can make better solutions to the standard problems other software gives due to units.

Examples

ExampleS1: Chemical Engineering
Normal Calculation without using Function

  • An exhaust pipe is 75mm diameter and it is cooled by surrounding it witha water jacket. The exhaust gas enters at 350C and the water enters at 10C. The surface heat transfer coefficients for the gas and water are 300 and 1500 W/m2K respectively. The wall is thin so the temperature drop due to conduction is negligible. The gasses have a mean specific heat capacity Cp of 1130 J/kgK and they must be cooled to 100C. The specific heat capacity of the water is 4190 J/kgK. The flow rate of the gas and water is 200 and 1400 kg/h respectively. Calculate the required length of pipe for parellel flow and contra flow.


z3 code:

//Overall Heat transfer coefficient
//U = 1/((1/hg)+(1/hw)+(x/k))
x = 0  //wall very thin
//U = 1</>((1</>hg)+(1</>hw))

hg = 300(W/m2.degK)
hw = 1500(W/m2.degK)
cpg = 1130(J/kg.degK)
cpw = 4190(J/kg.degK)
mg = 200(kg/hr)
mw = 1400(kg/hr)
D = 75mm
tg1 = 350degC<>degK
tg2 = 100degC<>degK
tw1 = 10degC<>degK

U = 1</>((1</>hg)<+>(1</>hw))
delt = tg1<->tg2
φ = mg<*>cpg<*>delt
tw2 = tw1<+>(φ</>(mw<*>cpw))


//Parallel flow
delti = tg1<->tw1
delt0 = tg2<->tw2
A = φ<*>(log(delt0</>delti))</>(U<*>(delt0<->delti))
L = A</>(π<*>D)
//answer:1.48m


//Contra Flow
delti = tg1<->tw2
delt0 = tg2<->tw1
A = φ<*>(log(delt0</>delti))</>(U<*>(delt0<->delti))
L = A</>(π<*>D)
//answer:1.44m