porepy.models.incompressible_flow_model module

This module contains an implementation of a base model for incompressible flow problems.

class IncompressibleFlow(params=None)[source]

Bases: AbstractModel

This is a shell class for single-phase incompressible flow problems.

This class is intended to provide a standardized setup, with all discretizations in place and reasonable parameter and boundary values. The intended use is to inherit from this class, and do the necessary modifications and specifications for the problem to be fully defined. The minimal adjustment needed is to specify the method create_grid(). The class also serves as parent for other model classes (CompressibleFlow).

Public attributes:
variable (str): Name assigned to the pressure variable in the

highest-dimensional subdomain. Will be used throughout the simulations, including in ParaView export. The default variable name is ‘p’.

mortar_variable (str): Name assigned to the flux variable on the interfaces.

Will be used throughout the simulations, including in ParaView export. The default mortar variable name is ‘mortar_p’.

parameter_key (str): Keyword used to define parameters and discretizations. params (dict): Dictionary of parameters used to control the solution procedure.

Some frequently used entries are file and folder names for export,

mesh sizes…

mdg (pp.MixedDimensionalGrid): Mixed-dimensional grid. Should be set by a method

create_grid which should be provided by the user.

convergence_status (bool): Whether the non-linear iteration has converged. linear_solver (str): Specification of linear solver. Only known permissible

value is ‘direct’

exporter (pp.Exporter): Used for writing files for visualization.

All attributes are given natural values at initialization of the class.

The implementation assumes use of AD.

Parameters

params (Optional[Dict]) –

after_newton_convergence(solution, errors, iteration_counter)[source]
Parameters
Return type

None

after_newton_iteration(solution_vector)[source]

Scatters the solution vector for current iterate.

Parameters

solution_vector (np.array) – solution vector for the current iterate.

Return type

None

after_simulation()[source]
before_newton_loop()[source]
prepare_simulation()[source]
Return type

None