PDF

Tin Melting Front
Introduction
This example demonstrates how to model phase transition by a moving boundary interface according to the Stefan problem. It is adapted from the benchmark study in Ref. 1.
A square cavity containing both solid and liquid tin is submitted to a temperature difference between left and right boundaries. Fluid and solid parts are solved in separate domains sharing a moving melting front (see Figure 1). The position of this boundary through time is calculated according to the Stefan energy balance condition.
Figure 1: Square cavity with moving phase interface.
In the melt, motion generated by natural convection is expected due to the temperature gradient. This motion, in turn, influences the front displacement.
Model Definition
The geometry presented in Figure 2 shows a square of side length 10 cm filled with pure tin. The left and right boundaries are maintained at 508 K and 503 K, respectively. Because the fusion temperature of pure tin is 505 K, both liquid and solid phases co-exist in the square.
Figure 2: Geometry and boundary conditions at the start time.
The initial temperature distribution is assumed to vary linearly in the horizontal direction as shown in Figure 3.
Figure 3: Initial temperature profile.
The melting front is the vertical line located at x = 6 cm where the temperature is 505 K.
The liquid part on the left is governed by the Navier-Stokes equations in the Boussinesq approximation as described in Gravity and The Boussinesq Approximation sections in the CFD Module User’s Guide, with Tref = Tf the fusion temperature of tin. The reduced pressure formulation is used to enhance the accuracy of the buoyancy forces since they are relatively small compared to the other terms in the momentum balance.
As the metal melts, the solid-liquid interface moves toward the solid side. The energy balance at this front is expressed by
(1)
where ΔH is the latent heat of fusion, equal to 60 kJ/kg, v (m/s) is the front velocity vector, n is the normal vector at the front, and Φl and Φs (W/m2) are the heat fluxes coming from the liquid and solid sides, respectively (see Figure 4).
Figure 4: Heat fluxes at the melting front.
Table 1 reviews the material properties of tin (Ref. 2) used in this model.
Cp
2.67·10-4 K-1
8.0·10-7 m2/s
Tf
Results and Discussion
Figure 5 shows the velocity profile in the fluid domain. The convective cell due to buoyancy increases the melting speed at the upper part of the cavity.
Figure 5: Velocity profile in the fluid at the end of the simulation.
At the end of the simulation, the melting front does not move anymore because balance between left and right adjacent fluxes has been reached.
In Figure 6, the temperature profile is represented jointly by a heat flux arrow plot.
Figure 6: Temperature profile at the end of the simulation.
Notes About the COMSOL Implementation
The quantities Φl and Φs, illustrated in Figure 4, can be computed using the up and down operators. The components of Φl − Φs would then be given by up(ht.tfluxx)-down(ht.tfluxx) and up(ht.tfluxy)-down(ht.tfluxy). However, this method evaluates the temperature gradient which may lead to imprecisions due to the mesh discretization. Instead, the quantity l − Φs) ⋅ n, involved in Equation 1, is more precisely evaluated through the Lagrange multiplier for temperature, T_lm. This variable is available when weak constraints are enabled in the region of interest, as it is the case here with the fixed temperature constraint at the melting front. For more information about weak constraints, refer to the section Weak Constraint in the COMSOL Multiphysics Reference Manual.
To handle the melting front movement, a mesh deformation is necessary. During such a transformation, matter from solid tin is removed while the same amount of liquid tin is added to the fluid. The appropriate tool for deforming the mesh without reflecting any expansion or contraction effects to the material properties is the Deformed Geometry settings.
References
1. F. Wolff and R. Viskanta, “Solidification of a Pure Metal at a Vertical Wall in the Presence of Liquid Superheat,” Int.J. Heat and Mass Transfer, vol. 31, no. 8, pp. 1735–1744, 1988.
2. V. Alexiades, N. Hannoun, and T.Z. Mai, “Tin Melting: Effect of Grid Size and Scheme on the Numerical Solution,” Proc. 5th Mississippi State Conf. Differential Equations and Computational Simulations, pp. 55–69, 2003.
Application Library path: Heat_Transfer_Module/Phase_Change/tin_melting_front
Modeling Instructions
From the File menu, choose New.
New
In the New window, click  Model Wizard.
Model Wizard
1
In the Model Wizard window, click  2D.
2
In the Select Physics tree, select Heat Transfer>Conjugate Heat Transfer>Laminar Flow.
3
Click Add.
4
Click  Study.
5
In the Select Study tree, select General Studies>Time Dependent.
6
Global Definitions
Parameters 1
1
In the Model Builder window, under Global Definitions click Parameters 1.
2
In the Settings window for Parameters, locate the Parameters section.
3
Geometry 1
Square 1 (sq1)
1
In the Geometry toolbar, click  Square.
2
In the Settings window for Square, locate the Size section.
3
In the Side length text field, type 0.1.
4
Click to expand the Layers section. In the table, enter the following settings:
5
Select the Layers to the left check box.
6
Clear the Layers on bottom check box.
7
In the Geometry toolbar, click  Build All.
Materials
Tin (Solid)
1
In the Materials toolbar, click  Blank Material.
2
In the Settings window for Material, type Tin (Solid) in the Label text field.
3
Before defining the material properties, set the solid and fluid domains in the physics interfaces to let COMSOL Multiphysics flag what properties you need to specify.
Laminar Flow (spf)
1
In the Model Builder window, under Component 1 (comp1) click Laminar Flow (spf).
2
Heat Transfer in Solids and Fluids (ht)
1
In the Model Builder window, under Component 1 (comp1) click Heat Transfer in Solids and Fluids (ht).
2
In the Settings window for Heat Transfer in Solids and Fluids, locate the Physical Model section.
3
In the Tref text field, type Tf.
Fluid 1
1
In the Model Builder window, under Component 1 (comp1)>Heat Transfer in Solids and Fluids (ht) click Fluid 1.
2
Materials
Tin (Solid) (mat1)
1
In the Model Builder window, under Component 1 (comp1)>Materials click Tin (Solid) (mat1).
2
In the Settings window for Material, locate the Material Contents section.
3
Duplicate this material : selecting the fluid domain will make COMSOL Multiphysics enquire for the missing needed parameters.
Duplicate this material : selecting the fluid domain will make COMSOL Multiphysics enquire for the missing needed parameters.
Tin (Solid) 1 (mat2)
Right-click Component 1 (comp1)>Materials>Tin (Solid) (mat1) and choose Duplicate.
Tin (Liquid)
1
In the Model Builder window, expand the Component 1 (comp1)>Materials>Tin (Solid) (mat1) node.
2
Right-click Tin (Solid) 1 (mat2) and choose Rename.
3
In the Rename Material dialog box, type Tin (Liquid) in the New label text field.
4
5
6
In the Settings window for Material, locate the Material Contents section.
7
Heat Transfer in Solids and Fluids (ht)
Initial Values 1
Define the initial temperature as a function of Xg, the first coordinate on the undeformed geometry.
1
In the Model Builder window, under Component 1 (comp1)>Heat Transfer in Solids and Fluids (ht) click Initial Values 1.
2
In the Settings window for Initial Values, locate the Initial Values section.
3
In the T text field, type Th-Xg/0.1[m]*(Th-Tc).
Laminar Flow (spf)
1
In the Model Builder window, under Component 1 (comp1) click Laminar Flow (spf).
2
In the Settings window for Laminar Flow, locate the Physical Model section.
3
From the Compressibility list, choose Incompressible flow.
4
Select the Include gravity check box.
5
Select the Use reduced pressure check box.
Heat Transfer in Solids and Fluids (ht)
In the Model Builder window, under Component 1 (comp1) click Heat Transfer in Solids and Fluids (ht).
Temperature 1
1
In the Physics toolbar, click  Boundaries and choose Temperature.
2
3
In the Settings window for Temperature, locate the Temperature section.
4
In the T0 text field, type Th.
Temperature 2
1
In the Physics toolbar, click  Boundaries and choose Temperature.
2
3
In the Settings window for Temperature, locate the Temperature section.
4
In the T0 text field, type Tc.
Phase Change Interface 1
1
In the Physics toolbar, click  Boundaries and choose Phase Change Interface.
2
3
In the Settings window for Phase Change Interface, locate the Phase Change Interface section.
4
In the Tpc text field, type Tf.
5
In the Lsf text field, type DelH.
6
From the Solid side list, choose Downside.
Laminar Flow (spf)
In the Model Builder window, under Component 1 (comp1) click Laminar Flow (spf).
Pressure Point Constraint 1
1
In the Physics toolbar, click  Points and choose Pressure Point Constraint.
2
The model only contains information about the pressure gradient and estimates the pressure field up to a constant. To define this constant, you arbitrarily fix the pressure at a point.
Multiphysics
Nonisothermal Flow 1 (nitf1)
1
In the Model Builder window, under Component 1 (comp1)>Multiphysics click Nonisothermal Flow 1 (nitf1).
2
In the Settings window for Nonisothermal Flow, locate the Material Properties section.
3
Select the Boussinesq approximation check box.
4
From the Specify density list, choose Custom, linearized density.
5
From the ρref list, choose From material.
6
In the αp text field, type alpha_Sn.
Definitions
Deforming Domain 1
1
In the Definitions toolbar, click  Deformed Geometry and choose Deforming Domain.
2
In the Settings window for Deforming Domain, locate the Domain Selection section.
3
From the Selection list, choose All domains.
4
Locate the Smoothing section. From the Mesh smoothing type list, choose Laplace.
Prescribed Normal Mesh Displacement 1
1
In the Definitions toolbar, click  Deformed Geometry and choose Prescribed Normal Mesh Displacement.
2
Mesh 1
1
In the Model Builder window, under Component 1 (comp1) click Mesh 1.
2
In the Settings window for Mesh, locate the Physics-Controlled Mesh section.
3
From the Element size list, choose Fine.
4
Click  Build All.
Study 1
Step 1: Time Dependent
1
In the Model Builder window, under Study 1 click Step 1: Time Dependent.
2
In the Settings window for Time Dependent, locate the Study Settings section.
3
Click  Range.
4
In the Range dialog box, type 100 in the Step text field.
5
In the Stop text field, type 10000.
6
Click Replace.
For more robust convergence, tighten the relative tolerance, which controls the size of the time steps taken by the solver.
7
In the Settings window for Time Dependent, locate the Study Settings section.
8
From the Tolerance list, choose User controlled.
9
In the Relative tolerance text field, type 1e-4.
Solution 1 (sol1)
1
In the Study toolbar, click  Show Default Solver.
2
In the Model Builder window, expand the Solution 1 (sol1) node.
3
In the Model Builder window, expand the Study 1>Solver Configurations>Solution 1 (sol1)>Dependent Variables 1 node, then click Material mesh displacement (comp1.material.disp).
4
In the Settings window for Field, locate the Scaling section.
5
From the Method list, choose From parent.
6
In the Study toolbar, click  Compute.
Results
Temperature (ht)
This default plot shows the temperature profile. To reproduce Figure 3, add arrows of the heat flux field to see the relation between temperature and velocity.
Arrow Surface 1
1
In the Temperature (ht) toolbar, click  Arrow Surface.
2
In the Settings window for Arrow Surface, click Replace Expression in the upper-right corner of the Expression section. From the menu, choose Component 1 (comp1)>Laminar Flow>Velocity and pressure>u,v - Velocity field (spatial and material frames).
3
Locate the Coloring and Style section. From the Arrow type list, choose Cone.
4
From the Color list, choose Black.
5
In the Temperature (ht) toolbar, click  Plot.
Velocity (spf)
This default plot shows the velocity profile in the fluid region. To reproduce Figure 5, add arrows of the velocity field to visualize the convective flow direction.
1
In the Model Builder window, click Velocity (spf).
Arrow Surface 1
1
In the Velocity (spf) toolbar, click  Arrow Surface.
2
In the Settings window for Arrow Surface, click Replace Expression in the upper-right corner of the Expression section. From the menu, choose Component 1 (comp1)>Laminar Flow>Velocity and pressure>u,v - Velocity field (spatial and material frames).
3
Locate the Coloring and Style section. From the Arrow type list, choose Cone.
4
From the Color list, choose Black.
5
In the Velocity (spf) toolbar, click  Plot.
Finally, plot the mesh deformation as follows.
Mesh Deformation
1
In the Home toolbar, click  Add Plot Group and choose 2D Plot Group.
2
In the Settings window for 2D Plot Group, type Mesh Deformation in the Label text field.
Mesh 1
1
In the Mesh Deformation toolbar, click  Mesh.
2
In the Settings window for Mesh, locate the Coloring and Style section.
3
From the Element color list, choose None.
4
From the Wireframe color list, choose Blue.
Filter 1
1
In the Mesh Deformation toolbar, click  Filter.
2
In the Settings window for Filter, locate the Element Selection section.
3
In the Logical expression for inclusion text field, type dom==1.
This logical expression restricts the plot to the fluid domain.
4
In the Mesh Deformation toolbar, click  Plot.
Mesh 2
1
In the Model Builder window, under Results>Mesh Deformation right-click Mesh 1 and choose Duplicate.
2
In the Settings window for Mesh, locate the Coloring and Style section.
3
From the Wireframe color list, choose Red.
Filter 1
1
In the Model Builder window, expand the Mesh 2 node, then click Filter 1.
2
In the Settings window for Filter, locate the Element Selection section.
3
In the Logical expression for inclusion text field, type dom==2.
This logical expression filters the solid domain.
4
In the Mesh Deformation toolbar, click  Plot.
The plot should look like that in the figure below.