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

This module contains all the subroutines to assemble and solve for pipes. More...

Functions/Subroutines

subroutine, public assemble_pipe_transport_and_cty (state, packed_state, tracer, den_all, denold_all, final_phase, Mdims, ndgln, DERIV, CV_P, SOURCT_ALL, ABSORBT_ALL, WIC_T_BC_ALL, WIC_D_BC_ALL, WIC_U_BC_ALL, SUF_T_BC_ALL, SUF_D_BC_ALL, SUF_U_BC_ALL, getcv_disc, getct, Mmat, Mspars, upwnd, GOT_T2, DT, pipes_aux, DIAG_SCALE_PRES_COUP, DIAG_SCALE_PRES, mean_pore_cv, eles_with_pipe, thermal, CV_BETA, MASS_CV, INV_B, MASS_ELE, bcs_outfluxes, outfluxes, porous_heat_coef, assemble_collapsed_to_one_phase)
 : This sub modifies either MmatCT or the Advection-diffusion equation for 1D pipe modelling NOTE final_phase has to be define for the reservoir domain, i.e. for two phase flow it can be either 1 or 2, not 3 or 4. We define wells_first_phase as the first phase of the well domain More...
 
subroutine, public mod_1d_force_bal_c (STATE, packed_state, Mdims, Mspars, Mmat, ndgln, eles_with_pipe, GET_PIVIT_MAT, WIC_P_BC_ALL, SUF_P_BC_ALL, SIGMA, NU_ALL, U_SOURCE, U_SOURCE_CV, pipes_aux)
 : This sub modifies MmatC for 1D pipe modelling. Works on the momentum equation More...
 
subroutine, public retrieve_pipes_coords (state, packed_state, Mdims, ndgln, eles_with_pipe)
 : In this subroutine the elements that contain pipes are identified The pipes can either be defined using python (DEPRECATED) or a nastran file defining the trajectory of each well by points More...
 
subroutine, public initialize_pipes_package_and_gamma (state, packed_state, pipes_aux, Mdims, Mspars, ndgln)
 This subroutine reads information from diamond and populates the necessary fields For P0DGP1 gamma is imposed to be zero at the boundary so the strong BCs work fine. More...
 

Detailed Description

This module contains all the subroutines to assemble and solve for pipes.

Function/Subroutine Documentation

◆ assemble_pipe_transport_and_cty()

subroutine, public multi_pipes::assemble_pipe_transport_and_cty ( type(state_type), dimension(:), intent(in)  state,
type(state_type), intent(inout)  packed_state,
type(tensor_field), intent(inout)  tracer,
real, dimension(:,:), intent(inout)  den_all,
real, dimension(:,:), intent(inout)  denold_all,
integer, intent(in)  final_phase,
type(multi_dimensions), intent(in)  Mdims,
type(multi_ndgln), intent(in)  ndgln,
real, dimension( :, : ), intent(in)  DERIV,
real, dimension( :, :, : ), intent(in)  CV_P,
real, dimension( :, : ), intent(in)  SOURCT_ALL,
real, dimension( :, :, : ), intent(in), pointer  ABSORBT_ALL,
integer, dimension(:,:,:), intent(in)  WIC_T_BC_ALL,
integer, dimension(:,:,:), intent(in)  WIC_D_BC_ALL,
integer, dimension(:,:,:), intent(in)  WIC_U_BC_ALL,
real, dimension(:,:,:), intent(inout)  SUF_T_BC_ALL,
real, dimension(:,:,:), intent(inout)  SUF_D_BC_ALL,
real, dimension(:,:,:), intent(inout)  SUF_U_BC_ALL,
logical, intent(in)  getcv_disc,
logical, intent(in)  getct,
type (multi_matrices), intent(inout)  Mmat,
type (multi_sparsities), intent(in)  Mspars,
type (porous_adv_coefs), intent(inout)  upwnd,
logical, intent(in)  GOT_T2,
real, intent(in)  DT,
type (multi_pipe_package), intent(in)  pipes_aux,
real, dimension(:,:,:), intent(inout)  DIAG_SCALE_PRES_COUP,
real, dimension(:,:), intent(inout)  DIAG_SCALE_PRES,
real, dimension( :, : ), intent(inout)  mean_pore_cv,
type(pipe_coords), dimension(:), intent(in)  eles_with_pipe,
logical, intent(in)  thermal,
real, intent(in)  CV_BETA,
real, dimension(:), intent(inout)  MASS_CV,
real, dimension(:,:,:), intent(inout)  INV_B,
real, dimension(:), intent(inout)  MASS_ELE,
real, dimension(:,:, :), intent(inout), allocatable  bcs_outfluxes,
type (multi_outfluxes), intent(inout)  outfluxes,
real, dimension( : ), intent(in), optional  porous_heat_coef,
logical, intent(in)  assemble_collapsed_to_one_phase 
)

