Does this help?
In this script, we define a steady state heat transfer problem. The H transport problem is empty (ie. no boundary conditions or sources, so c=0) just to focus on the heat transfer pb.
If I understand correctly, you want to define different materials and assign different material properties, correct? You can do this by giving several F.Material
objects to the Simulation
each will have an id
corresponding to the volume id and its own set of parameters (diffusivity, solubility, thermal properties, etc.)
Consider this section of the documentation and this tutorial
import festim as F
my_model = F.Simulation()
my_model.T = F.HeatTransferProblem(transient=False)
# ------ Mesh ------
vertices = np.concatenate([np.linspace(0, 0.5), np.linspace(0.5, 1)])
my_model.mesh = F.MeshFromVertices(vertices)
# ------ Materials ------
material_1 = F.Material(id=1, D_0=1, E_D=0, thermal_cond=2, borders=[0, 0.5])
material_2 = F.Material(id=2, D_0=1, E_D=0, thermal_cond=30, borders=[0.5, 1])
my_model.materials = [material_1, material_2]
# ------ Volumetric heat sources ------
my_model.sources = [
F.Source(value=10, volume=1, field="T"),
F.Source(value=100, volume=2, field="T"),
]
# ------ Boundary conditions ------
my_model.boundary_conditions = [
F.DirichletBC(value=0, surfaces=[1, 2], field="T")
]
# ------ Exports, settings ------
my_model.exports = [
F.XDMFExport(field="T", checkpoint=False)
]
my_model.settings = F.Settings(
absolute_tolerance=1e-10,
relative_tolerance=1e-10,
transient=False,
)
my_model.initialise()
my_model.run()
Opening the XDMF file in paraview you obtain: