! /INPUT,'attachment','inp',,1,0



FINISH
/CLEAR,START

/PREP7


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! update toolbar by menuctrl  !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!
*abbr,kpon,/pnum,kp,on
*abbr,kpoff,/pnum,kp,off
*abbr,lon,/pnum,line,on
*abbr,loff,/pnum,line,off
*abbr,aon,/pnum,area,on
*abbr,aoff,/pnum,area,off
*abbr,non,/pnum,node,on
*abbr,noff,/pnum,node,off

*abbr,perspectief,/vcone,1,15
*abbr,orthografisch,/vcone,1,0

*abbr,seethrough,/show,,,1
*abbr,solidview,/show,,,0

*abbr,herplot,/replot



*abbr,node_distance,*USE,distance_picking

*CREATE, distance_picking,,
/PMACRO
csys,0
cm,selected,node
nsel,s,p
node1 = NDNEXT(0)
node2 = NDNEXT(node1)

node1_x = NX(node1)
node1_y = NY(node1)
node1_z = NZ(node1)

node1_ux = UX(node1)
node1_uy = UY(node1)
node1_uz = UZ(node1)


node2_x = NX(node2)
node2_y = NY(node2)
node2_z = NZ(node2)

node2_ux = UX(node2)
node2_uy = UY(node2)
node2_uz = UZ(node2)

distance = (((node1_x+node1_ux)-(node2_x+node2_ux))**2+((node1_y+node1_uy)-(node2_y+node2_uy))**2+((node1_z+node1_uz)-(node2_z+node2_uz))**2)**0.5

*MSG,note,distance

cmsel,s,selected

*END



!!!!!!!!!!!!
! Set view !
!!!!!!!!!!!!

/EFACET,4			! Show quadratic elements following curves
/ANG,1,-90,ZS,1
/REP,FAST

axial_position					=	-0.260	!-0.02475	!-0.0335	!-0.0755


eccentricity_crucible_filler	=	0!-40E-6
eccentricity_filler_cont1		=	0!40E-6
eccentricity_cont1_cont2		=	0!40E-6
eccentricity_cont2_REFA			=	0!80E-6

eccentricity_TC					=	0 !0.00002


P_factor						=	1.0


gap1							=	120E-6
gap2							=	50E-6
gap3							=	185E-6
gap4							=	185E-6


Containment1_helium_content		=	1.0		! Don't change

Containment2_helium_content 	=   0.0		! Nominal load case
Containment2_nitrogen_content	=	0.0		! (If higher than 0.0, material data is overwritten and an interpolation is made for a Neon/Nitrogen mixture. No Helium)

REFA_helium_content   			=   0.0		! Nominal load case
REFA_nitrogen_content			=	0.0		! (If higher than 0.0, material data is overwritten and an interpolation is made for a Neon/Nitrogen mixture. No Helium)


heating_factor					=	1.0		! 1.0 : H4 position, nominal power
salt_heating_factor				=	1.0		! BOI: 1.0, MOI: 0.91, EOI: 1.071
heater_power_factor				=	0.0		! 1.0 : 3000 W/m,  L = 0.451, total power = 1732 Watts


Pressure0				=	105E5

Pressure1				=	13E5

Pressure2				=	10E5


water_convection				=	30000	! W/m2K, 30000 for forced cooling. 1000 for natural convection

shrink_factor					=	1.0		!0.995	! 0.5% Diameter reduction of graphite. 1.0 no shrinkage


Reference_temp			=	293	! K


solid_elem_size			=	0.004	!0.001

pi						=	acos(-1)


!!! Crucible !!!

dummygas = 0.001

crucible_r1				=	0.0200/2
crucible_r4				=	0.0070/2

crucible_h1				=	0.070	!0.075

separation_ring_h1		=	0.001	!0.003

bcrucible_salt_h1		=	0.070
crucible_salt_h1		=	0.035
tcrucible_salt_h1		=	0.0355


!!! REFA !!!

REFA_in					=	0.070/2
REFA_out				=	0.072/2


!!! Containment 2 !!!

containment2_tube_r1	=	REFA_in-gap4
containment2_tube_r2	=	0.066/2	


!!! Containment 1 !!!

containment1_tube_r1	=	containment2_tube_r2-gap3!0.0635/2
containment1_tube_r2	=	0.0605/2


!!! Thermocouples !!!

TC				=	1.1E-03/2
TC_L			=	1.7E-03/2
TCr				=	1.0E-03/2
TCin			=	18.5E-03/2	!23.5E-03/2 !+ 150E-6 - sleeve_quattro_gap
TC_open			=	0.5E-03/2
TCwt			=	0.0001

TC_amount		=	33


!!! Heaters

heater_amount	=	3

heater_in		=	(36E-03/2)*shrink_factor

heater_r0		=	0.0125/2
heater_r1		=	0.0122/2
heater_r2		=	0.0088/2
heater_r3		=	0.006/2

heater_gasgap	=	100E-6	!100E-6


!!! Flux detector !!!

fluxdetector_rad	=	0.0020/2


!!! Graphite filler

graphite_filler_r1		=	(containment1_tube_r2-gap2)*shrink_factor
graphite_filler_r3		=	(crucible_r1+gap1)*shrink_factor






!!!!!!!!!!!!!!!!!!!!
! Import materials !
!!!!!!!!!!!!!!!!!!!!


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!!Defenition of Materials !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

reference_temperature		=	293




!!!========================!!!
!!! Mat1: Aluminium 6061T6 !!!
!!!========================!!!

matnr_6061T6			=	1

MP,DENS,	matnr_6061T6,	2712.63
MP,NUXY,	matnr_6061T6,	0.33
MP,C,		matnr_6061T6,	962.964


MPTEMP,
MPTEMP,1,							273,		294.11,		366.33,		421.89,		477.44,		533	
MPTEMP,7,							573,		623,

MPDATA,	EX,		matnr_6061T6, 1,	69.718E9,	68.948E9,	66.190E9,	63.432E9,	59.984E9,	55.848E9,
MPDATA,	EX,		matnr_6061T6, 7,	52.869E9,	49.146E9,


MPTEMP,
MPTEMP,1,							273,		294.11,		310.78,		338.56,		366.33,		394.11,
MPTEMP,7,							421.89,		449.67,		477.44,		523,		573,		623,

MPDATA,	KXX,	matnr_6061T6, 1,	164.612,	166.176,	167.559,	169.461,	171.190,	172.574,
MPDATA,	KXX,	matnr_6061T6, 7,	173.957,	175.167,	176.205,	177.379,	178.145,	178.316,


MPTEMP,
MPTEMP,1,							273,		294.11,		310.78,		338.56,		366.33,		394.11,
MPTEMP,7,							421.89,		449.67,		477.44,		505.22,		533,		560.78,
MPTEMP,13,							588.56,		598,		623

MPDATA,	ALPX,	matnr_6061T6, 1,	2.110E-05,	2.178E-05,	2.232E-05,	2.286E-05,	2.340E-05,	2.358E-05,
MPDATA,	ALPX,	matnr_6061T6, 7,	2.394E-05,	2.412E-05,	2.448E-05,	2.484E-05,	2.502E-05,	2.538E-05,
MPDATA,	ALPX,	matnr_6061T6, 13,	2.556E-05,	2.562E-05,	2.578E-05


!!!===================!!!
!!! Mat5: Inconel 600 !!!
!!!===================!!!

matnr_inc600			=	5

MP,DENS,		matnr_inc600,			8470
MP,C,			matnr_inc600,			250

MPTEMP,
MPTEMP,1,								293.00,		373.00,		473.00,		573.00,		673.00,		773.00
MPTEMP,7,								873.00,		973.00,		1073.00,	1173.00,	1273.00
!
MPDATA,	KXX,	matnr_inc600, 1,		14.9,		15.9,		17.3,		19.0,		20.5,		22.1
MPDATA,	KXX,	matnr_inc600, 7,		23.9,		25.7,		27.5,		27.5,		27.5
!
MPDATA,	ALPX,	matnr_inc600, 1,		10.4E-6,	13.3E-6,	13.8E-6,	14.2E-6,	14.5E-6,	14.9E-6
MPDATA,	ALPX,	matnr_inc600, 7,		15.3E-6,	15.8E-6,	16.1E-6,	16.4E-6,	16.4E-6,
!
MPDATA,	EX,		matnr_inc600, 1,		214E+9,		210E+9,		205E+9,		199E+9,		193E+9,		187E+9
MPDATA,	EX,		matnr_inc600, 7,		180E+9,		172E+9,		164E+9,		154E+9,		143E+9,
!
MPDATA,NUXY,	matnr_inc600, 1,		0.324,		0.319,		0.314,		0.306,		0.301,		0.300,
MPDATA,NUXY,	matnr_inc600, 7,		0.301,		0.305,		0.320,		0.330,		0.339,


!!!==================================================================!!!
!!! Mat6: Hasteloy  (properties by I&D, unless specified otherwise)  !!!
!!!==================================================================!!!

matnr_hastelloy		=	6

MP,DENS,	matnr_hastelloy,		8860
MP,NUXY,	matnr_hastelloy,		0.31		! Nickel
MP,C,		matnr_hastelloy,		440			! Nickel

MPTEMP,
MPTEMP,1,							473.00,		573.00,		673.00,		773.00,		873.00,		973.00,
!
MPDATA,	KXX,	matnr_hastelloy, 1,	13.1,		14.4,		16.5,		18.0,		20.3,		23.6
!
MPTEMP,
MPTEMP,1,							293.00,		473.00,		573.00,		673.00,		773.00,		873.00
MPTEMP,7,							973.00,		1073.00,	1173.00,	1273,
!
MPDATA,	EX,	matnr_hastelloy, 1,		219E+9,		204E+9,		198E+9,		192E+9,		186.5E+9,	181E+9
MPDATA,	EX,	matnr_hastelloy, 7,		171E+9,		163E+9,		151E+9,		136E+9,
!
MPTEMP,
MPTEMP,1,							473.00,		573.00,		673.00,		773.00,		873.00,		973.00
MPTEMP,7,							1073.00,	1173.00,
!
MPDATA,	ALPX,	matnr_hastelloy, 1,	12.3E-6,	12.7E-6,	13.0E-6,	13.2E-6,	13.4E-6,	13.8E-6
MPDATA,	ALPX,	matnr_hastelloy, 7,	14.5E-6,	14.9E-6,


!!!===========!!!
!!! Mat8: TZM !!! NOT USED!
!!!===========!!!

matnr_TZM			=	8

MP,DENS,		matnr_TZM,			10280
MP,NUXY,		matnr_TZM,			0.3
MP,C,			matnr_TZM,			250

MPTEMP,
MPTEMP,1,							473.00,		673.00,		873.00,		1073.00,	1273.00,	1473.00
MPTEMP,7,							1673.00,
!
MPDATA,	KXX,	matnr_TZM, 1,		115,		112,		109,		106,		104,		101
MPDATA,	KXX,	matnr_TZM, 7,		98,
!
MPDATA,	ALPX,	matnr_TZM, 1,		5.330E-6,	5.470E-6,	5.610E-6,	5.750E-6,	5.880E-6,	6.030E-6
MPDATA,	ALPX,	matnr_TZM, 7,		6.160E-6,
!
MPDATA,	EX,		matnr_TZM, 1,		313E+9,		304E+9,		296E+9,		288E+9,		275E+9,		262E+9
MPDATA,	EX,		matnr_TZM, 7,		247E+9,



!!!================!!!
!!! Mat9: Graphite !!! NBG-18
!!!================!!!

matnr_graph			=	9

MP,DENS,		matnr_graph,		1840*(1/(shrink_factor**2))	!1858
MP,NUXY,		matnr_graph,		0.2		!0.18
MP,C,			matnr_graph,		250
MP,ALPX,		matnr_graph,		5.5E-6	!3.7E-6
MP,EX,			matnr_graph,		14E+9	!EOI 21E+9			!10.7E+9				! 7E+9

MP,KXX,			matnr_graph,		33		!30

! MPTEMP,
! MPTEMP,1,							298.00,		373.00,		473.00,		573.00,		673.00,		773.00
! MPTEMP,7,							873.00,		973.00,		1023,
! !
! MPDATA,	KXX,	matnr_graph, 1,		25.80732,		29.73175,		32.40403,		33.62684,		34.83415,		35.53862
! MPDATA,	KXX,	matnr_graph, 7,		35.00024,		34.28050,		34.46019






!!!===============================!!!
!!! Mat: Heater /  graphite / gas !!! ERROR CHECK ALL PROPERTIES
!!!===============================!!!

matnr_heater		=	99

MP,DENS,		matnr_heater,		5809.241685			! Smeared material properties, density according to HeaterProperties.xlsx
MP,NUXY,		matnr_heater,		0.2		!0.3
MP,C,			matnr_heater,		250
MP,ALPX,		matnr_heater,		5.5E-6	!3.7E-6				! 3.8E-6
MP,EX,			matnr_heater,		14E+9				!EOI 21E+9			!10.7E+9				! 7E+9

MP,KXX,			matnr_heater,		18	!18	!30			! Tuned such that the temperature profiles of the axial model match with that of the radial model. ERROR
MP,KYY,			matnr_heater,		15.75				! Conductivity steel:21 @ about 500C, 21*(12**2-6**2)/12**2, = 21*0.75
MP,KZZ,			matnr_heater,		33	!30


!!!===================!!!
!!! Mat: Heater / gas !!! ERROR CHECK ALL PROPERTIES
!!!===================!!!

matnr_heateringas		=	98

MP,DENS,		matnr_heateringas,		5809.241685			!5996.609425	!5842.148721	!6023.61	! Density steel: 8031.48, 8031.48*(12**2-6**2)/12**2, = 8031.48*0.75
MP,NUXY,		matnr_heateringas,		0.2		!0.3
MP,C,			matnr_heateringas,		250
MP,ALPX,		matnr_heateringas,		5.5E-6	!3.7E-6				! 3.8E-6
MP,EX,			matnr_heateringas,		10.7E+9				! 7E+9

MP,KXX,			matnr_heateringas,		18/3				! 2/3 of circumference is gas.
MP,KYY,			matnr_heateringas,		15.75				! Conductivity steel:21 @ about 500C, 21*(12**2-6**2)/12**2, = 21*0.75
MP,KZZ,			matnr_heateringas,		0.3



!!!========================!!!
!!! Mat199:AISI 316 heater !!!	NO LONGER IN USE
!!!========================!!!

matnr_AISI316_heater		=	199

MP,DENS,	matnr_AISI316_heater,		8031.48

