ICFERST  22-06
Reservoir simulator based on DCVFEM, Dynamic Mesh optimisation and Surface-based modelling
multi_data_types Module Reference

This module contains all the ICFERST structures and associated subroutines (allocate/deallocate) Use it also to identify what a variable means since here they are described. More...

Data Types

interface  allocate_multi_dev_shape_funs
 Allocates the required memory to store the derivatives of the shape functions. More...
 
interface  allocate_multi_field
 Allocated a multi field type based on field name. More...
 
type  multi_absorption
 Comprises all the absorption terms that migth be required. More...
 
type  multi_dev_shape_funs
 Data structure to store the derivatives of the shape functions and conversors from reference element to local. More...
 
type  multi_dimensions
 Data type storing all the dimensionrs describing the mesh, fields, nodes, etc. More...
 
type  multi_discretization_opts
 This type includes the necessary information to choose from the different discretization options available They are a mistery even for the most advanced wizards of the realm... hopefully they can be removed in the future These parameters represent the degree of discretisation used, they are in general hardcoded based on the precision requested by the user so as said, to be removed in the future hopefully. More...
 
type  multi_field
 Type created to store absorption terms in a compacted way associated subroutines where created to be used with these fields. More...
 
type  multi_gi_dimensions
 Necessary information for perform gauss integration. More...
 
type  multi_matrices
 This type contains all the necessary information to solve =systems, matrices, RHS, limiters, colouring and also flags to decide which sort of matrices are generated. More...
 
type  multi_ndgln
 This type contains all the local to global conversors for the different fields we have. More...
 
type  multi_outfluxes
 Contains variables to analyse the flux across the BCs that the user is interested. More...
 
type  multi_pipe_package
 Contains all the information required to model pipes. Many of these fields are unnecessary or even undesired... More...
 
type  multi_shape_funs
 Data structure to store all the shape functions to facilitate its movement throughtout the code. More...
 
type  multi_sparsities
 This data type contains all the sparsities necessary in the multiphase prototype code. More...
 
type  multi_sparsity
 This type comprises the necessary variables to represent matrices using a CSR structure. More...
 
type  multi_transport_scalar
 Contains all the information for generic scalar fields to solve for. More...
 
type  pipe_coords
 Type containing everything required to indentify and store which nodes contain a well/pipe. More...
 
type  porous_adv_coefs
 Required values to compute the fluxes for porous media. Effectively the sigma terms from the papers Currently they are oversized since apart from the permeability they are not tensors, this should be changed! More...
 

Functions/Subroutines

subroutine deallocate_multi_field (mfield, and_destroy)
 Deallocation of a multi field type. More...
 
subroutine deallocate_multi_absorption (multi_absorp, and_destroy)
 Deallocation of all of the multi field types within multi_absorp. More...
 
subroutine get_multi_field (mfield, inode_in, output)
 Given a multi field returns an array with its values at inode_in. More...
 
subroutine get_multi_field_inverse (mfield, inode_in, output)
 Given a multi field returns the inverse as an array with its values at inode_in. More...
 
subroutine print_multi_field (mfield, inode_in, dimension)
 Given a multi field returns prints its values at inode_in. More...
 
subroutine add_array_to_multi_field (mfield, b, xpos, ypos, inode)
 This subroutine performs the addition of an array and a multifield and returns the multifield mfield = mfield + b xpos and ypos are the starting positions for a full matrix they have to be one. More...
 
subroutine add_multi_field_to_array (mfield, b, xpos, ypos, inode, a_in)
 This subroutine performs the addition of an array and a multifield and returns the array b = b + a * mfield xpos and ypos are the starting positions for a full matrix they have to be one. More...
 
subroutine mult_multi_field_by_array (mfield, b, inode)
 This subroutine performs the multiplication of an array and a multifield and returns the multifield mfield = mfield * b. More...
 
subroutine mult_multi_field_by_array_on_array (mfield, b, inode)
 This subroutine performs the multiplication of an array and a multifield and returns the array b = mfield * b. More...
 
subroutine scale_multi_field (mfield, a, inode)
 This subroutine rescales a multifield mfield = a * mfield. More...
 
subroutine linearise_multi_field (mfield, Mdims, ndgln)
 This subroutine linearises a multifield. i.e. takes it from P2 to P1. More...
 
subroutine allocate_multi_shape_funs (shape_fun, Mdims, GIdims)
 This subroutine allocates and initialises to zero all the arrays in a multi_shape_funs data type It uses the Dimensions of the model and the gauss integration to be used to allocate the necessary shape functions. More...
 
subroutine deallocate_multi_shape_funs (shape_fun)
 This subroutine deallocates and nullifies all the fields inside multi_shape_funs. More...
 
