Hi everyone,
I am solving a thermal-elasticity problem for a 5510 box, with a uniform temperature difference of 2000K. My code seems to be working. But when I change the solver (Gmres, Mumps, Petsc, Umfpack), my displacement values seem to be different. Anyone has any idea about this issue?
The result comparison is shown in figure.
Thanks
Here is my code:
from dolfin import *
import os
from subprocess import call
Read_Mesh(parameters_dic)
file_name_Basis_Thermal = ‘box’
convert mesh
if os.path.exists(’{}.xml.gz’.format(file_name_Basis_Thermal)):
os.remove(’{}.xml.gz’.format(file_name_Basis_Thermal))
if os.path.exists(’{}_facet_region.xml.gz’.format(file_name_Basis_Thermal)):
os.remove(’{}_facet_region.xml.gz’.format(file_name_Basis_Thermal))
if os.path.exists(’{}_physical_region.xml.gz’.format(file_name_Basis_Thermal)):
os.remove(’{}_physical_region.xml.gz’.format(file_name_Basis_Thermal))
call(‘dolfin-convert {}.msh {}.xml;gzip {}*.xml’.format(file_name_Basis_Thermal,file_name_Basis_Thermal,file_name_Basis_Thermal),shell=True)
mesh = Mesh(’{}.xml.gz’.format(file_name_Basis_Thermal))
boundaries = MeshFunction(“size_t”, mesh, “{}_facet_region.xml.gz”.format(file_name_Basis_Thermal))
subdomains = MeshFunction(“size_t”, mesh, “{}_physical_region.xml.gz”.format(file_name_Basis_Thermal))
#################### Expansion #####################
file_name_Basis_Elasticity = ‘block’
lmbda = 10.0
mu = 5.0
alpha = 1.25e-5
def eps(v):
return sym(grad(v))
def sigma(v, dT):
return (lmbdatr(eps(v))- alpha(3lmbda+2mu)dT)Identity(3) + 2.0mueps(v)
Vu = VectorFunctionSpace(mesh, ‘CG’, 1)
du = TrialFunction(Vu)
u_ = TestFunction(Vu)
bcu = DirichletBC(Vu.sub(2), Constant(0), boundaries, 13) # bottom
#define measures
ds = Measure(‘ds’, domain=mesh, subdomain_data=boundaries)
dx = Measure(‘dx’, domain=mesh, subdomain_data=subdomains)
Define variational form
Delta_T = 2000
Wint = inner(sigma(du, Delta_T), eps(u_))*dx(14)
aM = lhs(Wint)
LM = rhs(Wint)
Solve problem
u = Function(Vu, name=“Displacement”)
solve(aM == LM, u, bcu, solver_parameters={‘linear_solver’: ‘mumps’})
pvd
pvd_file_u = File(“box.pvd”)
pvd_file_u << u