MPTEMP,
MPTEMP,1,							273,		323,		373,		423,		473,		523	
MPTEMP,7,							573,		623,		673,		723,		773,		823	
MPTEMP,13,							873,		923,		973,		1023,		1073,		1123	
MPTEMP,19,							1173,		1223,		1273
!
MPDATA,	KXX,	matnr_AISI316_heater, 1,	13.286,		14.151,		14.992,		15.813,		16.617,		17.407
MPDATA,	KXX,	matnr_AISI316_heater, 7,	18.186,		18.958,		19.725,		20.491,		21.259,		22.032
MPDATA,	KXX,	matnr_AISI316_heater, 13,	22.814,		23.607,		24.416,		25.243,		26.091,		26.964
MPDATA,	KXX,	matnr_AISI316_heater, 19,	27.864,		28.796,		29.762
!
MPDATA,	ALPX,	matnr_AISI316_heater, 1,	1.632E-5,	1.656E-5,	1.679E-5,	1.702E-5,	1.724E-5,	1.745E-5
MPDATA,	ALPX,	matnr_AISI316_heater, 7,	1.765E-5,	1.784E-5,	1.802E-5,	1.820E-5,	1.837E-5,	1.853E-5
MPDATA,	ALPX,	matnr_AISI316_heater, 13,	1.868E-5,	1.882E-5,	1.896E-5,	1.908E-5,	1.920E-5,	1.931E-5
MPDATA,	ALPX,	matnr_AISI316_heater, 19,	1.941E-5,	1.951E-5,	1.959E-5
!
MPDATA,	C,	matnr_AISI316_heater, 1,		456.282,	476.568,	494.231,	509.535,	522.742,	534.116
MPDATA,	C,	matnr_AISI316_heater, 7,		543.919,	552.415,	559.867,	566.537,	572.689,	578.586
MPDATA,	C,	matnr_AISI316_heater, 13,		584.491,	590.667,	597.377,	604.884,	613.451,	623.341
MPDATA,	C,	matnr_AISI316_heater, 19,		634.818,	648.144,	663.582
!
MPTEMP,
MPTEMP,1,							273,		1073,		1273,
!
MPDATA,	EX,	matnr_AISI316_heater, 1,		200.333E+9,	135.373E+9,	61.133E+9,
!
MPDATA,	NUXY,	matnr_AISI316_heater, 1,	0.2921,		0.3495,		0.3638,


!!!========================!!!
!!! Brass / heater smeared !!!
!!!========================!!!

matnr_ms58_heater		=	399

MP,DENS,		matnr_ms58_heater,			7035.137		! Calculated with Excel sheet
MP,EX,			matnr_ms58_heater,			97E9
MP,C,			matnr_ms58_heater,			377
MP,NUXY,		matnr_ms58_heater,			0.331			!	Brass, 70-30
!
MPTEMP,
MPTEMP,1,									73,			293,
!
MPDATA,	KXX,	matnr_ms58_heater, 1,		50/2,		123/2,
!
MPTEMP,
MPTEMP,1,									373,		473,		573,		1073,
!
MPDATA,	ALPX,	matnr_ms58_heater, 1,		19.3E-6,	21.0E-6,	21.4E-6,	24.7E-6,



!!!============================!!!
!!!        Brass, Ms58 		   !!!
!!! Brass_ms58_properties.pdf  !!!
!!!============================!!!

matnr_ms58		=	333

MP,DENS,	matnr_ms58,		8470
MP,EX,		matnr_ms58,		97E9
MP,C,		matnr_ms58,		377
MP,NUXY,	matnr_ms58,		0.331			!	Brass, 70-30
!
MPTEMP,
MPTEMP,1,							73,		293,
!
MPDATA,	KXX,	matnr_ms58, 1,		50,		123,
!
MPTEMP,
MPTEMP,1,							373,		473,		573,		1073,
!
MPDATA,	ALPX,	matnr_ms58, 1,		19.3E-6,	21.0E-6,	21.4E-6,	24.7E-6,


!!!============================!!!
!!!        Filament, smeared   !!!
!!!============================!!!

matnr_filamentsmeared		=	277

MP,DENS,	matnr_filamentsmeared,		5364
MP,EX,		matnr_filamentsmeared,		97E9
MP,C,		matnr_filamentsmeared,		377
MP,NUXY,	matnr_filamentsmeared,		0.331			!	Brass, 70-30
!
MPTEMP,
MPTEMP,1,							73,		293,
!
MPDATA,	KXX,	matnr_filamentsmeared, 1,		50,		123,
!
MPTEMP,
MPTEMP,1,							373,		473,		573,		1073,
!
MPDATA,	ALPX,	matnr_filamentsmeared, 1,		19.3E-6,	21.0E-6,	21.4E-6,	24.7E-6,




!!!==================!!!
!!! Mat31: matnr_lif !!!	For salt pooling in bottom of containment
!!!==================!!!

matnr_lif		=	31

MP,DENS,	matnr_lif,	4683		! 4270		! 5177
MP,EX,		matnr_lif,	1000
MP,NUXY,	matnr_lif,	0.3
MP,C,		matnr_lif,	1000
MP,KXX,		matnr_lif,	5			! Solid salt, use 1.5 for fluid?
MP,ALPX,	matnr_lif,	0



!!!========================!!!
!!! Mat31: matnr_lif_dummy !!!	For visualization reasons. Salt added but no significant heat transport
!!!========================!!!

matnr_lif_dummy		=	311

MP,DENS,	matnr_lif_dummy,	4683
MP,EX,		matnr_lif_dummy,	1000
MP,NUXY,	matnr_lif_dummy,	0.3
MP,C,		matnr_lif_dummy,	1000
MP,KXX,		matnr_lif_dummy,	0.0001	! Low conductivity as not to transport significant heat as it would influence the CFD generated boundary condition
MP,ALPX,	matnr_lif_dummy,	0



!!!====================!!!
!!! Mat32: matnr_flibe !!!	Not used in current Salient
!!!====================!!!

matnr_flibe		=	32

MP,DENS,	matnr_flibe,	0
MP,EX,		matnr_flibe,	1000
MP,NUXY,	matnr_flibe,	0.3
MP,C,		matnr_flibe,	1550
MP,KXX,		matnr_flibe,	1.5
MP,ALPX,	matnr_flibe,	0


!!!=================================================!!!
!!!   Mat33: Thermocouple magnesium oxide powder    !!! See reference, 
!!!=================================================!!!

matnr_mgo		=	33

MP,DENS,	matnr_mgo,		3600
MP,NUXY,	matnr_mgo,		0.30
MP,C,		matnr_mgo,		877
MP,KXX,		matnr_mgo,		2.00
MP,EX,		matnr_mgo,		1000
MP,ALPX,	matnr_mgo,		1.87E-5


!!!================!!!
!!! Mat4: Zirconia !!!	Or equivalent. 
!!!================!!!

matnr_zirconia			=	4

MP,DENS,	matnr_zirconia,		5680			! Guestimate
MP,EX,		matnr_zirconia,		210E9
MP,NUXY,	matnr_zirconia,		0.3				! ERROR, no reference
MP,C,		matnr_zirconia,		500				! ERROR, no reference
MP,KXX,		matnr_zirconia,		1.675 			! ERROR, no temperature dependent thermal conductivity????
!MP,ALPX,	matnr_zirconia,		7.0E-6

!!! WARNING !!! expansion is set similar to steel to prevent unrealistic stresses
MPTEMP,
MPTEMP,1,							273,		323,		373,		423,		473,		523	
MPTEMP,7,							573,		623,		673,		723,		773,		823	
MPTEMP,13,							873,		923,		973,		1023,		1073,		1123	
MPTEMP,19,							1173,		1223,		1273
!
MPDATA,	ALPX,	matnr_zirconia, 1,	1.632E-5,	1.656E-5,	1.679E-5,	1.702E-5,	1.724E-5,	1.745E-5
MPDATA,	ALPX,	matnr_zirconia, 7,	1.765E-5,	1.784E-5,	1.802E-5,	1.820E-5,	1.837E-5,	1.853E-5
MPDATA,	ALPX,	matnr_zirconia, 13,	1.868E-5,	1.882E-5,	1.896E-5,	1.908E-5,	1.920E-5,	1.931E-5
MPDATA,	ALPX,	matnr_zirconia, 19,	1.941E-5,	1.951E-5,	1.959E-5



!!!====================================================!!!
!!! Mat34: Hasteloy / Thermocouple smeared properties  !!!
!!!====================================================!!!

matnr_hastc	=	34				

MP,DENS,	matnr_hastc,		6898.89		! Hastelloy, Inconel600, MgO and Helium smeared (Calculated with radial model)
MP,NUXY,	matnr_hastc,		0.31		! Nickel
MP,C,		matnr_hastc,		440			! Nickel

MPTEMP,
MPTEMP,1,						473.00,		573.00,		673.00,		773.00,		873.00,		973.00,
!
CF	=	0.4176								! Calculated with radial model @ 1000 K
MPDATA,	KXX,	matnr_hastc, 1,	13.1*CF,	14.4*CF,	16.5*CF,	18.0*CF,	20.3*CF,	23.6*CF
!
MPTEMP,
MPTEMP,1,						293.00,		473.00,		573.00,		673.00,		773.00,		873.00
MPTEMP,7,						973.00,		1073.00,	1173.00,	1273,
!
CF	=	0.1/1.5								! Thermocouple holes remove about 1.4 mm of material from this 1.5 mm section
!
MPDATA,	EX,	matnr_hastc, 1,		219E+9*CF,		204E+9*CF,		198E+9*CF,		192E+9*CF,		186.5E+9*CF,	181E+9*CF
MPDATA,	EX,	matnr_hastc, 7,		171E+9*CF,		163E+9*CF,		151E+9*CF,		136E+9*CF,
!
MPTEMP,
MPTEMP,1,						473.00,		573.00,		673.00,		773.00,		873.00,		973.00
MPTEMP,7,						1073.00,	1173.00,
!
MPDATA,	ALPX,	matnr_hastc, 1,	12.3E-6,	12.7E-6,	13.0E-6,	13.2E-6,	13.4E-6,	13.8E-6
MPDATA,	ALPX,	matnr_hastc, 7,	14.5E-6,	14.9E-6,




!!!===================!!!
!!! Mat7: AISI 321    !!!
!!!===================!!!

matnr_aisi321		=	7

MP,DENS,	matnr_aisi321,		7999.49
MP,NUXY,	matnr_aisi321,		0.29
MP,C,		matnr_aisi321,		502.42

MPTEMP,
MPTEMP,1,							273.00,		294.11,		310.78,		338.56,		366.33,		394.11
MPTEMP,7,							421.89,		449.67,		477.44,		505.22,		533.00,		560.78
MPTEMP,13,							588.56,		616.33,		644.11,		671.89,		699.67,		727.44
MPTEMP,19,							755.22,		783.00,		810.78,		838.56,		866.33,		894.11
MPTEMP,25,							921.89,		949.67,		977.44,		1005.22,	1033.00,	1060.78
MPTEMP,31,							1088.56,	1123.00,	1173.00,	1223.00,	1273.00
!
MPDATA,	KXX,	matnr_aisi321, 1,	13.96,		14.179,		14.352,		14.871,		15.217,		15.736
MPDATA,	KXX,	matnr_aisi321, 7,	16.082,		16.427,		16.946,		17.292,		17.638,		18.157
MPDATA,	KXX,	matnr_aisi321, 13,	18.502,		18.848,		19.367,		19.713,		20.059,		20.577
MPDATA,	KXX,	matnr_aisi321, 19,	20.923,		21.269,		21.615,		22.134,		22.48,		22.825
MPDATA,	KXX,	matnr_aisi321, 25,	23.171,		23.517,		23.863,		24.382,		24.727,		25.073
MPDATA,	KXX,	matnr_aisi321, 31,	25.419,		25.848,		26.471,		27.093,		27.716
!
MPDATA,	ALPX,	matnr_aisi321, 1,	1.507E-5,	1.530E-5,	1.548E-5,	1.584E-5,	1.602E-5,	1.638E-5
MPDATA,	ALPX,	matnr_aisi321, 7,	1.656E-5,	1.674E-5,	1.710E-5,	1.728E-5,	1.746E-5,	1.764E-5
MPDATA,	ALPX,	matnr_aisi321, 13,	1.764E-5,	1.782E-5,	1.800E-5,	1.800E-5,	1.818E-5,	1.818E-5
MPDATA,	ALPX,	matnr_aisi321, 19,	1.836E-5,	1.854E-5,	1.854E-5,	1.872E-5,	1.890E-5,	1.890E-5
MPDATA,	ALPX,	matnr_aisi321, 25,	1.908E-5,	1.908E-5,	1.926E-5,	1.926E-5,	1.944E-5,	1.944E-5
MPDATA,	ALPX,	matnr_aisi321, 31,	1.944E-5,	1.944E-5,	1.944E-5,	1.944E-5,	1.944E-5
!
MPTEMP,
MPTEMP,1,						273.00,		294.11,		366.33,		421.89,		477.44,		533.00
MPTEMP,7,						588.56,		644.11,		699.67,		755.22,		810.78,		866.33
MPTEMP,13,						921.89,		977.44,		1033.00,	1088.56,	1123.00,	1173.00
MPTEMP,19,						1223.00,	1273.00
!
MPDATA,	EX,	matnr_aisi321, 1,	196.355E+9,	195.122E+9,	190.295E+9,	186.158E+9,	182.711E+9,	177.885E+9
MPDATA,	EX,	matnr_aisi321, 7,	174.437E+9,	170.990E+9,	166.164E+9,	162.027E+9,	157.200E+9,	152.374E+9
MPDATA,	EX,	matnr_aisi321, 13,	146.169E+9,	139.274E+9,	132.379E+9,	124.795E+9,	120.093E+9,	113.267E+9
MPDATA,	EX,	matnr_aisi321, 19,	106.441E+9,	 99.615E+9
!



!!!=====================!!!
!!! Mat7: AISI 321 LD   !!!  Low Density (Slotted part)
!!!=====================!!!

matnr_aisi321_LD		=	77

RF						=	0.35						! Reduction factor

MP,DENS,	matnr_aisi321_LD,		7999.49*RF			! slotted part guestimate
MP,NUXY,	matnr_aisi321_LD,		0.29
MP,C,		matnr_aisi321_LD,		502.42

MPTEMP,
MPTEMP,1,								273.00,		294.11,		310.78,		338.56,		366.33,		394.11
MPTEMP,7,								421.89,		449.67,		477.44,		505.22,		533.00,		560.78
MPTEMP,13,								588.56,		616.33,		644.11,		671.89,		699.67,		727.44
MPTEMP,19,								755.22,		783.00,		810.78,		838.56,		866.33,		894.11
MPTEMP,25,								921.89,		949.67,		977.44,		1005.22,	1033.00,	1060.78
MPTEMP,31,								1088.56,	1123.00,	1173.00,	1223.00,	1273.00
!
MPDATA,	KXX,	matnr_aisi321_LD, 1,	13.96*RF,	14.179*RF,	14.352*RF,	14.871*RF,	15.217*RF,	15.736*RF
MPDATA,	KXX,	matnr_aisi321_LD, 7,	16.082*RF,	16.427*RF,	16.946*RF,	17.292*RF,	17.638*RF,	18.157*RF
MPDATA,	KXX,	matnr_aisi321_LD, 13,	18.502*RF,	18.848*RF,	19.367*RF,	19.713*RF,	20.059*RF,	20.577*RF
MPDATA,	KXX,	matnr_aisi321_LD, 19,	20.923*RF,	21.269*RF,	21.615*RF,	22.134*RF,	22.480*RF,	22.825*RF
MPDATA,	KXX,	matnr_aisi321_LD, 25,	23.171*RF,	23.517*RF,	23.863*RF,	24.382*RF,	24.727*RF,	25.073*RF
MPDATA,	KXX,	matnr_aisi321_LD, 31,	25.419*RF,	25.848*RF,	26.471*RF,	27.093*RF,	27.716*RF
!
MPDATA,	ALPX,	matnr_aisi321_LD, 1,	1.507E-5,	1.530E-5,	1.548E-5,	1.584E-5,	1.602E-5,	1.638E-5
MPDATA,	ALPX,	matnr_aisi321_LD, 7,	1.656E-5,	1.674E-5,	1.710E-5,	1.728E-5,	1.746E-5,	1.764E-5
MPDATA,	ALPX,	matnr_aisi321_LD, 13,	1.764E-5,	1.782E-5,	1.800E-5,	1.800E-5,	1.818E-5,	1.818E-5
MPDATA,	ALPX,	matnr_aisi321_LD, 19,	1.836E-5,	1.854E-5,	1.854E-5,	1.872E-5,	1.890E-5,	1.890E-5
MPDATA,	ALPX,	matnr_aisi321_LD, 25,	1.908E-5,	1.908E-5,	1.926E-5,	1.926E-5,	1.944E-5,	1.944E-5
MPDATA,	ALPX,	matnr_aisi321_LD, 31,	1.944E-5,	1.944E-5,	1.944E-5,	1.944E-5,	1.944E-5
!
MPTEMP,
MPTEMP,1,							273.00,			294.11,			366.33,			421.89,			477.44,			533.00
MPTEMP,7,							588.56,			644.11,			699.67,			755.22,			810.78,			866.33
MPTEMP,13,							921.89,			977.44,			1033.00,		1088.56,		1123.00,		1173.00
MPTEMP,19,							1223.00,		1273.00
!
MPDATA,	EX,	matnr_aisi321_LD, 1,	RF*196.355E+9,	RF*195.122E+9,	RF*190.295E+9,	RF*186.158E+9,	RF*182.711E+9,	RF*177.885E+9
MPDATA,	EX,	matnr_aisi321_LD, 7,	RF*174.437E+9,	RF*170.990E+9,	RF*166.164E+9,	RF*162.027E+9,	RF*157.200E+9,	RF*152.374E+9
MPDATA,	EX,	matnr_aisi321_LD, 13,	RF*146.169E+9,	RF*139.274E+9,	RF*132.379E+9,	RF*124.795E+9,	RF*120.093E+9,	RF*113.267E+9
MPDATA,	EX,	matnr_aisi321_LD, 19,	RF*106.441E+9,	RF*99.615E+9
!



