I’m solving for transient heat conduction, and I’ve already defined the boundaries in the previous step, i.e., thermal convection and radiation, so do I still need to represent these in a weak form?
# Assigning BC
class BoundaryCondition():
def __init__(self, type, marker, values,dt=None):
self._type = type
if type == "Dirichlet":
u_D = Function(V)
u_D.interpolate(values)
facets = facet_tag.find(marker)
dofs = locate_dofs_topological(V, fdim, facets)
self._bc = dirichletbc(u_D, dofs)
elif type == "Neumann":
# self._bc = dt * inner(values, v) * ds(marker) #notice dt
self._bc = -inner(values, v) * ds(marker) #notice dt
elif type == "Robin":
# self._bc = values[0] * inner(T-values[1], v)* ds(marker)
self._bc = values[0] * inner(T*theta +(1-theta)*T_n -values[1], v)* ds(marker)
else:
raise TypeError("Unknown boundary condition: {0:s}".format(type))
@property
def bc(self):
return self._bc
@property
def type(self):
return self._type
# weak
a_form = (rho_fem * cp_fem / dt * inner(u, v) * dx +
k_fem * inner(grad(u), grad(v)) * dx +
h_conv_air * inner(u, v) * ds_surface +
epsilon * sigma * (4 * u_n ** 3 * u) * v * ds_surface +
h_conv_table * inner(u, v) * ds_bottom)
L_form = (rho_fem * cp_fem / dt * inner(u_n, v) * dx +
inner(f, v) * dx +
h_conv_air * T_env * v * ds_surface +
epsilon * sigma * (T_env ** 4 - u_n ** 4) * v * ds_surface +
h_conv_table * T_env * v * ds_bottom)
These problems have been bothering me for weeks, causing me to get my temperature values wrong all the time, and I wonder if conditions such as boundaries need to be reflected in weak equations.
It’s unlikely anyone will be able to help unless you read and understand Read before posting: How do I get my question answered? . Closing.