subroutine deallocate_projection_matrices (shape_fun)
 This subroutine deallocates projection matrices CV2FE & FE2CV stored in shape_fun. More...
 
subroutine allocate_multi_sparsities (Mspars, Mdims, mx_ncolacv, mx_ncoldgm_pha, mx_nct, mx_nc, mx_ncolm, mx_ncolph)
 This subroutine allocates part of the memory inside Mspars, i.e. sparsities of the different matrices IMPORTANT: Despite this subroutine can be called by itself it is highly recommended to be called ONLY through multi_sparsity/Get_Sparsity_Patterns. More...
 
subroutine deallocate_multi_sparsities (Mspars)
 This subroutine deallocates all the memory inside Mspars. More...
 
subroutine allocate_multi_ndgln (ndgln, Mdims)
 This subroutine allocates the global to local conversors. More...
 
subroutine deallocate_multi_ndgln (ndgln)
 Deallocates Global to local fields NOTE that Only deallocates suf_cv, suf_p and suf_u since the others are pointers to state. More...
 
subroutine destroy_multi_matrices (Mmat)
 Deallocates and nullifies the memory generated for the matrices, it is to be used after adapting the mesh. More...
 
subroutine deallocate_multi_dev_shape_funs (DevFuns)
 Deallocates the required memory to store the derivatives of the shape functions. More...
 
subroutine allocate_porous_adv_coefs (Mdims, upwnd)
 Allocates the memory for the advection coefficients for porous media. More...
 
subroutine deallocate_porous_adv_coefs (upwnd)
 Deallocates the memory for the advection coefficients for porous media. More...
 
subroutine allocate_multi_pipe_package (pipes, Mdims, Mspars)
 Allocates the necessary memory for multi_pipe_package. More...
 
subroutine deallocate_multi_pipe_package (pipes)
 Deallocates the necessary memory for multi_pipe_package. More...
 
subroutine initialize_multi_outfluxes (outfluxes)
 Read in the surface IDs of the boundaries (if any) that you wish to integrate over into the (integer vector) variable outfluxesoutlet_id and stores them into the multi_outfluxes field. More...
 
subroutine allocate_multi_outfluxes (Mdims, outfluxes)
 Initialises memory for outfluxes. More...
 
subroutine destroy_multi_outfluxes (outfluxes)
 Deallocates the multi_outfluxes field. More...
 

Detailed Description

This module contains all the ICFERST structures and associated subroutines (allocate/deallocate) Use it also to identify what a variable means since here they are described.

Function/Subroutine Documentation

◆ add_array_to_multi_field()

subroutine multi_data_types::add_array_to_multi_field ( type( multi_field ), intent(inout)  mfield,
real, dimension(:,:), intent(in)  b,
integer, intent(in)  xpos,
integer, intent(in)  ypos,
integer, intent(in)  inode 
)

This subroutine performs the addition of an array and a multifield and returns the multifield mfield = mfield + b xpos and ypos are the starting positions for a full matrix they have to be one.

Parameters
mfieldmultifield to be multiplied
bthe array to add
xposstarting positions
yposstarting positions
inodeposition to be retrieved
Return values
sameinput mfield with added b

◆ add_multi_field_to_array()

subroutine multi_data_types::add_multi_field_to_array ( type( multi_field ), intent(in)  mfield,
real, dimension(:,:), intent(inout)  b,
integer, intent(in)  xpos,
integer, intent(in)  ypos,
integer, intent(in)  inode,
real, intent(in), optional  a_in 
)

This subroutine performs the addition of an array and a multifield and returns the array b = b + a * mfield xpos and ypos are the starting positions for a full matrix they have to be one.

Parameters
mfieldmultifield to be multiplied
bthe array to add
xposstarting positions
yposstarting positions
inodeposition to be retrieved
a_inmultiplier of mfield
Return values
sameinput array with added mfield
Here is the caller graph for this function:

◆ allocate_multi_ndgln()

subroutine multi_data_types::allocate_multi_ndgln ( type(multi_ndgln), intent(inout)  ndgln,
type(multi_dimensions), intent(in)  Mdims 
)

This subroutine allocates the global to local conversors.

Parameters
ndglnGlobal to local field
Mdimsdimensions of the model
Here is the caller graph for this function:

◆ allocate_multi_outfluxes()

subroutine multi_data_types::allocate_multi_outfluxes ( type (multi_dimensions), intent(in)  Mdims,
type (multi_outfluxes), intent(inout)  outfluxes 
)

Initialises memory for outfluxes.

Parameters
Mdimsdimensions of the model
outfluxesthe multi_outfluxes field
Here is the caller graph for this function:

◆ allocate_multi_pipe_package()

subroutine multi_data_types::allocate_multi_pipe_package ( type (multi_pipe_package), intent(inout)  pipes,
type (multi_dimensions), intent(in)  Mdims,
type (multi_sparsities), intent(in)  Mspars 
)

