# Input File for FEM Simulation with Mesh Reference

## Mesh mesh_file <name.msh> <physical_entity_final_mesh_name>
#mesh_file C:/Archive/Programming/MATLAB/TOTEM_M/TECTO/TEC_Parameterized_NElem_Hex.inp Volume mm
#mesh_file C:/Archive/Programming/MATLAB/TOTEM_M/TECTO/TEC_Parameterized_NElem_Serendipity_Gmsh_5el.inp Volume mm
#mesh_file C:/Archive/Programming/MATLAB/TOTEM_M/TECTO/TEC_Parameterized_NElem_Ser_ceramic_Gmsh_5x5x5el.inp Volume mm
#mesh_file C:/Archive/Programming/MATLAB/TOTEM_M/TECTO/TEC_Parameterized_NElem_Hex_ceramic_Gmsh_24x24x12el.inp Volume mm
mesh_file C:/Archive/Programming/MATLAB/TOTEM_M/TECTO/TEC_Parameterized_NElem_Hex_ceramic_Gmsh_5x5x5el.inp Volume mm

rst_folder C:/Archive/Programming/MATLAB/TOTEM_M/TECTO/Results/
physics decoupledthermoelectromechanical
solver NR
#solver Arc-len
InitialTemperature 298.15

## Bi2Te3 Mechanical Properties: https://repository.bilkent.edu.tr/server/api/core/bitstreams/502cdf62-9b13-4faf-b245-8196af9e81ab/content
## Bi2Te3 Thermal Expansion: https://www.researchgate.net/publication/227109210_Thermal_expansion_of_bismuth_telluride
## Bi2Te3 Thermal Expansion: https://www.physics.purdue.edu/quantum/files/XChen_expansion_apl11.pdf
## Bi2Te3 Thermoelectric Properties: https://link.springer.com/article/10.1007/s11664-015-3898-y
## Copper Mechanical Properties: https://www.mit.edu/~6.777/matprops/copper.htm
## Solder Mechanical Properties: https://www.metallurgy.nist.gov/solder/clech/Sn-Ag-Cu_Other.htm#Young , https://www.jstage.jst.go.jp/article/matertrans/46/6/46_6_1271/_pdf , https://www.electronics-cooling.com/2006/08/thermal-conductivity-of-solders/
## Copper Electrical Properties: 
## Solder Electrical Properties: https://us.rs-online.com/m/d/8d9ef1f686bf70839a288bf4fd8e669e.pdf
## MATERIAL PROPERTIES: material <volumename> \n <propertyname> <value> \n ... 
##
material SemiconductorP+
Seebeck 3 -7.04E-4 6.3E-6 -1.32E-8 8.33E-12
Penalty_Seebeck 0 1
ThermalConductivity 3 1.5775 -2.177E-3 -3.32E-6 1.59E-8
Penalty_ThermalConductivity 0 3
ElectricalConductivity  3 9.9615E5 -7.16E+3 18.489 -0.0164
Penalty_ElectricalConductivity 0 3
ThermalExpansionCoefficient_x 0 15E-6
ThermalExpansionCoefficient_y 0 15E-6
ThermalExpansionCoefficient_z 0 15E-6
YoungModulus 0 61.6E9
Penalty_YoungModulus 0 3
PoissonRatio 0 0.241

material SemiconductorN-
Seebeck 3 3.95E-4 -3.82E-6 7.34E-9 -3.98E-12 
Penalty_Seebeck 0 1
ThermalConductivity 3 2.48 -4.51E-3 -4.6E-6 2.19E-8 
Penalty_ThermalConductivity 0 3
ElectricalConductivity 3 3.4581E5 -1.5947E3 2.8182 -0.0017
Penalty_ElectricalConductivity 0 3
ThermalExpansionCoefficient_x 0 15E-6
ThermalExpansionCoefficient_y 0 15E-6
ThermalExpansionCoefficient_z 0 15E-6
YoungModulus 0 61.6E9
Penalty_YoungModulus 0 3
PoissonRatio 0 0.241

material Copper
Seebeck 0 0
ThermalConductivity 0 385
ElectricalConductivity 0 59880239.52095808
ThermalExpansionCoefficient_x 0 17E-6
ThermalExpansionCoefficient_y 0 17E-6
ThermalExpansionCoefficient_z 0 17E-6
YoungModulus 0 130E9
PoissonRatio 0 0.34

material Solder
Seebeck 0 0
ThermalConductivity 0 58.7
ElectricalConductivity 0 769230
ThermalExpansionCoefficient_x 0 24.7E-6
ThermalExpansionCoefficient_y 0 24.7E-6
ThermalExpansionCoefficient_z 0 24.7E-6
YoungModulus 0 46.5E9
PoissonRatio 0 0.4

material Ceramic # Al2O3
Seebeck 0 0
ThermalConductivity 0 50
ElectricalConductivity 0 1
ThermalExpansionCoefficient_x 0 19.5E-6
ThermalExpansionCoefficient_y 0 19.5E-6
ThermalExpansionCoefficient_z 0 19.5E-6
YoungModulus 0 300E9
PoissonRatio 0 0.21

## Boundary Conditions: bc <boundaryname> <surfacename> <value>
bc Voltage Ceramic 0.0 # Removing dofs for the ceramic volume
bc FreeDofs_Voltage Contact_CeramicTop 0.0
bc FreeDofs_Voltage Contact_CeramicBottom 0.0
bc Voltage ElectrodeMinX 0.0625
bc Voltage ElectrodeMaxX 0.0
bc Temperature bottom 323
bc Displacement_x Ceramic_Bottom 0
bc Displacement_y Ceramic_Bottom 0
bc Displacement_z Ceramic_Bottom 0
bc heat_n top 1000
bc Pressure_y top -0.9E6
bc Displacement_z symmetry 0

## Topopoly Optimization Objective: TopOpt_Objective <ObjectiveName> <SurfaceName> <DesignElements>
TopOpt_Objective AverageTemperature top TO
## Topopoly Optimization Extra Variable (bc): TopOpt_Variable <bctype> <SurfaceName> <minval> <initialval> <maxval> 
TopOpt_bc Voltage ElectrodeMinX 0.01 0.025  0.1
## Topopoly Optimization Intial densities: TopOpt_Initial_x <value(0,1](if<0, random values )>
TopOpt_Initial_x 1
## Topopoly Optimization NR start point: TopOpt_Initial_x <value(0,1](if<0, random values )>
TopOpt_NR T previous  
TopOpt_NR V proporcional
## Topopoly Optimization Constraints
TopOpt_Constraint Power 0.025
TopOpt_Constraint Volume 1
#TopOpt_Constraint Stress 20E6
TopOpt_Constraint Stress_Pnorm 10E6

## Output Options
## output <data> <path/outputname>
##output T dataT.vtk