Hi all, I am still reproducing the 2D case and I have a few question.
-
What does “traps_element_type”: “DG” mean in the line 197 of the code? (iter_2d_case.py, https://github.com/RemDelaporteMathurin/interface_conditions_paper/blob/d40ee0fb3daf0a7622a3e41c84b14014595cbab0/iter_2d_case.py)
-
Does the “boundary_conditions”: “type”: “dc” mean Dirichlet boundary condition? (line 145 to 147 of the iter_2d_case.py)
-
a) I am trying to use the new version (v1.2.1) to run the iter_2d_case based on the source code, but no derived_quantities file was successfully exported. I was wondering why? Here is my code.
import festim as F
my_model = F.Simulation(log_level=20)
import meshio
atom_density_W = 6.28e28
atom_density_Cu = 8.43e28
atom_density_CuCrZr = 2.6096e28
id_W = 8
id_Cu = 7
id_CuCrZr = 6
id_W_yUpper = 18
id_W_xlower = 19
id_CuCrZr_Surface = 16
def rhoCp_W(T):
return 5.15356e-6*T**3-8.30703e-2*T**2+5.98312e2*T+2.48160e6
def rhoCp_Cu(T):
return 1.68402e-4*T**3+6.14079e-2*T**2+4.67353e2*T+3.45899e6
def rhoCp_CuCrZr(T):
return -1.79134e-4*T**3+1.51383e-1*T**2+6.22091e2*T+3.46007e6
chemical_pot_conservation = True
if chemical_pot_conservation:
folder = "iter_2d_case/chemical_pot_conservation"
else:
folder = "iter_2d_case/concentration_continuity"
my_model.mesh = F.MeshFromXDMF(volume_file="bi_material/mesh_domains.xdmf", boundary_file="bi_material/mesh_boundaries.xdmf")
W = F.Material(
D_0=2.9e-7*0.8165,
E_D=0.39,
S_0=1.87e24,
E_S=1.04,
rho= rhoCp_W,
id=8,
)
Cu = F.Material(
D_0=6.6e-7,
E_D=0.387,
S_0=3.14e24,
E_S=0.572,
rho= rhoCp_Cu,
id=7,
)
CuCrZr = F.Material(
D_0=3.92e-7,
E_D=0.418,
S_0=4.28e23,
E_S=0.387,
rho= rhoCp_CuCrZr,
id=6,
)
my_model.materials = F.Materials([W, Cu, CuCrZr])
trap_1 = F.Trap(
E_k=0.39,
k_0=2.9e12*0.8165/atom_density_W,
E_p=1.2,
p_0=8.4e12,
density=5e-4*atom_density_W,
materials=W,
)
trap_2 = F.Trap(
E_k=0.387,
k_0=6.6e-7/(3.61e-10**2)/atom_density_Cu,
E_p=0.5,
p_0=7.98e13,
density=5e-5*atom_density_Cu,
materials=Cu,
)
trap_3 = F.Trap(
E_k=0.418,
k_0=3.92e-7/(3.61e-10**2)/atom_density_CuCrZr,
E_p=0.5,
p_0=7.98e13,
density=5e-5*atom_density_CuCrZr,
materials=CuCrZr,
)
trap_4 = F.Trap(
E_k=0.418,
k_0=3.92e-7/(3.61e-10**2)/atom_density_CuCrZr,
E_p=0.83,
p_0=7.98e13,
density=0.04*atom_density_CuCrZr,
materials=CuCrZr,
)
my_model.traps = [trap_1, trap_2, trap_3, trap_4]
my_model.boundary_conditions = [
F.DirichletBC(field="solute", value=1.223634016511513351e23, surfaces=id_W_yUpper),
F.DirichletBC(field="solute", value=0, surfaces=id_W_xlower),
F.RecombinationFlux(Kr_0=2.9e-14, E_Kr=1.92, order=2, surfaces=id_CuCrZr_Surface)
]
stationary_conditions = [
F.DirichletBC(field="temperature", value=1200, surfaces=id_W_yUpper),
F.DirichletBC(field="temperature",value=373, surfaces=id_CuCrZr_Surface)
]
my_model.dt = F.Stepsize(
initial_value=2.4e5,
stepsize_change_ratio=1.2,
t_stop=1e8,
max_stepsize=1e7,
dt_min=1e-8,
)
my_derived_quantities = F.DerivedQuantities(filename=folder + "derived_quantities.csv")
my_derived_quantities.derived_quantities = [
F.TotalVolume(field="retention", volume=6),
F.TotalVolume(field="retention", volume=7),
F.TotalVolume(field="retention", volume=8),
F.SurfaceFlux(field="solute", surface=18),
F.SurfaceFlux(field="solute", surface=16)
]
my_model.exports = F.Exports(
[
F.XDMFExport(
"retention",
label="retention",
folder=folder,
checkpoint=True,
filename="derived_quantities.xdmf"
),
my_derived_quantities,
]
)
all_timesteps = True
my_model.settings = F.Settings(
absolute_tolerance=1e11,
relative_tolerance=1e-10,
maximum_iterations=20,
)
if my_model is not None:
print(my_model.sources)
else:
my_model.initialise()
my_model.run()
This case has no error message, and also no exported files. 
b) If I change the last part of the code from a) to the way as below, the process finished with exit code 1. How can I improve this?
my_model.initialise()
my_model.run()
Error message is : AttributeError: ‘NoneType’ object has no attribute ‘sources’
Thank you for your prompt attention!