Closed IvarStefansson closed 3 days ago
Note that this may affect both model parameters and solver parameters as defined in #1210.
Task: Map out "all" numerical constant which are potentially in use. Provide a new object (my suggestion would be to follow the naming style and use NumericalConstants
) - check out models/material_constants.py as well. In the process, we will determine how subclasses can be designed to better indicate the thematic grouping of constants. The priority for the first should be the two reasons mentioned by Ivar. Scaling will follow in a second step.
Below is a list of parameters that are less frequently used but could be valuable to incorporate into the class.
Where and what these parameters are used
(Based on the source code)
How these parameters are tested
(Based on the testing framework, tutorials and run scripts)
tol
to identify various tolerance parameters across different contexts.Todo
Todo
variable_units = [
"Pa",
"Pa * m^2 * s^-1",
"m",
"m",
"K",
"m^-1 * s^-1 * J",
"m^-1 * s^-1 * J",
]
compare_scaled_primary_variables(setup_0, setup_1, variables, variable_units)
secondary_variables = ["darcy_flux", "fluid_flux", "stress", "porosity"]
secondary_units = ["Pa * m^2 * s^-1", "kg * m^-1 * s^-1", "Pa * m", "-"]
domain_dimensions = [None, None, 2, None]
compare_scaled_model_quantities(
setup_0, setup_1, secondary_variables, secondary_units, domain_dimensions
)
params = {
"times_to_export": [], # Suppress output for tests
"fracture_indices": [0],
"cartesian": True,
"uy_north": -1e-5,
"material_constants": {"solid": solid, "fluid": fluid},
}
Todo
mesh_args = {"mesh_size_frac": 1, "mesh_size_bound": 1, "mesh_size_min": 0.1}
num_ref = 3
params = {
"mode": "nested",
"num_refinements": num_ref,
"mesh_param": mesh_args,
}
params = {
"mode": "nested",
"num_refinements": num_ref,
"mesh_param": mesh_args,
# The fracture is a constraint
"grid_param": {"constraints": np.array([0])},
}
def lower_level_extra_args_data_2d(self) -> List[dict]:
"""Admissible keys for 2d cases"""
simplex_extra_args: dict = {
"mesh_size_min": 0.5,
"mesh_size_bound": 1.0,
"mesh_size_frac": 0.5,
}
cartesian_extra_args: dict = {"nx": [10, 10], "physdims": [5, 5]}
tensor_grid_extra_args: dict = {
"x": np.array([0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0]),
"y": np.array([0.0, 0.5, 1.0, 1.5, 2.0, 2.5, 3.0, 3.5, 4.0, 4.5, 5.0]),
}
...
def higher_level_extra_args_data_3d(self) -> List[dict]:
"""Admissible keys in pp.create_mdg for 3d cases"""
simplex_extra_args: dict = {
"cell_size_min": 0.5,
"cell_size_boundary": 1.0,
"cell_size_fracture": 0.5,
}
cartesian_extra_args: dict = {
"cell_size_x": 0.5,
"cell_size_y": 0.5,
"cell_size_z": 0.5,
}
cell_size_args = ["cell_size", "cell_size_x", "cell_size_y", "cell_size_z"]
meshing_args: dict = {
"cell_size": 0.1,
"cell_size_x": 0.1,
"cell_size_y": 0.1,
"cell_size_z": 0.1,
}
Initial tasks identified during discussion:
We might want to collect numerical parameters in some dedicated object, possibly of the
MaterialConstants
type. @keileg's comments copied from other discussion:Agree! I can think of a few reasons for revisiting this: