Skip to content
Snippets Groups Projects
Commit c2e0d4e2 authored by Jan Habscheid's avatar Jan Habscheid
Browse files

Gen BCS for init T

parent b88ad8ff
Branches
Tags
1 merge request!3Fixed BCS with Generalization and Heaviside step function
......@@ -10,6 +10,13 @@ from petsc4py import PETSc
import matplotlib.pyplot as plt
from HeatCoefficients import *
T_ICE_lb = 100.
T_ICE_ub = 200.
T_MELTING = 273.15
Q_calc = lambda T_ICE: (T_ICE - T_ICE_lb) / (T_MELTING - T_ICE_lb)
T_calc = lambda Q: T_ICE_lb + Q * (T_MELTING - T_ICE_lb)
def solve_heatequation_dimensionless(T_ICE, T_MELTING, dt, t_end, T_REF, relax_param=None, number_cells=128, rtol=1e-4, max_iter=500):
x0 = 0
x1 = 1
......@@ -36,7 +43,7 @@ def solve_heatequation_dimensionless(T_ICE, T_MELTING, dt, t_end, T_REF, relax_p
v = TestFunction(W)
# Define boundary conditions
Theta_LEFT = 0.
Theta_LEFT = Q_calc(T_ICE)
Theta_RIGHT = 1.
def u_left_(x):
return np.full_like(x[0], Theta_LEFT)
......
This diff is collapsed.
This diff is collapsed.
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment