Dear Robert,
Thanks a lot for the hint. I got it working now. The example you pointed out did work for me in the sense that I was able to access both region conductivities in the post_process function. However, I couldn’t get a material function for a temperature dependent conductivity working.
But your comment regarding the coordinates outside the Pore cells pointed me in the right direction. This is how I solved it now (I’m not a programmer and am sure there are more elegant ways to do it):
def return_indices_of_a(a, b): b_set = set(b) return [i for i, v in enumerate(a) if v in b_set]
def material_func(ts, coors, problem, equations=None, mode=None, **kwargs): """ Returns the thermal conductivity of the porous material. """ ev = problem.evaluate if mode == 'qp': Om = problem.domain.regions['Omega'].get_cells() Po = problem.domain.regions['Pore'].get_cells() Fi = problem.domain.regions['Fill'].get_cells()
T_omega = np.array(ev('ev_volume_integrate.2.Omega(T)', mode='qp', verbose=False))
val = np.zeros(T_omega.shape)
idx_pore = return_indices_of_a(Om,Po)
idx_fill = return_indices_of_a(Om,Fi)
val[idx_pore,:,0,0]= (-7.61404 + 0.14152*T_omega[idx_pore,:,0,0] - 1.09156e-4*T_omega[idx_pore,:,0,0]**2 + 4.16029e-8*T_omega[idx_pore,:,0,0]**3)/1000
val[idx_fill,:,0,0]=1
output('conductivity: min:', val.min(), 'max:', val.max())
val.shape = (val.shape[0] * val.shape[1], 1, 1)
return {'val' : val}
materials = { 'Omega' : 'material_func', }
Now I have a temperature dependent conductivity for the pores and can access both, the pore and solid conductivities using: problem. evaluate('ev_integrate_mat.2.Omega(Omega.val, T)', mode='el_avg')
Thanks a lot for the help and kind regards, Jochen