Allocates the necessary memory for multi_pipe_package.

Parameters
pipesoutput the multi_pipe_package field with memory allocated
Mdimsdimensions of the model
Msparsmulti_sparsities of the model

◆ allocate_multi_shape_funs()

subroutine multi_data_types::allocate_multi_shape_funs ( type(multi_shape_funs), intent(inout)  shape_fun,
type(multi_dimensions), intent(in)  Mdims,
type(multi_gi_dimensions), intent(in)  GIdims 
)

This subroutine allocates and initialises to zero all the arrays in a multi_shape_funs data type It uses the Dimensions of the model and the gauss integration to be used to allocate the necessary shape functions.

Parameters
shape_funShape functions for a given type of mesh, pressure or velocity
MdimsDimensions of the model
GIdimsGI dimensions to be used, consistent with the mesh used for shape_fun
Here is the caller graph for this function:

◆ allocate_multi_sparsities()

subroutine multi_data_types::allocate_multi_sparsities ( type (multi_sparsities), intent(inout)  Mspars,
type(multi_dimensions), intent(in)  Mdims,
integer  mx_ncolacv,
integer  mx_ncoldgm_pha,
integer  mx_nct,
integer  mx_nc,
integer  mx_ncolm,
integer  mx_ncolph 
)

This subroutine allocates part of the memory inside Mspars, i.e. sparsities of the different matrices IMPORTANT: Despite this subroutine can be called by itself it is highly recommended to be called ONLY through multi_sparsity/Get_Sparsity_Patterns.

Here is the caller graph for this function:

◆ allocate_porous_adv_coefs()

subroutine multi_data_types::allocate_porous_adv_coefs ( type (multi_dimensions), intent(in)  Mdims,
type (porous_adv_coefs), intent(inout)  upwnd 
)

Allocates the memory for the advection coefficients for porous media.

Parameters
Mdims-dimensions of the model
upwndmulti_dimensions field
Here is the caller graph for this function:

◆ deallocate_multi_absorption()

subroutine multi_data_types::deallocate_multi_absorption ( type( multi_absorption ), intent(inout)  multi_absorp,
logical, intent(in), optional  and_destroy 
)

Deallocation of all of the multi field types within multi_absorp.

Parameters
multi_absorpall multifields within multi_absorp are deallocated
and_destroyif not and_destroy then only the pointer is nullified, otherwise the field is deallocated
Here is the call graph for this function:
Here is the caller graph for this function:

◆ deallocate_multi_dev_shape_funs()

subroutine multi_data_types::deallocate_multi_dev_shape_funs ( type (multi_dev_shape_funs), intent(inout)  DevFuns)

Deallocates the required memory to store the derivatives of the shape functions.

Parameters
DevFunsoutput field with the memory deallocated and pointers nullified
Here is the caller graph for this function:

◆ deallocate_multi_field()

subroutine multi_data_types::deallocate_multi_field ( type( multi_field ), intent(inout)  mfield,
logical, intent(in), optional  and_destroy 
)

Deallocation of a multi field type.

Parameters
mfieldmultifield to be deallocated
and_destroyif not and_destroy then only the pointer is nullified, otherwise the field is deallocated
Here is the caller graph for this function:

◆ deallocate_multi_ndgln()

subroutine multi_data_types::deallocate_multi_ndgln ( type(multi_ndgln), intent(inout)  ndgln)

Deallocates Global to local fields NOTE that Only deallocates suf_cv, suf_p and suf_u since the others are pointers to state.

Parameters
ndglnGlobal to local field
Here is the caller graph for this function:

◆ deallocate_multi_pipe_package()

subroutine multi_data_types::deallocate_multi_pipe_package ( type (multi_pipe_package), intent(inout)  pipes)

Deallocates the necessary memory for multi_pipe_package.

Parameters
pipesoutput the multi_pipe_package field with memory deallocated
Here is the caller graph for this function:

◆ deallocate_multi_shape_funs()

subroutine multi_data_types::deallocate_multi_shape_funs ( type(multi_shape_funs), intent(inout)  shape_fun)

This subroutine deallocates and nullifies all the fields inside multi_shape_funs.

Parameters
shape_funShape functions for a given type of mesh, pressure or velocity
Here is the caller graph for this function:

◆ deallocate_multi_sparsities()

subroutine multi_data_types::deallocate_multi_sparsities ( type (multi_sparsities), intent(inout)  Mspars)

This subroutine deallocates all the memory inside Mspars.

Parameters
MsparsMulti_sparsities field
Here is the caller graph for this function:

◆ deallocate_porous_adv_coefs()

subroutine multi_data_types::deallocate_porous_adv_coefs ( type (porous_adv_coefs), intent(inout)  upwnd)