!!!=====================!!!
!!! Mat7: AISI 321 LD2  !!!
!!!=====================!!!

matnr_aisi321_LD2		=	771

RF						=	0.5							! Reduction factor

MP,DENS,	matnr_aisi321_LD2,		7999.49*RF			! slotted part guestimate
MP,NUXY,	matnr_aisi321_LD2,		0.29
MP,C,		matnr_aisi321_LD2,		502.42

MPTEMP,
MPTEMP,1,								273.00,		294.11,		310.78,		338.56,		366.33,		394.11
MPTEMP,7,								421.89,		449.67,		477.44,		505.22,		533.00,		560.78
MPTEMP,13,								588.56,		616.33,		644.11,		671.89,		699.67,		727.44
MPTEMP,19,								755.22,		783.00,		810.78,		838.56,		866.33,		894.11
MPTEMP,25,								921.89,		949.67,		977.44,		1005.22,	1033.00,	1060.78
MPTEMP,31,								1088.56,	1123.00,	1173.00,	1223.00,	1273.00
!
MPDATA,	KXX,	matnr_aisi321_LD2, 1,	13.96*RF,	14.179*RF,	14.352*RF,	14.871*RF,	15.217*RF,	15.736*RF
MPDATA,	KXX,	matnr_aisi321_LD2, 7,	16.082*RF,	16.427*RF,	16.946*RF,	17.292*RF,	17.638*RF,	18.157*RF
MPDATA,	KXX,	matnr_aisi321_LD2, 13,	18.502*RF,	18.848*RF,	19.367*RF,	19.713*RF,	20.059*RF,	20.577*RF
MPDATA,	KXX,	matnr_aisi321_LD2, 19,	20.923*RF,	21.269*RF,	21.615*RF,	22.134*RF,	22.480*RF,	22.825*RF
MPDATA,	KXX,	matnr_aisi321_LD2, 25,	23.171*RF,	23.517*RF,	23.863*RF,	24.382*RF,	24.727*RF,	25.073*RF
MPDATA,	KXX,	matnr_aisi321_LD2, 31,	25.419*RF,	25.848*RF,	26.471*RF,	27.093*RF,	27.716*RF
!
MPDATA,	ALPX,	matnr_aisi321_LD2, 1,	1.507E-5,	1.530E-5,	1.548E-5,	1.584E-5,	1.602E-5,	1.638E-5
MPDATA,	ALPX,	matnr_aisi321_LD2, 7,	1.656E-5,	1.674E-5,	1.710E-5,	1.728E-5,	1.746E-5,	1.764E-5
MPDATA,	ALPX,	matnr_aisi321_LD2, 13,	1.764E-5,	1.782E-5,	1.800E-5,	1.800E-5,	1.818E-5,	1.818E-5
MPDATA,	ALPX,	matnr_aisi321_LD2, 19,	1.836E-5,	1.854E-5,	1.854E-5,	1.872E-5,	1.890E-5,	1.890E-5
MPDATA,	ALPX,	matnr_aisi321_LD2, 25,	1.908E-5,	1.908E-5,	1.926E-5,	1.926E-5,	1.944E-5,	1.944E-5
MPDATA,	ALPX,	matnr_aisi321_LD2, 31,	1.944E-5,	1.944E-5,	1.944E-5,	1.944E-5,	1.944E-5
!
MPTEMP,
MPTEMP,1,							273.00,			294.11,			366.33,			421.89,			477.44,			533.00
MPTEMP,7,							588.56,			644.11,			699.67,			755.22,			810.78,			866.33
MPTEMP,13,							921.89,			977.44,			1033.00,		1088.56,		1123.00,		1173.00
MPTEMP,19,							1223.00,		1273.00
!
MPDATA,	EX,	matnr_aisi321_LD2, 1,	RF*196.355E+9,	RF*195.122E+9,	RF*190.295E+9,	RF*186.158E+9,	RF*182.711E+9,	RF*177.885E+9
MPDATA,	EX,	matnr_aisi321_LD2, 7,	RF*174.437E+9,	RF*170.990E+9,	RF*166.164E+9,	RF*162.027E+9,	RF*157.200E+9,	RF*152.374E+9
MPDATA,	EX,	matnr_aisi321_LD2, 13,	RF*146.169E+9,	RF*139.274E+9,	RF*132.379E+9,	RF*124.795E+9,	RF*120.093E+9,	RF*113.267E+9
MPDATA,	EX,	matnr_aisi321_LD2, 19,	RF*106.441E+9,	RF*99.615E+9
!





!!!===================!!!
!!! Mat7: AISI 321 LS !!!
!!!===================!!!

matnr_aisi321_LS		=	777

MP,DENS,	matnr_aisi321_LS,		7999.49
MP,NUXY,	matnr_aisi321_LS,		0.29
MP,C,		matnr_aisi321_LS,		502.42
MP,EX,		matnr_aisi321_LS,		1000.00
MP,ALPX,	matnr_aisi321_LS,		0.00

MPTEMP,
MPTEMP,1,							273.00,		294.11,		310.78,		338.56,		366.33,		394.11
MPTEMP,7,							421.89,		449.67,		477.44,		505.22,		533.00,		560.78
MPTEMP,13,							588.56,		616.33,		644.11,		671.89,		699.67,		727.44
MPTEMP,19,							755.22,		783.00,		810.78,		838.56,		866.33,		894.11
MPTEMP,25,							921.89,		949.67,		977.44,		1005.22,	1033.00,	1060.78
MPTEMP,31,							1088.56,	1123.00,	1173.00,	1223.00,	1273.00
!
MPDATA,	KXX,	matnr_aisi321_LS, 1,	13.96,		14.179,		14.352,		14.871,		15.217,		15.736
MPDATA,	KXX,	matnr_aisi321_LS, 7,	16.082,		16.427,		16.946,		17.292,		17.638,		18.157
MPDATA,	KXX,	matnr_aisi321_LS, 13,	18.502,		18.848,		19.367,		19.713,		20.059,		20.577
MPDATA,	KXX,	matnr_aisi321_LS, 19,	20.923,		21.269,		21.615,		22.134,		22.48,		22.825
MPDATA,	KXX,	matnr_aisi321_LS, 25,	23.171,		23.517,		23.863,		24.382,		24.727,		25.073
MPDATA,	KXX,	matnr_aisi321_LS, 31,	25.419,		25.848,		26.471,		27.093,		27.716
!




!!!===================!!!
!!! Mat21: AISI 316 L !!!	ERROR
!!!===================!!!

matnr_AISI316		=	21

MP,DENS,	matnr_AISI316,		8031.48

MPTEMP,
MPTEMP,1,							273,		323,		373,		423,		473,		523	
MPTEMP,7,							573,		623,		673,		723,		773,		823	
MPTEMP,13,							873,		923,		973,		1023,		1073,		1123	
MPTEMP,19,							1173,		1223,		1273
!
MPDATA,	KXX,	matnr_AISI316, 1,	13.286,		14.151,		14.992,		15.813,		16.617,		17.407
MPDATA,	KXX,	matnr_AISI316, 7,	18.186,		18.958,		19.725,		20.491,		21.259,		22.032
MPDATA,	KXX,	matnr_AISI316, 13,	22.814,		23.607,		24.416,		25.243,		26.091,		26.964
MPDATA,	KXX,	matnr_AISI316, 19,	27.864,		28.796,		29.762
!
MPDATA,	ALPX,	matnr_AISI316, 1,	1.632E-5,	1.656E-5,	1.679E-5,	1.702E-5,	1.724E-5,	1.745E-5
MPDATA,	ALPX,	matnr_AISI316, 7,	1.765E-5,	1.784E-5,	1.802E-5,	1.820E-5,	1.837E-5,	1.853E-5
MPDATA,	ALPX,	matnr_AISI316, 13,	1.868E-5,	1.882E-5,	1.896E-5,	1.908E-5,	1.920E-5,	1.931E-5
MPDATA,	ALPX,	matnr_AISI316, 19,	1.941E-5,	1.951E-5,	1.959E-5
!
MPDATA,	C,	matnr_AISI316, 1,		456.282,	476.568,	494.231,	509.535,	522.742,	534.116
MPDATA,	C,	matnr_AISI316, 7,		543.919,	552.415,	559.867,	566.537,	572.689,	578.586
MPDATA,	C,	matnr_AISI316, 13,		584.491,	590.667,	597.377,	604.884,	613.451,	623.341
MPDATA,	C,	matnr_AISI316, 19,		634.818,	648.144,	663.582
!
MPTEMP,
MPTEMP,1,							273,		1073,		1273,
!
MPDATA,	EX,	matnr_AISI316, 1,		200.333E+9,	135.373E+9,	61.133E+9,
!
MPDATA,	NUXY,	matnr_AISI316, 1,	0.2921,		0.3495,		0.3638,


!!!===============================!!!
!!! Mat211: AISI 316 / TC smeared !!!
!!!===============================!!!

matnr_AISI316tc		=	211

MP,DENS,	matnr_AISI316tc,		6402.5	!8031.48

MPTEMP,
MPTEMP,1,								273,		323,		373,		423,		473,		523	
MPTEMP,7,								573,		623,		673,		723,		773,		823	
MPTEMP,13,								873,		923,		973,		1023,		1073,		1123	
MPTEMP,19,								1173,		1223,		1273
!
CF	=	0.4
MPDATA,	KXX,	matnr_AISI316tc, 1,		13.286*CF,		14.151*CF,		14.992*CF,		15.813*CF,		16.617*CF,		17.407*CF
MPDATA,	KXX,	matnr_AISI316tc, 7,		18.186*CF,		18.958*CF,		19.725*CF,		20.491*CF,		21.259*CF,		22.032*CF
MPDATA,	KXX,	matnr_AISI316tc, 13,	22.814*CF,		23.607*CF,		24.416*CF,		25.243*CF,		26.091*CF,		26.964*CF
MPDATA,	KXX,	matnr_AISI316tc, 19,	27.864*CF,		28.796*CF,		29.762*CF
!
MPDATA,	ALPX,	matnr_AISI316tc, 1,		1.632E-5,	1.656E-5,	1.679E-5,	1.702E-5,	1.724E-5,	1.745E-5
MPDATA,	ALPX,	matnr_AISI316tc, 7,		1.765E-5,	1.784E-5,	1.802E-5,	1.820E-5,	1.837E-5,	1.853E-5
MPDATA,	ALPX,	matnr_AISI316tc, 13,	1.868E-5,	1.882E-5,	1.896E-5,	1.908E-5,	1.920E-5,	1.931E-5
MPDATA,	ALPX,	matnr_AISI316tc, 19,	1.941E-5,	1.951E-5,	1.959E-5
!
MPDATA,	C,	matnr_AISI316tc, 1,			456.282,	476.568,	494.231,	509.535,	522.742,	534.116
MPDATA,	C,	matnr_AISI316tc, 7,			543.919,	552.415,	559.867,	566.537,	572.689,	578.586
MPDATA,	C,	matnr_AISI316tc, 13,		584.491,	590.667,	597.377,	604.884,	613.451,	623.341
MPDATA,	C,	matnr_AISI316tc, 19,		634.818,	648.144,	663.582
!
MPTEMP,
MPTEMP,1,							273,		1073,		1273,
!
MPDATA,	EX,	matnr_AISI316tc, 1,		200.333E+9,	135.373E+9,	61.133E+9,
!
MPDATA,	NUXY,	matnr_AISI316tc, 1,	0.2921,		0.3495,		0.3638,



!!!================================!!!
!!! Mat211: AISI 316 / gas smeared !!!
!!!================================!!!

matnr_AISI316gas		=	212

area_gas		=	(0.016-0.0111)*0.006+(0.0144-0.0111)*0.006-pi*(0.004/2)**2/2	! gas geometry
area_combined	=	pi*(0.017/2)**2-(0.011**2+pi*(0.004/2)**2)						! gas + steel geometry

mass_factor		=	(area_combined-area_gas)/area_combined

MP,DENS,	matnr_AISI316gas,	8031.48*mass_factor

MPTEMP,
MPTEMP,1,								273,		323,		373,		423,		473,		523	
MPTEMP,7,								573,		623,		673,		723,		773,		823	
MPTEMP,13,								873,		923,		973,		1023,		1073,		1123	
MPTEMP,19,								1173,		1223,		1273
!
CF	=	0.45		! Part of circumference touching
MPDATA,	KXX,	matnr_AISI316gas, 1,	13.286*CF,		14.151*CF,		14.992*CF,		15.813*CF,		16.617*CF,		17.407*CF
MPDATA,	KXX,	matnr_AISI316gas, 7,	18.186*CF,		18.958*CF,		19.725*CF,		20.491*CF,		21.259*CF,		22.032*CF
MPDATA,	KXX,	matnr_AISI316gas, 13,	22.814*CF,		23.607*CF,		24.416*CF,		25.243*CF,		26.091*CF,		26.964*CF
MPDATA,	KXX,	matnr_AISI316gas, 19,	27.864*CF,		28.796*CF,		29.762*CF
!
MPDATA,	ALPX,	matnr_AISI316gas, 1,	1.632E-5,	1.656E-5,	1.679E-5,	1.702E-5,	1.724E-5,	1.745E-5
MPDATA,	ALPX,	matnr_AISI316gas, 7,	1.765E-5,	1.784E-5,	1.802E-5,	1.820E-5,	1.837E-5,	1.853E-5
MPDATA,	ALPX,	matnr_AISI316gas, 13,	1.868E-5,	1.882E-5,	1.896E-5,	1.908E-5,	1.920E-5,	1.931E-5
MPDATA,	ALPX,	matnr_AISI316gas, 19,	1.941E-5,	1.951E-5,	1.959E-5
!
MPDATA,	C,	matnr_AISI316gas, 1,		456.282,	476.568,	494.231,	509.535,	522.742,	534.116
MPDATA,	C,	matnr_AISI316gas, 7,		543.919,	552.415,	559.867,	566.537,	572.689,	578.586
MPDATA,	C,	matnr_AISI316gas, 13,		584.491,	590.667,	597.377,	604.884,	613.451,	623.341
MPDATA,	C,	matnr_AISI316gas, 19,		634.818,	648.144,	663.582
!
MPTEMP,
MPTEMP,1,								273,		1073,		1273,
!
EF	=	0.45
MPDATA,	EX,	matnr_AISI316gas, 1,		200.333E+9*EF,	135.373E+9*EF,	61.133E+9*EF,
!
MPDATA,	NUXY,	matnr_AISI316gas, 1,	0.2921,		0.3495,		0.3638,