: This sub modifies either MmatCT or the Advection-diffusion equation for 1D pipe modelling NOTE final_phase has to be define for the reservoir domain, i.e. for two phase flow it can be either 1 or 2, not 3 or 4. We define wells_first_phase as the first phase of the well domain

Parameters
stateLinked list containing all the fields defined in diamond and considered by Fluidity
packed_stateLinked list containing all the fields used by IC-FERST, memory partially shared with state
tracertracer to be assembled
den_all,denold_alldensity and old density. Required like this to apply Boussinesq if required
final_phaseThis is the final phase to be assembled, in this way we can assemble from phase 1 to final_phase not necessarily being for all the phases
MdimsData type storing all the dimensions describing the mesh, fields, nodes, etc
ndglnGlobal to local variables
DERIVDerivative of the density against the pressure (nphase,Mdimscv_nonods)
CV_P! Control volume pressure, useless for the DCVFEM (1,Mdimsnpres,Mdimscv_nonods)
SOURCT_ALLSource term of the tracer equation
ABSORBT_ALLAbsorption to be used here
WIC_T_BC_ALLBoundary conditions for the tracer
WIC_D_BC_ALLBoundary conditions for the density
WIC_U_BC_ALLBoundary conditions for the velocity
SUF_T_BC_ALLValues of the tracer at the surface of the elements?
SUF_D_BC_ALLValues of the density at the surface of the elements?
SUF_U_BC_ALLValues of the velocity at the surface of the elements?
GETCV_DISCobtain the transport equation
GETCTobtain the continuity equation
MmatMatrices for ICFERST
MsparsSparsity of the matrices
upwndSigmas to compute the fluxes at the interphase for porous media
GOT_T2.True if solving for a tracer, false otherwise
DTtime-step size
pipes_auxInformation required to define wells
DIAG_SCALE_PRES_COUPDiagonal scaling of (distributed) pressure matrix (for wells)
DIAG_SCALE_PRESDiagonal scaling of (distributed) pressure matrix (used to treat pressure implicitly)
MEAN_PORE_CVPorosity defined control volume wise
eles_with_pipeElements that have a pipe
thermalIf true we are solving for temperature
CV_BETA???
MASS_CVmass of the CVs, the volume
INV_BCoupling term of the wells
MASS_ELEMAss of the elements, volume of elements
bcs_outfluxesOutfluxes that pass boundary conditions, for mass conservation check
outfluxesContains all the fields required to compute the outfluxes of the model and create the outfluxes.csv file. Computed when assembling the continuity equation
porous_heat_coefincludes an average of porous and fluid heat coefficients
assemble_collapsed_to_one_phaseCollapses phases and solves for one single temperature. When there is thermal equilibrium
[in,out]bcs_outfluxes= if allocated then calculate outfluxes
Here is the caller graph for this function:

◆ initialize_pipes_package_and_gamma()