Deallocates the memory for the advection coefficients for porous media.

Parameters
upwndmulti_dimensions field
Here is the caller graph for this function:

◆ deallocate_projection_matrices()

subroutine multi_data_types::deallocate_projection_matrices ( type(multi_shape_funs), intent(inout)  shape_fun)

This subroutine deallocates projection matrices CV2FE & FE2CV stored in shape_fun.

Parameters
shape_funShape functions for a given type of mesh, pressure or velocity
Here is the caller graph for this function:

◆ destroy_multi_matrices()

subroutine multi_data_types::destroy_multi_matrices ( type (multi_matrices), intent(inout)  Mmat)

Deallocates and nullifies the memory generated for the matrices, it is to be used after adapting the mesh.

Parameters
Mmatmulti_matrices containing the memory used to solve for the different fields
Here is the caller graph for this function:

◆ destroy_multi_outfluxes()

subroutine multi_data_types::destroy_multi_outfluxes ( type (multi_outfluxes), intent(inout)  outfluxes)

Deallocates the multi_outfluxes field.

Parameters
outfluxesthe multi_outfluxes field
Here is the caller graph for this function:

◆ get_multi_field()

subroutine multi_data_types::get_multi_field ( type( multi_field ), intent(in)  mfield,
integer, intent(in)  inode_in,
real, dimension(:,:), intent(inout)  output 
)

Given a multi field returns an array with its values at inode_in.

Parameters
mfieldmultifield to be copied into an array
inode_inposition to be retrieved
Return values
outputarray of size (ndim*nphase, ndim*nphase) containing the mfield at inode_in
Here is the caller graph for this function:

◆ get_multi_field_inverse()

subroutine multi_data_types::get_multi_field_inverse ( type( multi_field ), intent(in)  mfield,
integer, intent(in)  inode_in,
real, dimension(:,:), intent(inout)  output 
)

Given a multi field returns the inverse as an array with its values at inode_in.

Parameters
mfieldmultifield to be copied into an array
inode_inposition to be retrieved
Return values
outputarray of size (ndim*nphase, ndim*nphase) containing the inverse of mfield at inode_in

◆ initialize_multi_outfluxes()

subroutine multi_data_types::initialize_multi_outfluxes ( type (multi_outfluxes), intent(inout)  outfluxes)

Read in the surface IDs of the boundaries (if any) that you wish to integrate over into the (integer vector) variable outfluxesoutlet_id and stores them into the multi_outfluxes field.

Parameters
outfluxesthe multi_outfluxes field
Here is the caller graph for this function:

◆ linearise_multi_field()

subroutine multi_data_types::linearise_multi_field ( type( multi_field ), intent(inout)  mfield,
type( multi_dimensions ), intent(in)  Mdims,
integer, dimension( : ), intent(in), pointer  ndgln 
)

This subroutine linearises a multifield. i.e. takes it from P2 to P1.

Parameters
mfieldmultifield to be rescaled
Mdimsdimensions of the model
ndglnglobal to local numbering
Return values
sameinput mfield linearised

◆ mult_multi_field_by_array()

subroutine multi_data_types::mult_multi_field_by_array ( type( multi_field ), intent(inout)  mfield,
real, dimension(:,:), intent(in)  b,
integer, intent(in)  inode 
)

This subroutine performs the multiplication of an array and a multifield and returns the multifield mfield = mfield * b.

Parameters
mfieldmultifield to be multiplied
bthe array to multiply
inodeposition to be retrieved
Return values
sameinput mfield times b

◆ mult_multi_field_by_array_on_array()

subroutine multi_data_types::mult_multi_field_by_array_on_array ( type( multi_field ), intent(in)  mfield,
real, dimension(:,:), intent(inout)  b,
integer, intent(in)  inode 
)

This subroutine performs the multiplication of an array and a multifield and returns the array b = mfield * b.

Parameters
mfieldmultifield to be multiplied
bthe array to multiply
inodeposition to be retrieved
Return values
sameinput mfield times b

◆ print_multi_field()

subroutine multi_data_types::print_multi_field ( type( multi_field ), intent(in)  mfield,
integer, intent(in)  inode_in,
integer  dimension 
)

Given a multi field returns prints its values at inode_in.

Parameters
mfieldmultifield to be copied into an array
inode_inposition to be retrieved
dimensionmust have size(ndim*nphase, ndim*nphase)
Here is the call graph for this function:

◆ scale_multi_field()

subroutine multi_data_types::scale_multi_field ( type( multi_field ), intent(inout)  mfield,
real, intent(in)  a,
integer, intent(in)  inode 
)

This subroutine rescales a multifield mfield = a * mfield.

Parameters
mfieldmultifield to be rescaled
athe scaling real
inodeposition to be retrieved
Return values
sameinput mfield times a