!!!=========================!!!
!!! Mat21: AISI 316 Samples !!!
!!!=========================!!!

matnr_AISI316_samples		=	22

RF						=	1 !5355/8031.48	!7589.65		! Reduction factor

MP,DENS,	matnr_AISI316_samples,		8031.48*RF
MP,EX,		matnr_AISI316_samples,		1000.00
MP,NUXY,	matnr_AISI316_samples,		0.29

MPTEMP,
MPTEMP,1,							273,		323,		373,		423,		473,		523	
MPTEMP,7,							573,		623,		673,		723,		773,		823	
MPTEMP,13,							873,		923,		973,		1023,		1073,		1123	
MPTEMP,19,							1173,		1223,		1273
!
MPDATA,	KXX,	matnr_AISI316_samples, 1,	13.286*RF,	14.151*RF,	14.992*RF,	15.813*RF,	16.617*RF,	17.407*RF
MPDATA,	KXX,	matnr_AISI316_samples, 7,	18.186*RF,	18.958*RF,	19.725*RF,	20.491*RF,	21.259*RF,	22.032*RF
MPDATA,	KXX,	matnr_AISI316_samples, 13,	22.814*RF,	23.607*RF,	24.416*RF,	25.243*RF,	26.091*RF,	26.964*RF
MPDATA,	KXX,	matnr_AISI316_samples, 19,	27.864*RF,	28.796*RF,	29.762*RF
!
MPDATA,	ALPX,	matnr_AISI316_samples, 1,	1.632E-5,	1.656E-5,	1.679E-5,	1.702E-5,	1.724E-5,	1.745E-5
MPDATA,	ALPX,	matnr_AISI316_samples, 7,	1.765E-5,	1.784E-5,	1.802E-5,	1.820E-5,	1.837E-5,	1.853E-5
MPDATA,	ALPX,	matnr_AISI316_samples, 13,	1.868E-5,	1.882E-5,	1.896E-5,	1.908E-5,	1.920E-5,	1.931E-5
MPDATA,	ALPX,	matnr_AISI316_samples, 19,	1.941E-5,	1.951E-5,	1.959E-5
!
MPDATA,	C,	matnr_AISI316_samples, 1,		456.282,	476.568,	494.231,	509.535,	522.742,	534.116
MPDATA,	C,	matnr_AISI316_samples, 7,		543.919,	552.415,	559.867,	566.537,	572.689,	578.586
MPDATA,	C,	matnr_AISI316_samples, 13,		584.491,	590.667,	597.377,	604.884,	613.451,	623.341
MPDATA,	C,	matnr_AISI316_samples, 19,		634.818,	648.144,	663.582
!
! MPTEMP,
! MPTEMP,1,							273,		1073,		1273,
! !
! MPDATA,	EX,	matnr_AISI316_samples, 1,		200.333E+9,	135.373E+9,	61.133E+9,
! !
! MPDATA,	NUXY,	matnr_AISI316_samples, 1,	0.2921,		0.3495,		0.3638,






!!! Non linear gas mixture conductivity interpolation

gas_table_height	=	6
gas_table_width		=	13

*DIM,gascond,TABLE,gas_table_height,gas_table_width,1, , ,

*SET,gascond(1,0,1),			0,		0.2,	0.4,	0.6,	0.8,	1
*SET,gascond(0,1,1),	300,	0.158,	0.118,	0.093,	0.074,	0.060,	0.050
*SET,gascond(0,2,1),	400,	0.190,	0.143,	0.113,	0.091,	0.073,	0.059
*SET,gascond(0,3,1),	500,	0.221,	0.168,	0.132,	0.107,	0.086,	0.068
*SET,gascond(0,4,1),	600,	0.251,	0.191,	0.151,	0.123,	0.098,	0.076
*SET,gascond(0,5,1),	700,	0.280,	0.214,	0.169,	0.137,	0.110,	0.084
*SET,gascond(0,6,1),	800,	0.308,	0.236,	0.187,	0.151,	0.121,	0.092
*SET,gascond(0,7,1),	900,	0.336,	0.257,	0.203,	0.164,	0.132,	0.100
*SET,gascond(0,8,1),	1000,	0.362,	0.277,	0.219,	0.176,	0.142,	0.108
*SET,gascond(0,9,1),	1100,	0.387,	0.296,	0.234,	0.188,	0.152,	0.115
*SET,gascond(0,10,1),	1200,	0.412,	0.314,	0.249,	0.198,	0.161,	0.122
*SET,gascond(0,11,1),	1300,	0.435,	0.331,	0.263,	0.208,	0.169,	0.129
*SET,gascond(0,12,1),	1400,	0.458,	0.347,	0.276,	0.217,	0.177,	0.136
*SET,gascond(0,13,1),	1500,	0.479,	0.362,	0.289,	0.225,	0.184,	0.143




!!!================================!!!
!!!   Gas vol 0 in crucibles 	   !!!
!!! 100% Argon (Source: Vargaftik) !!!
!!!================================!!!

matnr_gas0		=	10

MP,DENS,	matnr_gas0,		1.64
MP,ALPX,	matnr_gas0,		0.00
MP,EX,		matnr_gas0,		1000.00
MP,C,		matnr_gas0,		1000.00
MP,NUXY,	matnr_gas0,		0.1


MPTEMP,
MPTEMP,1,						300,	400,	500,	600,	700,
MPTEMP,6,						800,	900,	1000,	1100,	1200,
MPTEMP,11,						1300,	1400,	1500,	1600,	1700,
MPTEMP,16,						1800,	1900,	2000

MPDATA,	KXX,	matnr_gas0, 1,	0.0178,	0.0224,	0.0266,	0.0304,	0.0339,	
MPDATA,	KXX,	matnr_gas0, 6,	0.0378,	0.0404,	0.0434,	0.0463,	0.0491,	
MPDATA,	KXX,	matnr_gas0, 11,	0.0518,	0.0544,	0.057,	0.0595,	0.0619,	
MPDATA,	KXX,	matnr_gas0, 16,	0.0643,	0.0666,	0.0689



!!!============================!!!
!!!  Gas vol 1 in containment1 !!!
!!!        100%He-0%Ne         !!!
!!!============================!!!

matnr_gas1		=	11

cond_he			=	Containment1_helium_content
cond_ne			=	1.00-cond_he

MP,DENS,	matnr_gas1,		0.492
MP,ALPX,	matnr_gas1,		0.00
MP,EX,		matnr_gas1,		1000.00
MP,C,		matnr_gas1,		1000.00
MP,NUXY,	matnr_gas1,		0.1

MPTEMP,
MPTEMP,1,			300,			400,			500,			600,			700,
MPTEMP,6,			800,			900,			1000,			1100,			1200,
MPTEMP,11,			1300,			1400,			1500,

MPDATA,	KXX,	matnr_gas1, 1,	gascond(cond_ne,300),	gascond(cond_ne,400),	gascond(cond_ne,500),	gascond(cond_ne,600),	gascond(cond_ne,700),
MPDATA,	KXX,	matnr_gas1, 6,	gascond(cond_ne,800),	gascond(cond_ne,900),	gascond(cond_ne,1000),	gascond(cond_ne,1100),	gascond(cond_ne,1200)
MPDATA,	KXX,	matnr_gas1, 11,	gascond(cond_ne,1300),	gascond(cond_ne,1400),	gascond(cond_ne,1500),



!!!===========================!!!
!!! Gas vol 3 in containment2 !!!
!!!        100%He-0%Ne        !!!
!!!===========================!!!

matnr_gas2		=	12

cond_he			=	Containment2_helium_content
cond_ne			=	1.00-cond_he

MP,DENS,	matnr_gas2,		0.492
MP,ALPX,	matnr_gas2,		0.00
MP,EX,		matnr_gas2,		1000.00
MP,C,		matnr_gas2,		1000.00
MP,NUXY,	matnr_gas2,		0.1

MPTEMP,
MPTEMP,1,			300,			400,			500,			600,			700,
MPTEMP,6,			800,			900,			1000,			1100,			1200,
MPTEMP,11,			1300,			1400,			1500,

MPDATA,	KXX,	matnr_gas2, 1,	gascond(cond_ne,300),	gascond(cond_ne,400),	gascond(cond_ne,500),	gascond(cond_ne,600),	gascond(cond_ne,700),
MPDATA,	KXX,	matnr_gas2, 6,	gascond(cond_ne,800),	gascond(cond_ne,900),	gascond(cond_ne,1000),	gascond(cond_ne,1100),	gascond(cond_ne,1200)
MPDATA,	KXX,	matnr_gas2, 11,	gascond(cond_ne,1300),	gascond(cond_ne,1400),	gascond(cond_ne,1500),



!!!======================================!!!
!!! Gas Gap 4 between capsule and sleeve !!!
!!!             100%He-0%Ne              !!!
!!!======================================!!!

matnr_gas3		=	13

cond_he			=	REFA_helium_content
cond_ne			=	1.00-cond_he

MP,DENS,	matnr_gas3,		0.492
MP,ALPX,	matnr_gas3,		0.00
MP,EX,		matnr_gas3,		1000.00
MP,C,		matnr_gas3,		1000.00
MP,NUXY,	matnr_gas3,		0.1

MPTEMP,
MPTEMP,1,			300,			400,			500,			600,			700,
MPTEMP,6,			800,			900,			1000,			1100,			1200,
MPTEMP,11,			1300,			1400,			1500,

MPDATA,	KXX,	matnr_gas3, 1,	gascond(cond_ne,300),	gascond(cond_ne,400),	gascond(cond_ne,500),	gascond(cond_ne,600),	gascond(cond_ne,700),
MPDATA,	KXX,	matnr_gas3, 6,	gascond(cond_ne,800),	gascond(cond_ne,900),	gascond(cond_ne,1000),	gascond(cond_ne,1100),	gascond(cond_ne,1200)
MPDATA,	KXX,	matnr_gas3, 11,	gascond(cond_ne,1300),	gascond(cond_ne,1400),	gascond(cond_ne,1500),




!!!===========================!!!
!!! Gas vol 3 in containment2 !!!
!!!           100%N           !!!
!!!===========================!!!

*IF, Containment2_nitrogen_content, GT, 0,THEN

matnr_gas2		=	matnr_gas2

cond_n			=	Containment2_nitrogen_content
cond_ne			=	1.00-cond_n

MP,DENS,	matnr_gas2,		0.492
MP,ALPX,	matnr_gas2,		0.00
MP,EX,		matnr_gas2,		1000.00
MP,C,		matnr_gas2,		1000.00
MP,NUXY,	matnr_gas2,		0.1

MPTEMP,
MPTEMP,1,			270,				400,			500,			600,			800
MPTEMP,6,			900,				1000,			1200,			1400,			2000

MPDATA,	KXX,	matnr_gas2, 1,	(cond_n*0.02394+cond_ne*0.0454),(cond_n*0.0327+cond_ne*0.0593),(cond_n*0.0389+cond_ne*0.0688),(cond_n*0.0448+cond_ne*0.0777),(cond_n*0.0564+cond_ne*0.0942)
MPDATA,	KXX,	matnr_gas2, 6,	(cond_n*0.062+cond_ne*0.1018),(cond_n*0.0676+cond_ne*0.1092),(cond_n*0.0784+cond_ne*0.1232),(cond_n*0.08827+cond_ne*0.1363),(cond_n*0.1152+cond_ne*0.1717)

*ELSE
*ENDIF


!!!======================================!!!
!!! Gas Gap 4 between capsule and sleeve !!!
!!!                100%N                 !!!
!!!======================================!!!

*IF, REFA_nitrogen_content, GT, 0,THEN

matnr_gas3		=	matnr_gas3

cond_n			=	REFA_nitrogen_content
cond_ne			=	1.00-cond_n

MP,DENS,	matnr_gas3,		0.492
MP,ALPX,	matnr_gas3,		0.00
MP,EX,		matnr_gas3,		1000.00
MP,C,		matnr_gas3,		1000.00
MP,NUXY,	matnr_gas3,		0.1

MPTEMP,
MPTEMP,1,			270,			400,			500,			600,			800
MPTEMP,6,			900,			1000,			1200,			1400,			2000

MPDATA,	KXX,	matnr_gas3, 1,	(cond_n*0.02394+cond_ne*0.0454),(cond_n*0.0327+cond_ne*0.0593),(cond_n*0.0389+cond_ne*0.0688),(cond_n*0.0448+cond_ne*0.0777),(cond_n*0.0564+cond_ne*0.0942)
MPDATA,	KXX,	matnr_gas3, 6,	(cond_n*0.062+cond_ne*0.1018),(cond_n*0.0676+cond_ne*0.1092),(cond_n*0.0784+cond_ne*0.1232),(cond_n*0.08827+cond_ne*0.1363),(cond_n*0.1152+cond_ne*0.1717)

*ELSE
*ENDIF







!!!=========!!!
!!! Mat: PT !!! Based on AISI321
!!!=========!!!

matnr_PT			=	41

MP,DENS,	matnr_PT,		7779	!4260
MP,NUXY,	matnr_PT,		0.29
MP,C,		matnr_PT,		502.42

MPTEMP,
MPTEMP,1,							273.00,		294.11,		310.78,		338.56,		366.33,		394.11
MPTEMP,7,							421.89,		449.67,		477.44,		505.22,		533.00,		560.78
MPTEMP,13,							588.56,		616.33,		644.11,		671.89,		699.67,		727.44
MPTEMP,19,							755.22,		783.00,		810.78,		838.56,		866.33,		894.11
MPTEMP,25,							921.89,		949.67,		977.44,		1005.22,	1033.00,	1060.78
MPTEMP,31,							1088.56,	1123.00,	1173.00,	1223.00,	1273.00
!
MPDATA,	KXX,	matnr_PT, 1,	13.96,		14.179,		14.352,		14.871,		15.217,		15.736
MPDATA,	KXX,	matnr_PT, 7,	16.082,		16.427,		16.946,		17.292,		17.638,		18.157
MPDATA,	KXX,	matnr_PT, 13,	18.502,		18.848,		19.367,		19.713,		20.059,		20.577
MPDATA,	KXX,	matnr_PT, 19,	20.923,		21.269,		21.615,		22.134,		22.48,		22.825
MPDATA,	KXX,	matnr_PT, 25,	23.171,		23.517,		23.863,		24.382,		24.727,		25.073
MPDATA,	KXX,	matnr_PT, 31,	25.419,		25.848,		26.471,		27.093,		27.716
!
MPDATA,	ALPX,	matnr_PT, 1,	1.507E-5,	1.530E-5,	1.548E-5,	1.584E-5,	1.602E-5,	1.638E-5
MPDATA,	ALPX,	matnr_PT, 7,	1.656E-5,	1.674E-5,	1.710E-5,	1.728E-5,	1.746E-5,	1.764E-5
MPDATA,	ALPX,	matnr_PT, 13,	1.764E-5,	1.782E-5,	1.800E-5,	1.800E-5,	1.818E-5,	1.818E-5
MPDATA,	ALPX,	matnr_PT, 19,	1.836E-5,	1.854E-5,	1.854E-5,	1.872E-5,	1.890E-5,	1.890E-5
MPDATA,	ALPX,	matnr_PT, 25,	1.908E-5,	1.908E-5,	1.926E-5,	1.926E-5,	1.944E-5,	1.944E-5
MPDATA,	ALPX,	matnr_PT, 31,	1.944E-5,	1.944E-5,	1.944E-5,	1.944E-5,	1.944E-5
!
MPTEMP,
MPTEMP,1,						273.00,		294.11,		366.33,		421.89,		477.44,		533.00
MPTEMP,7,						588.56,		644.11,		699.67,		755.22,		810.78,		866.33
MPTEMP,13,						921.89,		977.44,		1033.00,	1088.56,	1123.00,	1173.00
MPTEMP,19,						1223.00,	1273.00
!
MPDATA,	EX,	matnr_PT, 1,	196.355E+9,	195.122E+9,	190.295E+9,	186.158E+9,	182.711E+9,	177.885E+9
MPDATA,	EX,	matnr_PT, 7,	174.437E+9,	170.990E+9,	166.164E+9,	162.027E+9,	157.200E+9,	152.374E+9
MPDATA,	EX,	matnr_PT, 13,	146.169E+9,	139.274E+9,	132.379E+9,	124.795E+9,	120.093E+9,	113.267E+9
MPDATA,	EX,	matnr_PT, 19,	106.441E+9,	 99.615E+9