subroutine, public multi_pipes::initialize_pipes_package_and_gamma ( type(state_type), dimension(:), intent(in)  state,
type(state_type), intent(in)  packed_state,
type (multi_pipe_package), intent(inout)  pipes_aux,
type (multi_dimensions), intent(in)  Mdims,
type (multi_sparsities), intent(in)  Mspars,
type(multi_ndgln), intent(in)  ndgln 
)

This subroutine reads information from diamond and populates the necessary fields For P0DGP1 gamma is imposed to be zero at the boundary so the strong BCs work fine.

Parameters
stateLinked list containing all the fields defined in diamond and considered by Fluidity
packed_stateLinked list containing all the fields used by IC-FERST, memory partially shared with state
pipes_auxINOUT Information required to define wells
MdimsData type storing all the dimensions describing the mesh, fields, nodes, etc
MsparsSparsity of the matrices
ndglnGlobal to local variables
Here is the caller graph for this function:

◆ mod_1d_force_bal_c()

subroutine, public multi_pipes::mod_1d_force_bal_c ( type(state_type), dimension( : ), intent(in)  STATE,
type(state_type), intent(in)  packed_state,
type(multi_dimensions), intent(in)  Mdims,
type (multi_sparsities), intent(in)  Mspars,
type (multi_matrices), intent(inout)  Mmat,
type(multi_ndgln), intent(in)  ndgln,
type(pipe_coords), dimension(:), intent(in)  eles_with_pipe,
logical, intent(in)  GET_PIVIT_MAT,
integer, dimension( :,:,: ), intent(in)  WIC_P_BC_ALL,
real, dimension( :, :, : ), intent(in)  SUF_P_BC_ALL,
real, dimension( :, : ), intent(in)  SIGMA,
real, dimension( :, :, : ), intent(in)  NU_ALL,
type( multi_field ), intent(in)  U_SOURCE,
real, dimension( :, :, : ), intent(in)  U_SOURCE_CV,
type (multi_pipe_package), intent(in)  pipes_aux 
)

: This sub modifies MmatC for 1D pipe modelling. Works on the momentum equation

Parameters
stateLinked list containing all the fields defined in diamond and considered by Fluidity
packed_stateLinked list containing all the fields used by IC-FERST, memory partially shared with state
MdimsData type storing all the dimensions describing the mesh, fields, nodes, etc
MsparsSparsity of the matrices
MmatMatrices for ICFERST
ndglnGlobal to local variables
eles_with_pipeElements that have a pipe
GET_PIVIT_MATIf true compute here the Mass matrix for the pipes part, default true.
WIC_P_BC_ALLBoundary conditions for the pressure
SUF_P_BC_ALLValues of the pressure at the surface of the elements?
SIGMAAbsorption term coupling reservoir and wells
NU_ALLnon-linear velocity
U_SOURCESource term of the momentum equation defined on the element mesh
U_SOURCE_CVSource term of the momentum equation defined on the CV mesh
pipes_auxInformation required to define wells
Here is the caller graph for this function:

◆ retrieve_pipes_coords()

subroutine, public multi_pipes::retrieve_pipes_coords ( type(state_type), dimension(:), intent(inout)  state,
type(state_type), intent(in)  packed_state,
type(multi_dimensions), intent(in)  Mdims,
type(multi_ndgln), intent(in)  ndgln,
type(pipe_coords), dimension(:), intent(inout), allocatable  eles_with_pipe 
)

: In this subroutine the elements that contain pipes are identified The pipes can either be defined using python (DEPRECATED) or a nastran file defining the trajectory of each well by points

Parameters
stateLinked list containing all the fields defined in diamond and considered by Fluidity
packed_stateLinked list containing all the fields used by IC-FERST, memory partially shared with state
MdimsData type storing all the dimensions describing the mesh, fields, nodes, etc
ndglnGlobal to local variables
eles_with_pipeINOUT (allocated inside) Elements that have a pipe
Here is the caller graph for this function: