Boundary conditions and heat equation #933
-
Hi, I am trying to impose Dirichlet boundary conditions (temperature) on a heat transfer equation problem (similar to example 19 in scikit-fem documentation). bc = basis.zeros() It recognizes well the bottom and top boundaries but always put 0 on the two boundaries (instead of 1000 at the bottom). I suppose I am doing something wrong but what? Thank you |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
I think this is not how you set inhomogeneous boundary condition in a time-dependent problem. I modified the evolution loop as follows in ex19.py: while np.linalg.norm(u, np.inf) > 2**-3:
t = t + dt
u[basis.get_dofs(lambda x: np.isclose(x[1], 3.0))] = 1
u = solve(*penalize(A.T, B @ u, x=u, D=basis.get_dofs()))
yield t, u In other words, you need to enforce the boundary condition at every step over and over again. |
Beta Was this translation helpful? Give feedback.
I think this is not how you set inhomogeneous boundary condition in a time-dependent problem.
I modified the evolution loop as follows in ex19.py:
In other words, you need to enforce the boundary condition at every step over and over again.