!!!===========!!!
!!! Mat: LVDT !!! Based on inconel 600
!!!===========!!!

matnr_LVDT			=	42

MP,DENS,		matnr_LVDT,			3686	!4000
MP,C,			matnr_LVDT,			250

MPTEMP,
MPTEMP,1,								293.00,		373.00,		473.00,		573.00,		673.00,		773.00
MPTEMP,7,								873.00,		973.00,		1073.00,	1173.00,	1273.00
!
MPDATA,	KXX,	matnr_LVDT, 1,		14.9,		15.9,		17.3,		19.0,		20.5,		22.1
MPDATA,	KXX,	matnr_LVDT, 7,		23.9,		25.7,		27.5,		27.5,		27.5
!
MPDATA,	ALPX,	matnr_LVDT, 1,		10.4E-6,	13.3E-6,	13.8E-6,	14.2E-6,	14.5E-6,	14.9E-6
MPDATA,	ALPX,	matnr_LVDT, 7,		15.3E-6,	15.8E-6,	16.1E-6,	16.4E-6,	16.4E-6,
!
MPDATA,	EX,		matnr_LVDT, 1,		214E+9,		210E+9,		205E+9,		199E+9,		193E+9,		187E+9
MPDATA,	EX,		matnr_LVDT, 7,		180E+9,		172E+9,		164E+9,		154E+9,		143E+9,
!
MPDATA,NUXY,	matnr_LVDT, 1,		0.324,		0.319,		0.314,		0.306,		0.301,		0.300,
MPDATA,NUXY,	matnr_LVDT, 7,		0.301,		0.305,		0.320,		0.330,		0.339,



!!!===============================!!!!
!!! Mat22: Solder (silver-copper) !!!!
!!!===============================!!!!

matnr_solder			=	22

MP,DENS,	matnr_solder,		10100
MP,NUXY,	matnr_solder,		0.37
MP,C,		matnr_solder,		240
MP,KXX,		matnr_solder,		429*(3/48)
MP,EX,		matnr_solder,		83E9
MP,ALPX,	matnr_solder,		1.890E-5


!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! Definition of element types !
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

ET,1,77, ,0,0	!ET,1,55, ,0,0				! Quadratic 2D thermal element 77, use linear type 55 for ANSYS version 16.0 and above



SAVE,beforesleeve,db

RESUME,beforesleeve,db

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! Crucible and thermocouples !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

WPCSYS,-1,0

NUMSTR,KP,17001
NUMSTR,LINE,17001
NUMSTR,AREA,17001

CSWPLA,13,0,1,1,
CSYS,13

SELTOL,1E-8

ASEL,NONE

CSYS,0

alpha_ini		=	0

alpha1			=	360/TC_amount

alpha			=	alpha_ini

*DO,LOOP,1,360/heater_amount/alpha1,1

  CYL4,0,0,crucible_r4,alpha,crucible_r4+((TCin-1.5E-3/2)-crucible_r4)*1,alpha+alpha1
  CYL4,0,0,crucible_r4+((TCin-1.5E-3/2)-crucible_r4)*1,alpha,crucible_r1,alpha+alpha1

  APTN,ALL

  alpha = alpha+alpha1

*ENDDO

NUMMRG,KP,1E-8

CSYS,1


SAVE

ASEL,NONE

CM,ThcHoles,AREA

NUMSTR,KP,17501
NUMSTR,LINE,17501
NUMSTR,AREA,17501

radius1			=	TC

alpha			=	alpha_ini-alpha1

*DO,LOOP,1,360/heater_amount/alpha1+1,1

  WPCSYS,-1,0 
  WPRO,alpha+alpha1,,

  ASEL,NONE

  CYL4,TCin,0,0,0,radius1,360
  RECTNG,TCin,graphite_filler_r3,-TC_open,TC_open,

  AADD,ALL

  CMSEL,A,ThcHoles
  CM,ThcHoles,AREA

  alpha = alpha+alpha1

*ENDDO

LSLA,S

ADELE,ALL

CM,ThcHoles,LINE

CSYS,1

LSEL,R,LOC,X,graphite_filler_r3

LDELE,ALL

ASEL,S,,,ALL

CMSEL,A,ThcHoles

ASBL,ALL,ThcHoles



radius1			=	TCr

inradius1		=	TCr-TCwt

alpha			=	alpha_ini-alpha1

*DO,LOOP,1,360/heater_amount/alpha1+1,1

  WPCSYS,-1,0 
  WPRO,alpha+alpha1,,

  CYL4,TCin+eccentricity_TC,0,inradius1,0,radius1,360

  alpha = alpha+alpha1

*ENDDO

APTN,ALL

AATT,matnr_hastelloy,1001		! Set to sleeve material


LSEL,S,LENGTH,,(TCr-TCwt)*2
LSEL,R,LOC,X,TCin+eccentricity_TC

ASLL,S

AATT,matnr_mgo,20501			! Set to thermocouple powder


LSEL,S,LENGTH,,TCwt
CSYS,1
LSEL,R,LOC,X,crucible_r4,crucible_r1

ASLL,S

AATT,matnr_inc600,20501		! Set to thermocouple tube


KSLL,S

LSLK,S

ASLL,S

ASEL,U,REAL,,20501

AATT,matnr_gas1,31001			! Set to gas gap

ALLSEL

CM,Crucible,AREA


SAVE

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! Graphite, containments and REFA !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

NUMSTR,KP,15001
NUMSTR,LINE,15001
NUMSTR,AREA,15001

CSYS,1

alpha			=	-360/heater_amount

*DO,LOOP,1,2,1

	CYL4,0,0,graphite_filler_r3,alpha,graphite_filler_r1,alpha+(360/heater_amount/2)
	CYL4,0,0,graphite_filler_r1,alpha,containment1_tube_r2,alpha+(360/heater_amount/2)
	CYL4,0,0,containment1_tube_r2,alpha,containment1_tube_r1,alpha+(360/heater_amount/2)
	CYL4,0,0,containment1_tube_r1,alpha,containment2_tube_r2,alpha+(360/heater_amount/2)
	CYL4,0,0,containment2_tube_r2,alpha,containment2_tube_r1,alpha+(360/heater_amount/2)
	CYL4,0,0,containment2_tube_r1,alpha,REFA_in,alpha+(360/heater_amount/2)
	CYL4,0,0,REFA_in,alpha,REFA_out,alpha+(360/heater_amount/2)

	APTN,ALL

	alpha = alpha+(360/heater_amount/2)

*ENDDO

APTN,ALL

KSEL,S,LOC,X,graphite_filler_r3,graphite_filler_r1
LSLK,S,1
ASLL,S,1
AATT,matnr_graph,15001

KSEL,S,LOC,X,graphite_filler_r1,containment1_tube_r2
LSLK,S,1
ASLL,S,1
AATT,matnr_gas1,31001

KSEL,S,LOC,X,containment1_tube_r2,containment1_tube_r1
LSLK,S,1
ASLL,S,1
AATT,matnr_inc600,10001

KSEL,S,LOC,X,containment1_tube_r1,containment2_tube_r2
LSLK,S,1
ASLL,S,1
AATT,matnr_gas2,32001

KSEL,S,LOC,X,containment2_tube_r2,containment2_tube_r1
LSLK,S,1
ASLL,S,1
AATT,matnr_aisi321,12001

KSEL,S,LOC,X,containment2_tube_r1,REFA_in
LSLK,S,1
ASLL,S,1
AATT,matnr_gas3,33001

KSEL,S,LOC,X,REFA_in,REFA_out
LSLK,S,1
ASLL,S,1
AATT,matnr_AISI316,20001



ASEL,S,mat,,matnr_inc600
LSLA,S,1
ASEL,INVE
LSLA,U,
ASLL,S,1
ADELE,ALL,,,1




SAVE,beforeheater,db

RESUME,beforeheater,db


!!!!!!!!!!!!!!!!!!!!!
!!! Insert heater !!!
!!!!!!!!!!!!!!!!!!!!!

filament_r1	= 1.5E-3/2	

!ASEL,S,REAL,,15001

ASEL,NONE

alpha	=	alpha_ini

WPCSYS,-1,0 
WPRO,alpha,,

CYL4,heater_in,0,0,0,(heater_r0+heater_gasgap)*shrink_factor,180

WPRO,360/heater_amount,,

CYL4,heater_in,0,0,0,(heater_r0+heater_gasgap)*shrink_factor,-180

AATT,matnr_gas1,31001

ASEL,S,REAL,,15001
CM,TEMP1,AREA
ASEL,S,REAL,,31001
CM,TEMP2,AREA
CMSEL,A,TEMP1
ASBA,TEMP1,TEMP2,,,KEEP
CMSEL,U,TEMP2
AATT,matnr_graph,15001

ASEL,NONE

WPCSYS,-1,0 
WPRO,alpha,,

CYL4,heater_in,0,heater_r1,0,heater_r0,180
AATT,matnr_AISI316,15701
ASEL,NONE
CYL4,heater_in,0,heater_r2,0,heater_r1,180
AATT,matnr_ms58_heater,15601
ASEL,NONE
CYL4,heater_in,0,heater_r3,0,heater_r2,180
AATT,matnr_ms58,15501
ASEL,NONE
!!! Insert return cables
CYL4,heater_in-filament_r1,0,filament_r1,0,0,180
CYL4,heater_in+filament_r1,0,filament_r1,0,0,180
AATT,matnr_filamentsmeared,15801
ASEL,NONE

WPRO,360/heater_amount,,

CYL4,heater_in,0,heater_r1,0,heater_r0,-180
AATT,matnr_AISI316,15701
ASEL,NONE
CYL4,heater_in,0,heater_r2,0,heater_r1,-180
AATT,matnr_ms58_heater,15601
ASEL,NONE
CYL4,heater_in,0,heater_r3,0,heater_r2,-180
AATT,matnr_ms58,15501
ASEL,NONE
!!! Insert return cables
CYL4,heater_in-filament_r1,0,filament_r1,0,0,-180
CYL4,heater_in+filament_r1,0,filament_r1,0,0,-180
AATT,matnr_filamentsmeared,15801
ASEL,NONE

ASEL,S,REAL,,15501
ASEL,A,REAL,,15601
ASEL,A,REAL,,15701
ASEL,A,REAL,,15801

ALLSEL,BELOW,AREA
NUMMRG,KP,1E-8


ASEL,S,REAL,,31001
CM,TEMP1,AREA
ASEL,S,REAL,,15501
ASEL,A,REAL,,15601
ASEL,A,REAL,,15701
ASEL,A,REAL,,15801
CM,TEMP2,AREA
CMSEL,A,TEMP1
ASBA,TEMP1,TEMP2,,,KEEP
CMSEL,U,TEMP2
AATT,matnr_gas1,31001


SAVE,beforegap,db

RESUME,beforegap,db

!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! Create gas gap areas !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!

NUMSTR,KP,31001
NUMSTR,LINE,31001
NUMSTR,AREA,31001

ASEL,NONE

CSYS,1

alpha	=	alpha_ini

KSEL,S,LOC,X,crucible_r1,graphite_filler_r3
KSEL,R,LOC,Y,alpha,

kplow1=kpnext(0)
kphigh1=kpnext(kplow1)
LSTR,kplow1,kphigh1

KSEL,S,LOC,X,crucible_r1,graphite_filler_r3
KSEL,R,LOC,Y,alpha+360/heater_amount,

kplow2=kpnext(0)
kphigh2=kpnext(kplow2)
LSTR,kplow2,kphigh2

KSEL,S,LOC,X,crucible_r1,graphite_filler_r3
LSLK,S,1

AL,ALL

AATT,matnr_gas1,31001



SAVE,beforemesh,db

RESUME,beforemesh,db

!!!!!!!!!!!!!!!!!!
!!! Mesh Areas !!!
!!!!!!!!!!!!!!!!!!


ESIZE,solid_elem_size,0,		! Set global element size



CSYS,1

LSEL,S,LOC,X,crucible_r1,containment1_tube_r2
LSEL,R,LENGTH,,containment1_tube_r2-crucible_r1

LESIZE,ALL, , ,1, ,1, , ,1,


LSEL,S,LOC,X,containment1_tube_r1,containment2_tube_r2
LSEL,R,LENGTH,,containment2_tube_r2-containment1_tube_r1

LESIZE,ALL, , ,1, ,1, , ,1,


LSEL,S,LOC,X,containment2_tube_r1,REFA_in
LSEL,R,LENGTH,,REFA_in-containment2_tube_r1

LESIZE,ALL, , ,1, ,1, , ,1,


LSEL,S,RADIUS,,TC

LESIZE,ALL, , ,2, ,1, , ,1,


LSEL,S,RADIUS,,TCr

LESIZE,ALL, , ,3, ,1, , ,1,

LSEL,R,LOC,X,0,TCin

LESIZE,ALL, , ,2, ,1, , ,1,


LSEL,S,RADIUS,,TCr-TCwt

LESIZE,ALL, , ,2, ,1, , ,1,


LSEL,S,RADIUS,,1.5E-3/2

LESIZE,ALL, , ,3, ,1, , ,1,

LSEL,R,LENGTH,,pi*1.5E-3/4

LESIZE,ALL, , ,4, ,1, , ,1,


LSEL,S,RADIUS,,1.4E-3/2

LESIZE,ALL, , ,4, ,1, , ,1,


LSEL,S,RADIUS,,heater_r1
LSEL,A,RADIUS,,(heater_r1+heater_gasgap)*shrink_factor

LESIZE,ALL, , ,20*(0.001/solid_elem_size), ,1, , ,1,

LSEL,S,RADIUS,,heater_r2
LSEL,A,RADIUS,,heater_r3

LESIZE,ALL, , ,20*(0.001/solid_elem_size), ,1, , ,1,



CSYS,1

KSEL,S,LOC,X,graphite_filler_r1,REFA_out
LSLK,S,1
ASLL,S,1


MSHKEY,1

AMESH,ALL

ALLSEL


AMAP,31001,kphigh1,kplow1,kplow2,kphigh2  



ESIZE,solid_elem_size,0,		! Set global element size

MSHKEY,0

!ASEL,U,REAL,,15501

AMESH,ALL


!!! Generate full model from partial model

CM,COPY_GROUP,AREA

