Try using the melting rate as a goal
agzimmerman opened this issue · comments
Alexander G. Zimmerman commented
This could be a small extension from the goal we've used so far, and directly relate our model to the scientific question of basal melting rates.
Alexander G. Zimmerman commented
This worked just as expected! I did this before EGU; but was apparently too lazy to document it here until now.
import phaseflow
end_time = 80.
class Simulation(phaseflow.benchmark_phasechange_simulation.\
ConvectionCoupledMeltingOctadecanePCMBenchmarkPCSimulation):
def __init__(self):
phaseflow.benchmark_phasechange_simulation.ConvectionCoupledMeltingOctadecanePCMBenchmarkPCSimulation.__init__(self)
self.end_time = end_time
self.initial_hot_wall_refinement_cycles = 6
self.output_dir += "melting_rate/"
self.coarsen_between_timesteps = False # Coarsening hurts the time accuracy.
self.nonlinear_solver_absolute_tolerance = 1.e-9
self.second_order_time_discretization = True
def setup_adaptive_goal_form(self):
u_t, T_t, phi_t = self.make_time_discrete_terms()
melting_rate = -phi_t
self.adaptive_goal_form = melting_rate*self.integration_metric
def verify(self):
pass
if __name__ == "__main__":
for epsilon_M in [8.e-5, 4.e-5, 2.e-5]
for dt in [4., 2., 1.]:
sim = Simulation()
sim.timestep_size = dt
sim.adaptive_goal_tolerance = epsilon_M
sim.output_dir += "dt" + str(dt) + "/" + "epsilonM" + str(epsilon_M) + "/"
sim.run()