Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Numerical parameters #1150

Open
IvarStefansson opened this issue Apr 25, 2024 · 3 comments
Open

Numerical parameters #1150

IvarStefansson opened this issue Apr 25, 2024 · 3 comments
Assignees
Labels
user group Issue to be worked on in the internal user group.

Comments

@IvarStefansson
Copy link
Contributor

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:

  1. Cleanliness.
  2. Getting an overview of such numerical parameters in use.
  3. (hopefully) introduce scaling of numerical parameters, just as with physical ones.
@IvarStefansson IvarStefansson added the user group Issue to be worked on in the internal user group. label Apr 25, 2024
@IvarStefansson
Copy link
Contributor Author

Note that this may affect both model parameters and solver parameters as defined in #1210.

@jwboth
Copy link
Contributor

jwboth commented Sep 5, 2024

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.

@isakhammer
Copy link

isakhammer commented Sep 5, 2024

Work in progress of Overview of Potential Parameters classes PorePy

Below is a list of parameters that are less frequently used but could be valuable to incorporate into the class.

  1. Where and what these parameters are used
    (Based on the source code)

  2. How these parameters are tested
    (Based on the testing framework, tutorials and run scripts)

Suggestions from Eirik:

  • Search for tol to identify various tolerance parameters across different contexts.
  • Maintain a high-level overview; avoid going too deep into specific cases.

Candidates for contact mechanics

Todo

Newton solver

Todo

Physical parameters

test_thermoporomechanics.py

    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
    )

test_thermoporomechanics.py 2

    params = {
        "times_to_export": [],  # Suppress output for tests
        "fracture_indices": [0],
        "cartesian": True,
        "uy_north": -1e-5,
        "material_constants": {"solid": solid, "fluid": fluid},
    }

Candidates for mesh arguments og grids

Todo

  1. test_refinement 1

    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])},
    }
  2. test_mdg_generation

        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,
        }
        
         ```
    
  3. test_mdg_generation 2

           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,
       }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
user group Issue to be worked on in the internal user group.
Projects
None yet
Development

No branches or pull requests

3 participants