CSYS,1
AGEN,heater_amount,COPY_GROUP,,,,-360/heater_amount,,,0


ALLSEL
NUMMRG,NODE,1e-08
NUMMRG,KP,1e-08

!!!!!!!!!!!!!!!!!!!!!!!!
!!! Create salt area !!!
!!!!!!!!!!!!!!!!!!!!!!!!

ASEL,NONE

CSYS,1

KSEL,S,LOC,X,crucible_r4

LSLK,S,1

AL,ALL

AATT,matnr_lif_dummy,1501

MSHKEY,0

AMESH,ALL



SAVE,beforereplace,db

RESUME,beforereplace,db

! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! !! Replace crucible by complete hastelloy cylinder !!!
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! CSYS,1

! KSEL,S,LOC,X,crucible_r4,crucible_r1

! LSLK,S,1

! ASLL,S,1

! KSEL,S,LOC,X,0,crucible_r4

! LSLK,S,1

! ASLL,U,1

! ESLA,S,1

! !ACLEAR,ALL

! EMODIF,ALL,MAT,matnr_hastelloy,

! !AATT,matnr_hastelloy,17001		! Set to sleeve material

! !AMESH,ALL


! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! !! Replace crucible / thermocouples by smeared property cylinder !!!
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! CSYS,1

! KSEL,S,LOC,X,TCin-(crucible_r1-TCin),crucible_r1

! LSLK,S,1

! ASLL,S,1

! KSEL,S,LOC,X,0,TCin-(crucible_r1-TCin)

! LSLK,S,1

! ASLL,U,1

! ESLA,S,1

! EMODIF,ALL,MAT,matnr_hastc,



! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
! !! Replace graphite and heaters by graphite cylinder !!!
! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

! CSYS,1

! KSEL,S,LOC,X,graphite_filler_r3,graphite_filler_r1

! LSLK,S,1

! ASLL,S,1

! KSEL,S,LOC,X,0,graphite_filler_r3

! LSLK,S,1

! ASLL,U,1

! ESLA,S,1

! EMODIF,ALL,MAT,matnr_graph,







! SAVE,beforedisplacement,db

! RESUME,beforedisplacement,db

! !!!!!!!!!!!!!!!!!!!!!!!!!!
! !!! eccentric position !!!
! !!!!!!!!!!!!!!!!!!!!!!!!!!

! NUMSTR,KP,23001
! NUMSTR,LINE,23001
! NUMSTR,AREA,23001

! ALLSEL

! KPRAD1		=	graphite_filler_r3
! KPRAD2		=	crucible_r1

! setKPANGLE		=	0
! setKPANGLE_INTERVAL	=	360/heater_amount/2


! CSYS,1

! KSEL,S,LOC,X,KPRAD2,KPRAD1

! LSLK,S,1

! ASLL,S,1

! ACLEAR,ALL

! ADELE,ALL,,,1


! KSEL,S,LOC,X,0,KPRAD2

! LSLK,S,1

! ASLL,S,1

! CSYS,0

! LOCAL,11,1,-(eccentricity_crucible_filler**2/2)**0.5,-(eccentricity_crucible_filler**2/2)**0.5,0, , , ,1,1,

! CSYS,1

! KSEL,S,LOC,X,0,KPRAD2

! LSLK,S,1

! ASLL,S,1

! CM,REPOSITION,AREA

! KSEL,S,LOC,X,KPRAD2,KPRAD1

! LSLK,S,1

! CM,TEMP,LINE

! CMSEL,S,TEMP

! ALLSEL,BELOW,AREA

! ATRAN,11,ALL, , , ,0,1

! CSYS,0

! ALLSEL

! ASEL,NONE

! CM,SLEEVEGAS,AREA

! SELTOL, 1.0E-6

! KPANGLE			=	setKPANGLE
! KPANGLE_INTERVAL	=	setKPANGLE_INTERVAL

! *DO,KPANGLE,KPANGLE,390-KPANGLE_INTERVAL,KPANGLE_INTERVAL

  ! CSYS,1
  ! KSEL,S,LOC,X,KPRAD1
  ! KSEL,R,LOC,Y,KPANGLE
  ! *GET, KPNUM1, KP, 0, NUM, MAX

  ! CSYS,11
  ! KSEL,S,LOC,X,KPRAD2
  ! KSEL,R,LOC,Y,KPANGLE
  ! *GET, KPNUM2, KP, 0, NUM, MAX
  ! ALLSEL

  ! LSTR,   KPNUM1,   KPNUM2

! *ENDDO


! ASEL,NONE

! KPANGLE			=	setKPANGLE
! KPANGLE_INTERVAL	=	setKPANGLE_INTERVAL

! *DO,KPANGLE,KPANGLE,390-KPANGLE_INTERVAL,KPANGLE_INTERVAL			! 

  ! CSYS,1

  ! KSEL,S,LOC,X,KPRAD1
  ! KSEL,R,LOC,Y,KPANGLE,KPANGLE+KPANGLE_INTERVAL

  ! CM,KPTEMP,KP


  ! CSYS,11

  ! KSEL,S,LOC,X,KPRAD2
  ! KSEL,R,LOC,Y,KPANGLE,KPANGLE+KPANGLE_INTERVAL

  ! CMSEL,A,KPTEMP
  ! CM,KPTEMP,KP

  ! LSLK,S,1

  ! ASEL,NONE

  ! AL,ALL

  ! *GET, AREA%KPANGLE+KPANGLE_INTERVAL%, AREA, 0, NUM, MAX

  ! CMSEL,A,SLEEVEGAS

  ! CM,SLEEVEGAS,AREA

! *ENDDO

! SELTOL,				! Reset logic

! AATT,matnr_gas1,31001


! ALLSEL

! NUMMRG,NODE,1E-8			! Merge nodes and keypoints
! NUMMRG,KP,1E-8

! ESIZE,solid_elem_size,0,		! Set global element size

! CSYS,11

! CMSEL,S,SLEEVEGAS

! ALLSEL,BELOW,AREA


! SELTOL, 1.0E-6

! KPANGLE			=	setKPANGLE
! KPANGLE_INTERVAL	=	setKPANGLE_INTERVAL

! *DO,KPANGLE,KPANGLE,390-KPANGLE_INTERVAL,KPANGLE_INTERVAL

  ! CSYS,1
  ! KSEL,S,LOC,X,KPRAD1
  ! KSEL,R,LOC,Y,KPANGLE
  ! *GET, KPNUM1, KP, 0, NUM, MAX

  ! CSYS,11
  ! KSEL,S,LOC,X,KPRAD2
  ! KSEL,R,LOC,Y,KPANGLE
  ! *GET, KPNUM2, KP, 0, NUM, MAX

  ! CSYS,11
  ! KSEL,S,LOC,X,KPRAD2
  ! KSEL,R,LOC,Y,KPANGLE+KPANGLE_INTERVAL
  ! *GET, KPNUM3, KP, 0, NUM, MAX

  ! CSYS,1
  ! KSEL,S,LOC,X,KPRAD1
  ! KSEL,R,LOC,Y,KPANGLE+KPANGLE_INTERVAL
  ! *GET, KPNUM4, KP, 0, NUM, MAX

  ! AMAP,AREA%KPANGLE+KPANGLE_INTERVAL%,KPNUM1,KPNUM2,KPNUM3,KPNUM4

! *ENDDO




SAVE,beforedisplacement2,db

RESUME,beforedisplacement2,db

!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! eccentric position 2 !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!


KPRAD1		=	containment1_tube_r2
KPRAD2		=	graphite_filler_r1

setKPANGLE		=	0
setKPANGLE_INTERVAL	=	360/heater_amount/2


CSYS,1

KSEL,S,LOC,X,KPRAD2,KPRAD1

LSLK,S,1

ASLL,S,1

ACLEAR,ALL

ADELE,ALL,,,1


KSEL,S,LOC,X,0,KPRAD2

LSLK,S,1

ASLL,S,1

CSYS,0


LOCAL,11,1,-(eccentricity_filler_cont1**2/2)**0.5,-(eccentricity_filler_cont1**2/2)**0.5,0, , , ,1,1,

CSYS,1

ATRAN,11,ALL, , , ,0,1

ALLSEL


SELTOL, 1.0E-6

KPANGLE			=	setKPANGLE
KPANGLE_INTERVAL	=	setKPANGLE_INTERVAL

*DO,KPANGLE,KPANGLE,390-KPANGLE_INTERVAL,KPANGLE_INTERVAL

  CSYS,1
  KSEL,S,LOC,X,KPRAD1
  KSEL,R,LOC,Y,KPANGLE
  *GET, KPNUM1, KP, 0, NUM, MAX

  CSYS,11
  KSEL,S,LOC,X,KPRAD2
  KSEL,R,LOC,Y,KPANGLE
  *GET, KPNUM2, KP, 0, NUM, MAX
  ALLSEL

  LSTR,   KPNUM1,   KPNUM2

*ENDDO


ASEL,NONE

CM,CONT1GAS,AREA

KPANGLE			=	setKPANGLE
KPANGLE_INTERVAL	=	setKPANGLE_INTERVAL

*DO,KPANGLE,KPANGLE,390-KPANGLE_INTERVAL,KPANGLE_INTERVAL

  CSYS,1

  KSEL,S,LOC,X,KPRAD1
  KSEL,R,LOC,Y,KPANGLE,KPANGLE+KPANGLE_INTERVAL

  CM,KPTEMP,KP


  CSYS,11

  KSEL,S,LOC,X,KPRAD2
  KSEL,R,LOC,Y,KPANGLE,KPANGLE+KPANGLE_INTERVAL

  CMSEL,A,KPTEMP
  CM,KPTEMP,KP

  LSLK,S,1

  ASEL,NONE

  AL,ALL

  *GET, AREA%KPANGLE+KPANGLE_INTERVAL%, AREA, 0, NUM, MAX

  CMSEL,A,CONT1GAS

  CM,CONT1GAS,AREA

*ENDDO


AATT,matnr_gas1,31001


ALLSEL

NUMMRG,NODE,1E-8			! Merge nodes and keypoints
NUMMRG,KP,1E-8

ESIZE,solid_elem_size,0,		! Set global element size

CSYS,11

CMSEL,S,CONT1GAS

ALLSEL,BELOW,AREA


SELTOL, 1.0E-6

KPANGLE			=	setKPANGLE
KPANGLE_INTERVAL	=	setKPANGLE_INTERVAL

*DO,KPANGLE,KPANGLE,390-KPANGLE_INTERVAL,KPANGLE_INTERVAL

  CSYS,1
  KSEL,S,LOC,X,KPRAD1
  KSEL,R,LOC,Y,KPANGLE
  *GET, KPNUM1, KP, 0, NUM, MAX

  CSYS,11
  KSEL,S,LOC,X,KPRAD2
  KSEL,R,LOC,Y,KPANGLE
  *GET, KPNUM2, KP, 0, NUM, MAX

  CSYS,11
  KSEL,S,LOC,X,KPRAD2
  KSEL,R,LOC,Y,KPANGLE+KPANGLE_INTERVAL
  *GET, KPNUM3, KP, 0, NUM, MAX

  CSYS,1
  KSEL,S,LOC,X,KPRAD1
  KSEL,R,LOC,Y,KPANGLE+KPANGLE_INTERVAL
  *GET, KPNUM4, KP, 0, NUM, MAX

  AMAP,AREA%KPANGLE+KPANGLE_INTERVAL%,KPNUM1,KPNUM2,KPNUM3,KPNUM4

*ENDDO




SAVE,beforedisplacement3,db

RESUME,beforedisplacement3,db

!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! eccentric position 3 !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!


KPRAD1		=	containment2_tube_r2
KPRAD2		=	containment1_tube_r1

setKPANGLE		=	0
setKPANGLE_INTERVAL	=	360/heater_amount/2


CSYS,1

KSEL,S,LOC,X,KPRAD2,KPRAD1

LSLK,S,1

ASLL,S,1

ACLEAR,ALL

ADELE,ALL,,,1


KSEL,S,LOC,X,0,KPRAD2

LSLK,S,1

ASLL,S,1

CSYS,0


LOCAL,11,1,-(eccentricity_cont1_cont2**2/2)**0.5,-(eccentricity_cont1_cont2**2/2)**0.5,0, , , ,1,1,

CSYS,1

ATRAN,11,ALL, , , ,0,1

ALLSEL


SELTOL, 1.0E-6

KPANGLE			=	setKPANGLE
KPANGLE_INTERVAL	=	setKPANGLE_INTERVAL

*DO,KPANGLE,KPANGLE,390-KPANGLE_INTERVAL,KPANGLE_INTERVAL

  CSYS,1
  KSEL,S,LOC,X,KPRAD1
  KSEL,R,LOC,Y,KPANGLE
  *GET, KPNUM1, KP, 0, NUM, MAX

  CSYS,11
  KSEL,S,LOC,X,KPRAD2
  KSEL,R,LOC,Y,KPANGLE
  *GET, KPNUM2, KP, 0, NUM, MAX
  ALLSEL

  LSTR,   KPNUM1,   KPNUM2

*ENDDO


ASEL,NONE

CM,CONT1GAS,AREA

KPANGLE			=	setKPANGLE
KPANGLE_INTERVAL	=	setKPANGLE_INTERVAL

*DO,KPANGLE,KPANGLE,390-KPANGLE_INTERVAL,KPANGLE_INTERVAL

  CSYS,1

  KSEL,S,LOC,X,KPRAD1
  KSEL,R,LOC,Y,KPANGLE,KPANGLE+KPANGLE_INTERVAL

  CM,KPTEMP,KP


  CSYS,11

  KSEL,S,LOC,X,KPRAD2
  KSEL,R,LOC,Y,KPANGLE,KPANGLE+KPANGLE_INTERVAL

  CMSEL,A,KPTEMP
  CM,KPTEMP,KP

  LSLK,S,1

  ASEL,NONE

  AL,ALL

  *GET, AREA%KPANGLE+KPANGLE_INTERVAL%, AREA, 0, NUM, MAX

  CMSEL,A,CONT1GAS

  CM,CONT1GAS,AREA

*ENDDO


AATT,matnr_gas2,32001


ALLSEL

NUMMRG,NODE,1E-8			! Merge nodes and keypoints
NUMMRG,KP,1E-8

ESIZE,solid_elem_size,0,		! Set global element size

CSYS,11

CMSEL,S,CONT1GAS

ALLSEL,BELOW,AREA


SELTOL, 1.0E-6

KPANGLE			=	setKPANGLE
KPANGLE_INTERVAL	=	setKPANGLE_INTERVAL

*DO,KPANGLE,KPANGLE,390-KPANGLE_INTERVAL,KPANGLE_INTERVAL

  CSYS,1
  KSEL,S,LOC,X,KPRAD1
  KSEL,R,LOC,Y,KPANGLE
  *GET, KPNUM1, KP, 0, NUM, MAX

  CSYS,11
  KSEL,S,LOC,X,KPRAD2
  KSEL,R,LOC,Y,KPANGLE
  *GET, KPNUM2, KP, 0, NUM, MAX

  CSYS,11
  KSEL,S,LOC,X,KPRAD2
  KSEL,R,LOC,Y,KPANGLE+KPANGLE_INTERVAL
  *GET, KPNUM3, KP, 0, NUM, MAX

  CSYS,1
  KSEL,S,LOC,X,KPRAD1
  KSEL,R,LOC,Y,KPANGLE+KPANGLE_INTERVAL
  *GET, KPNUM4, KP, 0, NUM, MAX

  AMAP,AREA%KPANGLE+KPANGLE_INTERVAL%,KPNUM1,KPNUM2,KPNUM3,KPNUM4

