I’m trying to set a material property based on experimental data. Let’s say we have a temperature dependent thermal conductivity.
I’d like to do the following :
from fenics import * from scipy.interpolate import interp1d interpcond = interp1d([300, 400, 500, 600], [1000, 1000, 1500, 3000]) def cond(T): print(type(T)) c = interpcond(T) return c mesh = UnitSquareMesh(8, 8) V = FunctionSpace(mesh, 'P', 1) T = Function(V) v = TestFunction(V) F = cond(T)*dot(grad(T), grad(v))*dx
The above doesn’t work but I wondered if anyone had an idea.
Thanks in advance,