Hello everyone, considering the simplest heat conduction equation, suppose the geometric model is a rectangle; for a boundary of the rectangle, if the temperature on that boundary is T0, it can be represented in Fenics as:
aT = dot(grad(dT), grad(T_))*dx
LT = Constant(0)*T_*dx
bc = DirichletBC(V, Constant(T0.), bottom)
solve(aT == LT, T, bc)
If the heat flux density on that boundary is q0, it can be represented in the variational formulation:
L=Constant(0)*T_*dx - q0*T_*ds
I want to know how to modify the above two parts of code for non-uniform boundary conditions(such as (T0, T1, T2…) or (q0, q1, q2…)), Not considering it can be written in the form of an expression.
I have looked at this method:https://fenicsproject.discourse.group/t/how-to-impose-a-pressure-distribution-from-a-data-file-as-a-boundary-condition-loading/9232/5?u=french_fries , but it does not involve the use of boundary condition statements such as bc = DirichletBC( ) or modifying the variational formulation for the heat flux density condition.