*ENDDO






SAVE,beforedisplacement4,db

RESUME,beforedisplacement4,db

!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! eccentric position 4 !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!


KPRAD1		=	REFA_in
KPRAD2		=	containment2_tube_r1

setKPANGLE		=	0
setKPANGLE_INTERVAL	=	360/heater_amount/2

CSYS,1

KSEL,S,LOC,X,KPRAD2,KPRAD1

LSLK,S,1

ASLL,S,1

ACLEAR,ALL

ADELE,ALL,,,1


KSEL,S,LOC,X,0,KPRAD2

LSLK,S,1

ASLL,S,1

CSYS,0


LOCAL,11,1,-(eccentricity_cont2_REFA**2/2)**0.5,-(eccentricity_cont2_REFA**2/2)**0.5,0, , , ,1,1,

CSYS,1

ATRAN,11,ALL, , , ,0,1

ALLSEL


SELTOL, 1.0E-6

KPANGLE			=	setKPANGLE
KPANGLE_INTERVAL	=	setKPANGLE_INTERVAL

*DO,KPANGLE,KPANGLE,390-KPANGLE_INTERVAL,KPANGLE_INTERVAL

  CSYS,1
  KSEL,S,LOC,X,KPRAD1
  KSEL,R,LOC,Y,KPANGLE
  *GET, KPNUM1, KP, 0, NUM, MAX

  CSYS,11
  KSEL,S,LOC,X,KPRAD2
  KSEL,R,LOC,Y,KPANGLE
  *GET, KPNUM2, KP, 0, NUM, MAX
  ALLSEL

  LSTR,   KPNUM1,   KPNUM2

*ENDDO


ASEL,NONE

CM,CONT1GAS,AREA

KPANGLE			=	setKPANGLE
KPANGLE_INTERVAL	=	setKPANGLE_INTERVAL

*DO,KPANGLE,KPANGLE,390-KPANGLE_INTERVAL,KPANGLE_INTERVAL

  CSYS,1

  KSEL,S,LOC,X,KPRAD1
  KSEL,R,LOC,Y,KPANGLE,KPANGLE+KPANGLE_INTERVAL

  CM,KPTEMP,KP


  CSYS,11

  KSEL,S,LOC,X,KPRAD2
  KSEL,R,LOC,Y,KPANGLE,KPANGLE+KPANGLE_INTERVAL

  CMSEL,A,KPTEMP
  CM,KPTEMP,KP

  LSLK,S,1

  ASEL,NONE

  AL,ALL

  *GET, AREA%KPANGLE+KPANGLE_INTERVAL%, AREA, 0, NUM, MAX

  CMSEL,A,CONT1GAS

  CM,CONT1GAS,AREA

*ENDDO


AATT,matnr_gas3,33001


ALLSEL

NUMMRG,NODE,1E-8			! Merge nodes and keypoints
NUMMRG,KP,1E-8

ESIZE,solid_elem_size,0,		! Set global element size

CSYS,11

CMSEL,S,CONT1GAS

ALLSEL,BELOW,AREA


SELTOL, 1.0E-6

KPANGLE			=	setKPANGLE
KPANGLE_INTERVAL	=	setKPANGLE_INTERVAL

*DO,KPANGLE,KPANGLE,390-KPANGLE_INTERVAL,KPANGLE_INTERVAL

  CSYS,1
  KSEL,S,LOC,X,KPRAD1
  KSEL,R,LOC,Y,KPANGLE
  *GET, KPNUM1, KP, 0, NUM, MAX

  CSYS,11
  KSEL,S,LOC,X,KPRAD2
  KSEL,R,LOC,Y,KPANGLE
  *GET, KPNUM2, KP, 0, NUM, MAX

  CSYS,11
  KSEL,S,LOC,X,KPRAD2
  KSEL,R,LOC,Y,KPANGLE+KPANGLE_INTERVAL
  *GET, KPNUM3, KP, 0, NUM, MAX

  CSYS,1
  KSEL,S,LOC,X,KPRAD1
  KSEL,R,LOC,Y,KPANGLE+KPANGLE_INTERVAL
  *GET, KPNUM4, KP, 0, NUM, MAX

  AMAP,AREA%KPANGLE+KPANGLE_INTERVAL%,KPNUM1,KPNUM2,KPNUM3,KPNUM4

*ENDDO




SAVE,beforesymmetrysection,db

RESUME,beforesymmetrysection,db

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! Select only a symmetry section to reduce element count for student version of ANSYS !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!

CSYS,1

ASEL,S,LOC,Y,0,240

ACLEAR,ALL

ADELE,ALL, , ,1

K,99999,0,0,0,

CSYS,1

KSEL,S,LOC,X,crucible_r4
KSEL,R,LOC,Y,240
kpnr = kpnext(0)
KSEL,A,,,99999

LSTR,   99999,   kpnr  

KSEL,S,LOC,X,crucible_r4
KSEL,R,LOC,Y,0
kpnr = kpnext(0)
KSEL,A,,,99999

LSTR,   99999,   kpnr  

KSEL,S,LOC,X,0,crucible_r4
KSEL,R,LOC,Y,240,360

LSLK,S,1

ASEL,NONE

AL,ALL

AATT,matnr_lif_dummy,1501

AMESH,ALL

ALLSEL

NUMCMP,NODE
NUMCMP,ELEM

CSYS,0


SAVE,beforesolve,db

RESUME,beforesolve,db


!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! Prepare for analyses !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!

ALLSEL

AGEN, ,ALL, , , , ,axial_position, , ,1								! Set to correct height with regards to heating table




SAVE,before_heating,db

RESUME,before_heating,db

!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! APPLY NUCLEAR HEATING !!!


! Nuclear heating table

*DIM,NUCLEAR_HEATING,TABLE,20,1,1, , , 

NUCLEAR_HEATING(1,1) =	0.28,	0.41,	0.65,	1.05,	1.49,	1.92,	2.40,	2.74,	2.94,	2.97,	2.85,	2.59,	2.21,	1.76,	1.30,	0.78,	0.53,	0.37,	0.25,	0.18
NUCLEAR_HEATING(1,0) =	-0.57,	-0.51,	-0.45,	-0.39,	-0.33,	-0.27,	-0.21,	-0.15,	-0.09,	-0.03,	0.03,	0.09,	0.15,	0.21,	0.27,	0.33,	0.39,	0.45,	0.51,	0.57

ALLSEL

CM,allelements,ELEM

CSYS,0

ESEL,U,MAT,,matnr_lif_dummy

ee=elnext(0)

*DOWHILE,ee
  *GET,eymm,ELEM,ee,CENT,Z
  *GET,Mtype,ELEM,ee,ATTR,MAT
  *GET,den,DENS,Mtype
  HeTot=NUCLEAR_HEATING(eymm,1)*den*1000*heating_factor		! W/g * density * 1000 to get to W/m3
  BFE,ee,HGEN,,HeTot
ee=elnext(ee)
*ENDDO


LOCAL,11,0,0,0,-0.257, , , ,1,1, 

CSYS,11



!!! Heaters

heater_power	=	1732

heater_area = 3*(pi*heater_r1**2-pi*heater_r2**2)

ASEL,S,MAT,,matnr_ms58_heater
ASEL,U,LOC,X,0,1										! Select only 2 out of 3 heaters
ESLA,S

CM,heaterelements,ELEM

CSYS,0

ee=elnext(0)

*DOWHILE,ee
  *GET,eymm,ELEM,ee,CENT,Z
  *GET,Mtype,ELEM,ee,ATTR,MAT
  *GET,ehgen,ELEM,ee,HGEN
  *GET,den,DENS,Mtype
  HeTot=ehgen+heater_power/0.451/heater_area*heater_power_factor*(3/2)		! W/g * density * 1000 to get to W/m3, factor (3/2) to divert all power to 2 out of 3 heaters
  BFE,ee,HGEN,,HeTot
ee=elnext(ee)
*ENDDO

ALLSEL

/PBF,HGEN, ,1

/REP


! !!! Salt CFD heating

! ! heating_table_size	=	14

! ! *DIM,Salt1_X,TABLE,heating_table_size,1,,X,,,1002							! Set to length of heating csv

! ! *TREAD,Salt1_X,'G:\baas\PROJECTS\Salient 03\Heating\Salt1_X','csv',' ', ,
! ! *VOPER,Salt1_X(0,1),Salt1_X(0,1),MULT,1.0213294*salt_heating_factor*heating_factor, , ,	! Scale power from CFD to match power from MCNP analyses


! ! heating_table_size	=	500

! ! *DIM,Salt1_Y,TABLE,heating_table_size,1,,Z,,,1002							! Set to length of heating csv

! ! *TREAD,Salt1_Y,'G:\baas\PROJECTS\Salient 03\Heating\Salt1_Y','csv',' ', ,
! ! *VOPER,Salt1_Y(0,1),Salt1_Y(0,1),MULT,1.0213294*salt_heating_factor*heating_factor, , ,	! Scale power from CFD to match power from MCNP analyses


! ! heating_table_size	=	500

! ! *DIM,Salt1_Y_,TABLE,heating_table_size,1,,Z,,,1002							! Set to length of heating csv

! ! *TREAD,Salt1_Y_,'G:\baas\PROJECTS\Salient 03\Heating\Salt1_Y-','csv',' ', ,
! ! *VOPER,Salt1_Y_(0,1),Salt1_Y_(0,1),MULT,1.0213294*heating_factor, , ,	! Scale power from CFD to match power from MCNP analyses


! ! heating_table_size	=	25

! ! *DIM,Salt2_X,TABLE,heating_table_size,1,,X,,,1002							! Set to length of heating csv

! ! *TREAD,Salt2_X,'G:\baas\PROJECTS\Salient 03\Heating\Salt2_X','csv',' ', ,
! ! *VOPER,Salt2_X(0,1),Salt2_X(0,1),MULT,1.0502279*salt_heating_factor*heating_factor, , ,	! Scale power from CFD to match power from MCNP analyses


! heating_table_size	=	251

! *DIM,Salt2_Y,TABLE,heating_table_size,1,,Z,,,1002							! Set to length of heating csv

! *TREAD,Salt2_Y,'G:\baas\PROJECTS\Salient 03\Heating\Salt2_Y','csv',' ', ,
! *VOPER,Salt2_Y(0,1),Salt2_Y(0,1),MULT,1.0502279*salt_heating_factor*heating_factor, , ,	! Scale power from CFD to match power from MCNP analyses


! ! heating_table_size	=	26

! ! *DIM,Salt3_X,TABLE,heating_table_size,1,,X,,,1002							! Set to length of heating csv

! ! *TREAD,Salt3_X,'G:\baas\PROJECTS\Salient 03\Heating\Salt3_X','csv',' ', ,
! ! *VOPER,Salt3_X(0,1),Salt3_X(0,1),MULT,1.0547012*salt_heating_factor*heating_factor, , ,	! Scale power from CFD to match power from MCNP analyses


! heating_table_size	=	251

! *DIM,Salt3_Y,TABLE,heating_table_size,1,,Z,,,1002							! Set to length of heating csv

! *TREAD,Salt3_Y,'G:\baas\PROJECTS\Salient 03\Heating\Salt3_Y','csv',' ', ,
! *VOPER,Salt3_Y(0,1),Salt3_Y(0,1),MULT,1.0547012*salt_heating_factor*heating_factor, , ,	! Scale power from CFD to match power from MCNP analyses


! ! heating_table_size	=	26

! ! *DIM,Salt4_X,TABLE,heating_table_size,1,,X,,,1002							! Set to length of heating csv

! ! *TREAD,Salt4_X,'G:\baas\PROJECTS\Salient 03\Heating\Salt4_X','csv',' ', ,
! ! *VOPER,Salt4_X(0,1),Salt4_X(0,1),MULT,1.0557887*salt_heating_factor*heating_factor, , ,	! Scale power from CFD to match power from MCNP analyses


! heating_table_size	=	251

! *DIM,Salt4_Y,TABLE,heating_table_size,1,,Z,,,1002							! Set to length of heating csv

! *TREAD,Salt4_Y,'G:\baas\PROJECTS\Salient 03\Heating\Salt4_Y','csv',' ', ,
! *VOPER,Salt4_Y(0,1),Salt4_Y(0,1),MULT,1.0557887*salt_heating_factor*heating_factor, , ,	! Scale power from CFD to match power from MCNP analyses


! ! heating_table_size	=	25

! ! *DIM,Salt5_X,TABLE,heating_table_size,1,,X,,,1002							! Set to length of heating csv

! ! *TREAD,Salt5_X,'G:\baas\PROJECTS\Salient 03\Heating\Salt5_X','csv',' ', ,
! ! *VOPER,Salt5_X(0,1),Salt5_X(0,1),MULT,1.0746749*salt_heating_factor*heating_factor, , ,	! Scale power from CFD to match power from MCNP analyses


! heating_table_size	=	255

! *DIM,Salt5_Y,TABLE,heating_table_size,1,,Z,,,1002							! Set to length of heating csv

! *TREAD,Salt5_Y,'G:\baas\PROJECTS\Salient 03\Heating\Salt5_Y','csv',' ', ,
! *VOPER,Salt5_Y(0,1),Salt5_Y(0,1),MULT,1.0746749*salt_heating_factor*heating_factor, , ,	! Scale power from CFD to match power from MCNP analyses



CSYS,0
WPCSYS,-1
WPOFF,0,0,-0.122
CSWPLA,1002,0,1,1,
CSYS,1002

ESEL,S,MAT,,matnr_lif_dummy
NSLE,S,1
ESEL,INVE
NSLE,R
CM,Saltboundary2,NODE


! ! CMSEL,S,Saltboundary2
! ! NSEL,R,LOC,X,bcrucible_r5,bcrucible_r4
! ! NSEL,R,LOC,Z,-0.16

! ! SF,ALL,HFLUX, %Salt1_X% 

! ! CMSEL,S,Saltboundary2
! ! NSEL,R,LOC,X,bcrucible_r5
! ! NSEL,R,LOC,Z,-0.16,bcrucible_salt_h1

! ! SF,ALL,HFLUX, %Salt1_Y_% 

! ! CMSEL,S,Saltboundary2
! ! NSEL,R,LOC,X,bcrucible_r4
! ! NSEL,R,LOC,Z,-0.16,bcrucible_salt_h1

! ! SF,ALL,HFLUX, %Salt1_Y% 


! ! CMSEL,S,Saltboundary2
! ! NSEL,R,LOC,X,0,crucible_r4
! ! NSEL,R,LOC,Z,0

! ! SF,ALL,HFLUX, %Salt2_X% 

! CMSEL,S,Saltboundary2
! !NSEL,R,LOC,X,crucible_r4
! NSEL,R,LOC,Z,0,crucible_salt_h1

! SF,ALL,HFLUX, %Salt2_Y% 


! ! CMSEL,S,Saltboundary2
! ! NSEL,R,LOC,X,0,crucible_r4
! ! NSEL,R,LOC,Z,(crucible_h1+separation_ring_h1)

! ! SF,ALL,HFLUX, %Salt3_X% 

! CMSEL,S,Saltboundary2
! !NSEL,R,LOC,X,crucible_r4
! NSEL,R,LOC,Z,(crucible_h1+separation_ring_h1),(crucible_h1+separation_ring_h1)+crucible_salt_h1

! SF,ALL,HFLUX, %Salt3_Y% 


! ! CMSEL,S,Saltboundary2
! ! NSEL,R,LOC,X,0,crucible_r4
! ! NSEL,R,LOC,Z,2*(crucible_h1+separation_ring_h1)

! ! SF,ALL,HFLUX, %Salt4_X% 

! CMSEL,S,Saltboundary2
! !NSEL,R,LOC,X,crucible_r4
! NSEL,R,LOC,Z,2*(crucible_h1+separation_ring_h1),2*(crucible_h1+separation_ring_h1)+crucible_salt_h1

! SF,ALL,HFLUX, %Salt4_Y% 


! ! CMSEL,S,Saltboundary2
! ! NSEL,R,LOC,X,0,crucible_r4
! ! NSEL,R,LOC,Z,3*(crucible_h1+separation_ring_h1)

! ! SF,ALL,HFLUX, %Salt5_X% 

! CMSEL,S,Saltboundary2
! !NSEL,R,LOC,X,crucible_r4
! NSEL,R,LOC,Z,3*(crucible_h1+separation_ring_h1),3*(crucible_h1+separation_ring_h1)+tcrucible_salt_h1

! SF,ALL,HFLUX, %Salt5_Y% 



CMSEL,S,Saltboundary2
! !NSEL,R,LOC,X,crucible_r4
! NSEL,R,LOC,Z,3*(crucible_h1+separation_ring_h1),3*(crucible_h1+separation_ring_h1)+tcrucible_salt_h1

SF,ALL,HFLUX, 185000 




SAVE,beforedummy_analyses,db

RESUME,beforedummy_analyses,db

!!!!!!!!!!!!!!!!!!!!!!
!!! Dummy analyses !!!

ALLSEL

!!! Make limited selection for quicker convergence

ALLSEL

CM,ELEMENT_SELECTION,ELEM
CM,AREA_SELECTION,AREA

!!! /

NSLE,S

CM,ELEMENT_SELECTION,ELEM

D,ALL, ,273, , , ,TEMP, , , , ,

/SOLU

TREF,reference_temp

ANTYPE,STATIC,

SOLVE

/POST1

FSUM





!!!!!!!!!!!!!!!!!!!!!!!!
!!! Remove all loads !!!

/PREP7

LSCLEAR,ALL

CPDELE,ALL



!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! Change to coupled thermal mechanical analyses before thermal loads are applied !!!

/PREP7

ALLSEL

ET,1,223,11,0,0	! ET,1,222,11,0,0					! Quadratic 2D Coupled thermal mechanical element 223, strong coupling. use linear type 222 for ANSYS version 16.0 and higher



!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! Boundary conditions !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!

!!! fix model position

! CSYS,1

! NSEL,S,LOC,X,REFA_out

! CSYS,0

! NSEL,R,LOC,X,0

! D,ALL,UX,0

! ALLSEL

! CSYS,0

! NSEL,S,LOC,X,REFA_out

! NSEL,R,LOC,Y,0

! D,ALL,UY,0

! ALLSEL

!!! Revised fix model position for symmetry selection related to ANSYS student version limits

CSYS,1

NROTAT,ALL

NSEL,S,LOC,Y,0

NSEL,A,LOC,Y,240

D,ALL,UY,0



! Reference temperature
TREF,Reference_temp				! Room temperature

!!! Pressure boundary !!!

! ESEL,S,MAT,,matnr_gas				! Select pressure boundary
! NSEL,S,EXT
! ESEL,INVE
! NSLE,R
! 
! SF,ALL,PRES,Pressure%matnr_gas%			! Add 100 bar pressure
! 
! 
! !!! Pressure boundary 2 !!!
! 
! ESEL,S,MAT,,matnr_gas2				! Select pressure boundary
! ESEL,A,MAT,,matnr_gas6
! NSEL,S,EXT
! ESEL,INVE
! NSLE,R
! 
! SF,ALL,PRES,Pressure%matnr_gas2%		! Add 3 bar pressure
! 
! /PSF,PRES,NORM,2,0,1

ALLSEL


!!! TRIO convection !!!

CSYS,1

NSEL,S,LOC,X,REFA_out

SF,ALL,CONV,30000,273.0+40.0

ALLSEL






!!!!!!!!!!!!!!!!!!!!!!!!!!!
!!! Apply nodal heating !!!

ALLSEL

LDREAD,REAC,LAST, , , ,file,rth,

FSCALE,-1

!!! / Apply nodal heating !!!
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!




SAVE,beforecontact,db

RESUME,beforecontact,db

!!!!!!!!!!!!!!!
!!! Contact !!! Added after LDREAD, command. If used before it, that load is not applied correctly and the analysis will not converge.
!!!!!!!!!!!!!!!

/PREP7

ALLSEL

! Generate contact

MP,MU,901,0
MAT,901
MP,EMIS,901,7.88860905221e-31

R,902
REAL,902
ET,901,169
ET,902,172
R,902,,,1,0.1,0,
RMORE,,,1.0E20,0.00001,1.0,					! Offset contact a bit so that gas elements are not squashed flat resulting in element formulation error
RMORE,0.0,0,1.0,,1.0,0.5					! Thermal contact conductance 0 on contact
RMORE,0,1.0,1.0,0.0,,1.0

KEYOPT,902,1,1
KEYOPT,902,2,0
KEYOPT,902,3,0
KEYOPT,902,4,0
KEYOPT,902,5,0
KEYOPT,902,7,1							! Automatic bissection 1 = on, 0 = off
KEYOPT,902,8,0
KEYOPT,902,9,1							! Exclude everything
KEYOPT,902,10,0							! 0 = Every load step, 2 =  every sub step
KEYOPT,902,11,0
KEYOPT,902,12,0							! 0=Standard, 2=No separation
KEYOPT,902,14,1

! Generate the target surface
ASEL,S,REAL,,15001
LSLA,S,1
KSLL,S
CSYS,1
KSEL,R,LOC,X,graphite_filler_r3
LSLK,S,1
TYPE,901
NSLL,S,1
ESLN,S,0
ESEL,U,MAT,,matnr_gas1
ESURF

! Generate the contact surface
ASEL,S,REAL,,1001
ASEL,A,REAL,,3101
LSLA,S,1
KSLL,S
CSYS,1
KSEL,R,LOC,X,crucible_r1
LSLK,S,1
TYPE,902
NSLL,S,1
ESLN,S,0
ESEL,U,MAT,,matnr_gas1
ESURF




ALLSEL

! Generate contact 2

MP,MU,903,0
MAT,903
MP,EMIS,901,7.88860905221e-31

R,904
REAL,904
ET,903,169
ET,904,172
R,904,,,1,0.1,0,
RMORE,,,1.0E20,0.00001,1.0,					! Offset contact a bit so that gas elements are not squashed flat resulting in element formulation error
RMORE,0.0,0,1.0,,1.0,0.5					! Thermal contact conductance 0 on contact
RMORE,0,1.0,1.0,0.0,,1.0

KEYOPT,904,1,1
KEYOPT,904,2,0
KEYOPT,904,3,0
KEYOPT,904,4,0
KEYOPT,904,5,0
KEYOPT,904,7,1							! Automatic bissection 1 = on, 0 = off
KEYOPT,904,8,0
KEYOPT,904,9,1							! Exclude everything
KEYOPT,904,10,0							! 0 = Every load step, 2 =  every sub step
KEYOPT,904,11,0
KEYOPT,904,12,0							! 0=Standard, 2=No separation
KEYOPT,904,14,1

! Generate the target surface
ASEL,S,REAL,,15001
LSLA,S,1
KSLL,S
CSYS,1
KSEL,R,LOC,X,graphite_filler_r3+0.0001,graphite_filler_r1-0.0001
LSLK,S,1
TYPE,903
NSLL,S,1
ESLN,S,0
ESEL,U,MAT,,matnr_gas1
ESURF

! Generate the contact surface
ASEL,S,REAL,,15701
LSLA,S,1
ASEL,S,REAL,,31001
LSLA,R
TYPE,904
NSLL,S,1
ESLN,S,0
ESEL,U,MAT,,matnr_gas1
ESURF



SAVE,beforesolve,db

RESUME,beforesolve,db

!!!!!!!!!!!!!
!!! Solve !!!

ALLSEL

/SOLU

ANTYPE,STATIC,
!SOLCONTROL,OFF					!RESET TO DEFAULT ANSYS SETTINGS
LNSRCH,ON
NLGEOM,ON
AUTOTS,ON

KBC,0 						!ramped
OUTRES,ALL,ALL
NEQIT,1000
CNVTOL,heat,,5e-7            
RADOPT,,1e-6,,,0.001
!CNTR,revision,150
CNVTOL,U,-1
CNVTOL,F,-1

BCSOPT,,incore					! Run incore

TIME,1
NSUBST,5,2000,1

SOLVE


SAVE,solved,db







/POST1
INRES,ALL
FILE,'file','rst','.'


SET,1,LAST

ALLSEL

  
/EFACET,1   

PLNSOL, TEMP,, 0,1.0
/VIEW,1,,,1 
/ANG,1  
/REP,FAST   



PLNSOL, TEMP,, 0,1.0


/POST1

/DSCALE,ALL,1

/TRIAD,OFF
WPSTYLE,,,,,,,,0
/GRAPHICS,POWER

/PLOPTS,DATE,0
/PLOPTS,LEG1,1
/PLOPTS,LEG2,0
/PLOPTS,LEG3,1

/PBC,PATH,0

ALLSEL

/PLOPTS,INFO,2
/VIEW,1,,,1
/ANG,1
/REP,FAST
/AUTO,1
/REP,FAST


/SHOW,PNG,,0
PNGR,COMP,1,-1
PNGR,ORIENT,HORIZ
PNGR,COLOR,2
PNGR,TMOD,1
/GFILE,1600,
/CMAP,_TEMPCMAP_,CMP,,SAVE
/RGB,INDEX,100,100,100,0
/RGB,INDEX,0,0,0,15

/RATIO,ALL,1,1

ALLSEL

ESEL,U,MAT,,matnr_gas0,matnr_gas3			! Unselect gas
ESEL,U,REAL,,1501							! Unselect salt
PLNSOL, TEMP,, 0,1.0
PLNSOL, S,INT, 0,1.0


ESEL,S,REAL,,10001			! Select first containment
PLNSOL, TEMP,, 0,1.0
*GET,cont1temp, PLNSOL, 0, MAX
*GET,cont1temp2, PLNSOL, 0, MIN
PLNSOL, S,INT, 0,1.0
*GET,cont1stress, PLNSOL, 0, MAX


ESEL,S,REAL,,12001			! Select second containment
PLNSOL, TEMP,, 0,1.0
*GET,cont2temp, PLNSOL, 0, MAX
*GET,cont2temp2, PLNSOL, 0, MIN
PLNSOL, S,INT, 0,1.0
*GET,cont2stress, PLNSOL, 0, MAX


ESEL,S,REAL,,3301			! Select Samples
PLNSOL, TEMP,, 0,1.0
*GET,sampletemp, PLNSOL, 0, MAX
*GET,sampletemp2, PLNSOL, 0, MIN
PLNSOL, S,INT, 0,1.0
*GET,samplestress, PLNSOL, 0, MAX


ESEL,S,REAL,,1001			! Select crucibles
!ESEL,A,REAL,,1101			! Select crucible caps
PLNSOL, TEMP,, 0,1.0
*GET,crucibletemp, PLNSOL, 0, MAX
*GET,crucibletemp2, PLNSOL, 0, MIN
PLNSOL, S,INT, 0,1.0
*GET,crucible2stress, PLNSOL, 0, MAX


! ESEL,S,REAL,,1051			! Select spacers
! PLNSOL, TEMP,, 0,1.0
! *GET,spacertemp, PLNSOL, 0, MAX
! *GET,spacertemp2, PLNSOL, 0, MIN
! PLNSOL, S,INT, 0,1.0
! *GET,spacerstress, PLNSOL, 0, MAX


ESEL,S,REAL,,1501			! Select salt
PLNSOL, TEMP,, 0,1.0
*GET,salttemp, PLNSOL, 0, MAX
*GET,salttemp2, PLNSOL, 0, MIN
PLNSOL, S,INT, 0,1.0
*GET,saltstress, PLNSOL, 0, MAX


ESEL,S,REAL,,15001			! Select graphite 
PLNSOL, TEMP,, 0,1.0
*GET,graphtemp, PLNSOL, 0, MAX
*GET,graphtemp2, PLNSOL, 0, MIN
PLNSOL, S,INT, 0,1.0
*GET,graphstress, PLNSOL, 0, MAX


! ESEL,S,REAL,,15501			! Select heaters
! ESEL,A,REAL,,15601			! Select heaters in gas
! PLNSOL, TEMP,, 0,1.0
! *GET,heatertemp, PLNSOL, 0, MAX
! *GET,heatertemp2, PLNSOL, 0, MIN
! PLNSOL, S,INT, 0,1.0
! *GET,heaterstress, PLNSOL, 0, MAX


! ESEL,S,REAL,,17001			! Select LVDT
! ESEL,A,REAL,,17501
! PLNSOL, TEMP,, 0,1.0
! *GET,LVDTtemp, PLNSOL, 0, MAX
! *GET,LVDTtemp2, PLNSOL, 0, MIN
! PLNSOL, S,INT, 0,1.0
! *GET,LVDTstress, PLNSOL, 0, MAX


! ESEL,S,REAL,,18001			! Select LVDT Cooler
! PLNSOL, TEMP,, 0,1.0
! *GET,LVDTcoolertemp, PLNSOL, 0, MAX
! *GET,LVDTcoolertemp2, PLNSOL, 0, MIN
! PLNSOL, S,INT, 0,1.0
! *GET,LVDTcoolerstress, PLNSOL, 0, MAX


! ESEL,S,REAL,,42001			! Select Bottom cooler
! PLNSOL, TEMP,, 0,1.0
! *GET,BottomCoolertemp, PLNSOL, 0, MAX
! *GET,BottomCoolertemp2, PLNSOL, 0, MIN
! PLNSOL, S,INT, 0,1.0
! *GET,BottomCoolerstress, PLNSOL, 0, MAX



/DSCALE,ALL,1

PLNSOL, S,INT, 0,1.0

/CMAP,_TEMPCMAP_,CMP
/DELETE,_TEMPCMAP_,CMP
/SHOW,CLOSE
/DEVICE,VECTOR,0




!*CREATE,writetofile,mac

*cfopen,'maxtemp_summary','out',' ',APPEND
*vwrite,cont1temp,cont2temp,sampletemp,crucibletemp,spacertemp,salttemp,graphtemp,heatertemp,LVDTtemp,LVDTcoolertemp,BottomCoolertemp
(F10.5,',',F10.5,',',F10.5,',',F10.5,',',F10.5,',',F10.5,',',F10.5,',',F10.5,',',F10.5,',',F10.5,',',F10.5)
*cfclos


*cfopen,'mintemp_summary','out',' ',APPEND
*vwrite,cont1temp2,cont2temp2,sampletemp2,crucibletemp2,spacertemp2,salttemp2,graphtemp2,heatertemp2,LVDTtemp2,LVDTcoolertemp2,BottomCoolertemp2
(F10.5,',',F10.5,',',F10.5,',',F10.5,',',F10.5,',',F10.5,',',F10.5,',',F10.5,',',F10.5,',',F10.5,',',F10.5)
*cfclos


*cfopen,'maxstress_summary','out',' ',APPEND
*vwrite,cont1stress,cont2stress,samplestress,cruciblestress,spacerstress,saltstress,graphstress,heaterstress,LVDTstress,LVDTcoolerstress,BottomCoolerstress
(E12.3,',',E12.3,',',E12.3,',',E12.3,',',E12.3,',',E12.3,',',E12.3,',',E12.3,',',E12.3,',',E12.3,',',E12.3)
*cfclos





/EOF