ICFERST  22-06
Reservoir simulator based on DCVFEM, Dynamic Mesh optimisation and Surface-based modelling
multi_dyncore_dg.F90 File Reference
#include "fdebug.h"
Include dependency graph for multi_dyncore_dg.F90:

Modules

module  multiphase_1d_engine
 This module contain all the necessary subroutines to deal with FE-wise equations and fields. Assembling and solving of the momentum equation and associated fields such as capillary pressure, hydrostatic pressure solver, and stabilisation techniques. Also includes the assembly and solving of a Laplacian system (for zeta potential mainly)
 

Functions/Subroutines

subroutine, public multiphase_1d_engine::intenerge_assem_solve (state, packed_state, Mdims, CV_GIdims, CV_funs, Mspars, ndgln, Mdisopt, Mmat, upwnd, tracer, velocity, density, multi_absorp, DT, SUF_SIG_DIAGTEN_BC, VOLFRA_PORE, IGOT_T2, igot_theta_flux, GET_THETA_FLUX, USE_THETA_FLUX, THETA_GDIFF, eles_with_pipe, pipes_aux, option_path, mass_ele_transp, thermal, THETA_FLUX, ONE_M_THETA_FLUX, THETA_FLUX_J, ONE_M_THETA_FLUX_J, icomp, saturation, Permeability_tensor_field, nonlinear_iteration)
 Calls to generate the transport equation for the transport of energy/temperature and to solve the transport of components. More...
 
subroutine effective_cp_density (porous_heat_coef, porous_heat_coef_old)
 : Checks convergence on the temperature field Calculation of the averaged heat capacity and density average = porosity * Cp_f*rho_f + (1-porosity) * CP_p*rho_p Since porous promerties is defined element-wise and fluid properties CV-wise we perform an average as it is stored cv-wise More...
 
subroutine multiphase_1d_engine::force_min_max_principle (Mdims, entrance, tracer, nonlinear_iteration, totally_min_max)
 : To help the stability of the system,if there are no sources/sinks it is known that the temperature must fulfill the min max principle, therefore here values outside this rank are capped. More...
 
subroutine, public multiphase_1d_engine::tracer_assemble_solve (Tracer_name, state, packed_state, Mdims, CV_GIdims, CV_funs, Mspars, ndgln, Mdisopt, Mmat, upwnd, tracer, velocity, density, multi_absorp, DT, SUF_SIG_DIAGTEN_BC, VOLFRA_PORE, IGOT_T2, igot_theta_flux, GET_THETA_FLUX, USE_THETA_FLUX, THETA_GDIFF, eles_with_pipe, pipes_aux, mass_ele_transp, THETA_FLUX, ONE_M_THETA_FLUX, THETA_FLUX_J, ONE_M_THETA_FLUX_J, icomp, saturation, Permeability_tensor_field, nonlinear_iteration)
 Calls to generate and solve the transport equation for n passive tracers defined in diamond as Passive_Tracer_N Where N is an integer which is continuous starting from 1. More...
 
subroutine, public multiphase_1d_engine::volumefraction_assemble_solve (state, packed_state, multicomponent_state, Mdims, CV_GIdims, CV_funs, Mspars, ndgln, Mdisopt, Mmat, multi_absorp, upwnd, eles_with_pipe, pipes_aux, DT, SUF_SIG_DIAGTEN_BC, V_SOURCE, VOLFRA_PORE, igot_theta_flux, mass_ele_transp, nonlinear_iteration, time_step, SFPI_taken, SFPI_its, Courant_number, THETA_FLUX, ONE_M_THETA_FLUX, THETA_FLUX_J, ONE_M_THETA_FLUX_J)
 Calls to generate the transport equation for the saturation. Embeded an FPI with backtracking method is uncluded. More...
 
subroutine update_components ()
 WARNING: Still work in progress. More...
 
subroutine multiphase_1d_engine::compositional_assemble_solve (state, packed_state, multicomponent_state, Mdims, CV_GIdims, CV_funs, Mspars, ndgln, Mdisopt, Mmat, upwnd, multi_absorp, DT, SUF_SIG_DIAGTEN_BC, GET_THETA_FLUX, USE_THETA_FLUX, THETA_GDIFF, eles_with_pipe, pipes_aux, mass_ele, sum_theta_flux, sum_one_m_theta_flux, sum_theta_flux_j, sum_one_m_theta_flux_j)
 :In this subroutine the components are solved for all the phases. Systems for each component are assembled and solved by calling INTENERGE_ASSEM_SOLVE More...
 
subroutine ensure_components_sum_to_one (packed_state)
 WARNING: It is currently not working well...better to use Chris' method which uses a RHS. More...
 
subroutine, public multiphase_1d_engine::force_bal_cty_assem_solve (state, packed_state, Mdims, CV_GIdims, FE_GIdims, CV_funs, FE_funs, Mspars, ndgln, Mdisopt, Mmat, multi_absorp, upwnd, eles_with_pipe, pipes_aux, velocity, pressure, DT, SUF_SIG_DIAGTEN_BC, V_SOURCE, VOLFRA_PORE, IGOT_THETA_FLUX, THETA_FLUX, ONE_M_THETA_FLUX, THETA_FLUX_J, ONE_M_THETA_FLUX_J, calculate_mass_delta, outfluxes, pres_its_taken, nonlinear_its, Courant_number)
 Calls to generate the Gradient Matrix, the divergence matrix, the momentum matrix and the mass matrix Once these matrices (and corresponding RHSs) are generated the system of equations is solved using the projection method. More...
 
subroutine stokes_anderson_acceleration (packed_state, Mdims, Mmat, Mspars, INV_B, rhs_p, ndgln, MASS_ELE, diagonal_A, velocity, P_all, deltap, cmc_petsc, stokes_max_its)
 Generic subroutine that perform the Anderson acceleration solver. This is storing a set of results for a system that converges based on a FPI and finding an optimal combination of all of these results that minimise the residual Method explained in DOI.10.1137/16M1076770. More...
 
subroutine flip_p_and_v_bcs (Mdims, WIC_P_BC_ALL, pressure_BCs, WIC_FLIP_P_VEL_BCS)
 Flip P and V BCs for wells. Implemented for ATES applications or other applications when needing to switch on and off wells. For this to work, need to define boundary conditions for wells for both pressure and velocity in a time-dependent manner through Diamond using a python function. When the user wants the pressure BC to be ignored and the velocity BC to be applied, specify negative pressure. When the user wants the pressure BC to applied, specify normal positive pressure. Specify velocity BCs for both wells as a constant. More...
 
subroutine mult_inv_mass_vel_vector (Mdims, ndgln, vel_vector, MASS_ELE)
 Multiplies the inv of the lumped mass matrix times the vel_vector vel_vector = vel_vector / (mass_ele/vel_local_nodes) More...
 
subroutine generate_pivit_matrix_stokes (Mdims, Mmat, MASS_ELE, diagonal_A)
 Generates a lumped mass matrix for Stokes. It can either have also the diagonal of A or not. More...
 
subroutine solve_and_update_velocity (Mmat, Velocity, CDP_tensor, U_RHS, diagonal_A)
 Update velocity by solving the momentum equation for a given pressure, the RHS is formed here If rescale_mom_matrices = .true., here the RHS rescaled. More...
 
subroutine solve_and_update_pressure (Mdims, rhs_p, P_all, deltap, cmc_petsc, diagonal_CMC, update_pres)
 Compute deltaP by solving the pressure equation using the CMC matrix. More...
 
subroutine project_velocity_to_affine_space (Mdims, Mmat, Mspars, ndgln, velocity, deltap, cdp_tensor)
 Project back the velocity from a non divergent-free space to a divergent free space. More...
 
subroutine compute_div_u (Mdims, Mmat, Mspars, velocity, INV_B, rhs_p, force_transpose_C)
 Calculates the divergence of the velocity by multipliying it by the Ct matrix. More...
 
subroutine include_wells_and_compressibility_into_rhs (Mdims, rhs_p, DIAG_SCALE_PRES, MASS_MN_PRES, MASS_SUF, pipes_aux, DIAG_SCALE_PRES_COUP)
 Include in the pressure matrix the compressibility terms (based on taylor expansion series) to ensure that we account for this term as implicitly as possible. For wells it introduces the coupling between pressures. More...
 
subroutine calc_cvpres_from_fepres ()
 
subroutine porous_assemb_force_cty (packed_state, pressure, Mdims, FE_GIdims, FE_funs, Mspars, ndgln, Mmat, X_ALL, U_SOURCE_CV_ALL)
 and faster to compute than for Navier-Stokes. Therefore, here the RHS and the Mass matrix are computed for this case More...
 
subroutine get_massmatrix (ELE, Mdims, DevFuns, Mmat, X_ALL, UFEN_REVERSED)
 Here no homogenisation can be performed. NOTE: FOR THE TIME BEING ONLY ROW_SUM IS ACTIVATED HERE, AND GET_POROUS_MASS_MATRIX IS KEPT FOR THE DIAGONAL SCALING METHOD. More...
 
subroutine get_all_in_mass_matrix (Mdims, Mmat, DIAG_BIGM_CON, LUMP_PIVIT_ON_ALL, LUMP_DIAG_MOM)
 WARNING****this is under testing****. More...
 
subroutine p0_limiter ()
 : Computes a limited velocity when using a P0DG velocity discretisation More...
 
subroutine multiphase_1d_engine::dg_visc_lin (S_INV_NNX_MAT12, NNX_MAT, NNX_MAT2, NN_MAT, NN_MAT2, U_SNLOC, U_NLOC, SBUFEN_REVERSED, SDETWE, SBCVNGI, SNORMXN_ALL, NDIM, U_SLOC2LOC, U_OTHER_LOC, U_NLOC_EXT, ON_BOUNDARY)
 :<FOR INERTIA ONLY> This sub calculates S_INV_NNX_MAT12 which contains NDIM matricies that are used to form the inter element coupling for the viscocity discretization. NNX_MAT, NNX_MAT2 contain matricies of first derivative times basis function for current element and neightbouring element. Similarly NN_MAT, NN_MAT2, contain the element-wise mass matrices. Only call this sub if element not next to the boundary... More...
 
subroutine multiphase_1d_engine::viscocity_tensor_les_calc (LES_UDIFFUSION, LES_UDIFFUSION_VOL, DUX_ELE_ALL, NDIM, NPHASE, U_NLOC, X_NLOC, TOTELE, X_NONODS, X_ALL, X_NDGLN, MAT_NONODS, MAT_NLOC, MAT_NDGLN, LES_DISOPT, LES_CS, UDEN, CV_NONODS, CV_NDGLN, U_NDGLN, U_NONODS, U_ALL, DERIV)
 : <FOR INERTIA ONLY> This subroutine calculates a tensor of viscocity LES_UDIFFUSION, LES_UDIFFUSION_VOL More...
 
subroutine viscocity_tensor_les_calc_u (LES_U_UDIFFUSION, LES_U_UDIFFUSION_VOL, Q_SCHEME_ABS_CONT_VOL, DUX_ELE_ALL, NDIM, NPHASE, U_NLOC, X_NLOC, TOTELE, X_NONODS, X_ALL, X_NDGLN, LES_DISOPT, CS, U_NDGLN, U_NONODS, U_ALL)
 
subroutine oneeletens_all (LOC_X_ALL, LES_DISOPT, ONE_OVER_H2, TENSXX_ALL, X_NLOC, NDIM, MEAN_UDER_U, NPHASE)
 REPRESENTS THE SIZE AND SHAPE OF THE SURROUNDING ELEMENTS. LES_DISOPT=LES option. More...
 
subroutine jacdia (AA, V, D, N, A)
 find the eigen-vectors V and the eigen values A so that AA=V^T D V & D is diagonal. It uses the algorithm of Matrix Computations 2nd edition, p196. sprint_to_do!!!!MOVE TO FORTRAN 90 More...
 
subroutine jacpre (SINALF, COSALF, P, Q, A, N)
 PRE-MULTIPLY matrix A by transpose of Rotation matrix is realised by passing -SINALF down into SINALF. More...
 
subroutine jacpos (SINALF, COSALF, P, Q, A, N)
 
subroutine multiphase_1d_engine::comb_vel_matrix_diag_dist (DIAG_BIGM_CON, BIGM_CON, DGM_PETSC, FINELE, COLELE, NDIM, NPHASE, U_NLOC, TOTELE, velocity, pressure, Mmat)
 : <FOR INERTIA ONLY>This subroutine combines the distributed and block diagonal for an element into the matrix DGM_PHA. For stokes also the diagonal of the matrix is introduced in the mass matrix More...
 
subroutine multiphase_1d_engine::comb_vel_matrix_diag_dist_lump (DIAG_BIGM_CON, BIGM_CON, DGM_PETSC, FINELE, COLELE, NDIM, NPHASE, U_NLOC, TOTELE, velocity, pressure)
 : <FOR INERTIA ONLY>This subroutine combines the distributed and block diagonal for an element into the matrix DGM_PHA. More...
 
subroutine multiphase_1d_engine::use_posinmat_c_store (COUNT, U_INOD, P_JNOD, U_NONODS, FINDC, COLC, NCOLC, IDO_STORE_AC_SPAR_PT, STORED_AC_SPAR_PT, POSINMAT_C_STORE, ELE, U_ILOC, P_JLOC, TOTELE, U_NLOC, P_NLOC)
 Used to assemble the C matrix in the ICFERST format. More...
 
subroutine multiphase_1d_engine::use_posinmat_c_store_suf_dg (COUNT, U_INOD, P_JNOD, U_NONODS, FINDC, COLC, NCOLC, IDO_STORE_AC_SPAR_PT, STORED_AC_SPAR_PT, POSINMAT_C_STORE_SUF_DG, ELE, IFACE, U_SILOC, P_SJLOC, TOTELE, NFACE, U_SNLOC, P_SNLOC)
 Used to assemble the C matrix in the ICFERST format (for DG?) More...
 
subroutine multiphase_1d_engine::linearise_field (field_in, field_out)
 : <FOR INERTIA ONLY> This sub will linearise a p2 field More...
 
subroutine multiphase_1d_engine::introduce_grad_rhs_field_term (packed_state, Mdims, Mmat, RHS_field, FE_funs, Devfuns, X_ALL, LOC_U_RHS, ele, cv_ndgln, x_ndgln, ele2, iface, sdetwe, SNORMXN_ALL, U_SLOC2LOC, CV_SLOC2LOC, MAT_OTHER_LOC)
 : This subroutine performs and introduces the gradient of a RHS field (Capillary pressure for example) for the momentum equation. It has two options (hard-coded) integrations by parts (activated) or voluemtric integration, For capillary pressure: The capillary pressure is a term introduced as a RHS which affects the effective velocity More...
 
subroutine multiphase_1d_engine::getoverrelaxation_parameter (state, packed_state, Mdims, ndgln, Overrelaxation, Phase_with_Pc, totally_min_max, for_transport)
 Overrelaxation has to be alocate before calling this subroutine its size is cv_nonods For more information read: doi.org/10.1016/j.cma.2019.07.004. More...
 
subroutine multiphase_1d_engine::high_order_pressure_solve (Mdims, ndgln, u_rhs, state, packed_state, nphase, u_absorbin)
 : Instead of including the gravity in the RHS normally, here a system based on a Laplacian is created and solved that accounts for the gravity effect in the system. Next, this is introduced as a RHS in the momemtum equation This allows for higher precision for the gravity effect. > More...
 
real function multiphase_1d_engine::dg_oscilat_detect (SNDOTQ_KEEP, SNDOTQ2_KEEP, N_DOT_DU, N_DOT_DU2, SINCOME, MASS_ELE, MASS_ELE2)
 : <INERTIA ONLY>Determine if we have an oscillation in the normal direction... dg_oscilat_detect=1.0- CENTRAL SCHEME. dg_oscilat_detect=0.0- UPWIND SCHEME. More...
 
real function multiphase_1d_engine::p0_dg_oscilat_detect (SNDOTQ_KEEP, SNDOTQ2_KEEP, N_DOT_DU, N_DOT_DU2, SINCOME, MASS_ELE, MASS_ELE2)
 : <INERTIA ONLY> Determine if we have an oscillation in the normal direction... dg_oscilat_detect=1.0- CENTRAL SCHEME. dg_oscilat_detect=0.0- UPWIND SCHEME. More...
 
subroutine multiphase_1d_engine::diffus_cal_coeff_stress_or_tensor (Mdims, DIFF_COEF_DIVDX, DIFF_COEFOLD_DIVDX, STRESS_FORM, STRESS_FORM_STAB, ZERO_OR_TWO_THIRDS, SBUFEN_REVERSED, SBCVFEN_REVERSED, SBCVNGI, SLOC_UDIFFUSION, SLOC_UDIFFUSION_VOL, SLOC2_UDIFFUSION, SLOC2_UDIFFUSION_VOL, DIFF_GI_ADDED, HDC, U_CV_NODJ_IPHA_ALL, U_CV_NODI_IPHA_ALL, UOLD_CV_NODJ_IPHA_ALL, UOLD_CV_NODI_IPHA_ALL, ELE, ELE2, SNORMXN_ALL, SLOC_DUX_ELE_ALL, SLOC2_DUX_ELE_ALL, SLOC_DUOLDX_ELE_ALL, SLOC2_DUOLDX_ELE_ALL, SELE, WIC_U_BC, WIC_U_BC_DIRICHLET, SIMPLE_DIFF_CALC, DIFF_MIN_FRAC, DIFF_MAX_FRAC)
 : <INERTIA ONLY> This sub calculates the effective diffusion coefficientd DIFF_COEF_DIVDX,DIFF_COEFOLD_DIVDX based on a non-linear method and a non-oscillating scheme. This implements the stress and tensor form of diffusion and calculates a jump conidition. which is in DIFF_COEF_DIVDX, DIFF_COEFOLD_DIVDX The coefficient are in N_DOT_DKDU, N_DOT_DKDUOLD. look at the manual DG treatment of viscocity. More...
 
subroutine for_tens_derivs_ndots (DIFF_STAND_DIVDX_U, N_DOT_DKDU, N_DOT_DKDUOLD, DIFF_GI_ADDED, SLOC_DUX_ELE_ALL, SLOC_DUOLDX_ELE_ALL, SLOC_UDIFFUSION, SLOC_UDIFFUSION_VOL, NDIM_VEL, NDIM, NPHASE, U_SNLOC, CV_SNLOC, SBCVNGI, SBUFEN_REVERSED, SBCVFEN_REVERSED, SNORMXN_ALL, HDC, ZERO_OR_TWO_THIRDS, STRESS_FORM, STRESS_FORM_STAB)
 This implements the stress and tensor form of diffusion and calculates a jump conidition. DIFF_STAND_DIVDX_U is the minimal amount of diffusion. More...
 
subroutine, public multiphase_1d_engine::generate_and_solve_laplacian_system (Mdims, state, packed_state, ndgln, Mmat, Mspars, CV_funs, CV_GIdims, Sigma_field, field_name, K_fields, F_fields, intface_val_type, solver_path)
 : In this method we assemble and solve the Laplacian system using at least P1 elements The equation solved is the following: Div sigma Grad X = - SUM (Div K Grad F) with Neuman BCs = 0 where K and F are passed down as a vector. Therefore for n entries the SUM will be performed over n fields Example: F = (3, nphase, cv_nonods) would include three terms in the RHS and the same for K If harmonic average then we perform the harmonic average of sigma and K IMPORTANT: This subroutine requires the PHsparsity to be generated Note that this method solves considering FE fields. If using CV you may incur in an small error. > More...
 
subroutine multiphase_1d_engine::impose_strong_bcs_wells (state, pipes_aux, Mdims, Mmat, ndgln, CMC_petsc, pressure, rhs_p)
 : In this subroutine, we modify the CMC matrix and the RHS for the pressure to strongly impose the pressure boundary conditions for wells ONLY. This is required only when using P0DG-P1 If not imposing strong pressure BCs and using P0DG-P1, the formulation for weak pressure BCs leads to a 0 in the diagonal of the CMC matrix, therefore strong BCs are required. More...
 
subroutine multiphase_1d_engine::ai_backtracking_parameters (Mdims, ndgln, packed_state, state, courant_number_in, backtrack_par_factor, overrelaxation, res, resold, outer_nonlinear_iteration, for_transport)
 Subroutine that calculates the backtrack_par_factor based on Machine Learning. The inputs of the Machine learning model are dimensionless numbers and configurations of the system. This subroutine also generates several dimensionless numbers cv-wise. More...
 
subroutine get_relative_permeability (Mdims, saturation, Imble_frac, end_point_relperm, exponent_relperm, relperm)
 
real function shock_front_mobility_ratio (ele, Mdims, sat, ndgln, Imble_frac, total_mobility)
 
logical function shock_front_in_ele (ele, Mdims, sat, ndgln, Imble_frac)
 

Function/Subroutine Documentation

◆ calc_cvpres_from_fepres()

subroutine force_bal_cty_assem_solve::calc_cvpres_from_fepres
Here is the call graph for this function:
Here is the caller graph for this function:

◆ compute_div_u()

subroutine force_bal_cty_assem_solve::compute_div_u ( type(multi_dimensions), intent(in)  Mdims,
type (multi_matrices), intent(in)  Mmat,
type (multi_sparsities), intent(in)  Mspars,
real, dimension( :, :, : ), intent(in)  velocity,
real, dimension( :, :, : ), intent(in)  INV_B,
type( vector_field ), intent(inout)  rhs_p,
logical, intent(in), optional  force_transpose_C 
)

Calculates the divergence of the velocity by multipliying it by the Ct matrix.

Author
Pablo Salinas
Here is the call graph for this function:
Here is the caller graph for this function:

◆ effective_cp_density()

subroutine intenerge_assem_solve::effective_cp_density ( real, dimension( : ), intent(inout)  porous_heat_coef,
real, dimension( : ), intent(inout)  porous_heat_coef_old 
)

: Checks convergence on the temperature field Calculation of the averaged heat capacity and density average = porosity * Cp_f*rho_f + (1-porosity) * CP_p*rho_p Since porous promerties is defined element-wise and fluid properties CV-wise we perform an average as it is stored cv-wise

Here is the caller graph for this function:

◆ ensure_components_sum_to_one()

subroutine compositional_assemble_solve::ensure_components_sum_to_one ( type( state_type ), intent(inout)  packed_state)

WARNING: It is currently not working well...better to use Chris' method which uses a RHS.

◆ flip_p_and_v_bcs()

subroutine force_bal_cty_assem_solve::flip_p_and_v_bcs ( type(multi_dimensions), intent(in)  Mdims,
integer, dimension( :,:,: ), intent(in)  WIC_P_BC_ALL,
type(tensor_field)  pressure_BCs,
integer, dimension( 1,mdims%npres,surface_element_count(pressure)), intent(out)  WIC_FLIP_P_VEL_BCS 
)

Flip P and V BCs for wells. Implemented for ATES applications or other applications when needing to switch on and off wells. For this to work, need to define boundary conditions for wells for both pressure and velocity in a time-dependent manner through Diamond using a python function. When the user wants the pressure BC to be ignored and the velocity BC to be applied, specify negative pressure. When the user wants the pressure BC to applied, specify normal positive pressure. Specify velocity BCs for both wells as a constant.

Author
Geraldine Regnier
Here is the caller graph for this function:

◆ for_tens_derivs_ndots()

subroutine diffus_cal_coeff_stress_or_tensor::for_tens_derivs_ndots ( real, dimension( ndim,nphase,sbcvngi ), intent(inout)  DIFF_STAND_DIVDX_U,
real, dimension( ndim_vel,nphase,sbcvngi ), intent(inout)  N_DOT_DKDU,
real, dimension( ndim_vel,nphase,sbcvngi ), intent(inout)  N_DOT_DKDUOLD,
real, dimension( ndim_vel, ndim,ndim, nphase, sbcvngi), intent(in)  DIFF_GI_ADDED,
real, dimension( ndim_vel, ndim , nphase, u_snloc ), intent(in)  SLOC_DUX_ELE_ALL,
real, dimension( ndim_vel, ndim , nphase, u_snloc ), intent(in)  SLOC_DUOLDX_ELE_ALL,
real, dimension( ndim,ndim,nphase,cv_snloc ), intent(in)  SLOC_UDIFFUSION,
real, dimension( nphase,cv_snloc ), intent(in)  SLOC_UDIFFUSION_VOL,
integer, intent(in)  NDIM_VEL,
integer, intent(in)  NDIM,
integer, intent(in)  NPHASE,
integer, intent(in)  U_SNLOC,
integer, intent(in)  CV_SNLOC,
integer, intent(in)  SBCVNGI,
real, dimension( sbcvngi, u_snloc ), intent(in)  SBUFEN_REVERSED,
real, dimension( sbcvngi, cv_snloc ), intent(in)  SBCVFEN_REVERSED,
real, dimension( ndim, sbcvngi ), intent(in)  SNORMXN_ALL,
real, intent(in)  HDC,
real, intent(in)  ZERO_OR_TWO_THIRDS,
logical, intent(in)  STRESS_FORM,
logical, intent(in)  STRESS_FORM_STAB 
)

This implements the stress and tensor form of diffusion and calculates a jump conidition. DIFF_STAND_DIVDX_U is the minimal amount of diffusion.

Here is the caller graph for this function:

◆ generate_pivit_matrix_stokes()

subroutine force_bal_cty_assem_solve::generate_pivit_matrix_stokes ( type(multi_dimensions), intent(in)  Mdims,
type (multi_matrices), intent(inout)  Mmat,
real, dimension(:), intent(in)  MASS_ELE,
type( vector_field ), intent(in)  diagonal_A 
)

Generates a lumped mass matrix for Stokes. It can either have also the diagonal of A or not.

Author
Pablo Salinas
Here is the caller graph for this function:

◆ get_all_in_mass_matrix()

subroutine assemb_force_cty::get_all_in_mass_matrix ( type(multi_dimensions), intent(in)  Mdims,
type (multi_matrices), intent(inout)  Mmat,
real, dimension ( :, :, :, :, :, :, : ), intent(in)  DIAG_BIGM_CON,
logical, intent(in)  LUMP_PIVIT_ON_ALL,
logical, intent(in)  LUMP_DIAG_MOM 
)

WARNING****this is under testing****.

Here is the caller graph for this function:

◆ get_massmatrix()

subroutine cv_assemb_force_cty::get_massmatrix ( integer, intent(in)  ELE,
type(multi_dimensions), intent(in)  Mdims,
type(multi_dev_shape_funs), intent(in)  DevFuns,
type (multi_matrices), intent(inout)  Mmat,
real, dimension( :, : ), intent(in)  X_ALL,
real, dimension( :, : ), intent(in)  UFEN_REVERSED 
)

Here no homogenisation can be performed. NOTE: FOR THE TIME BEING ONLY ROW_SUM IS ACTIVATED HERE, AND GET_POROUS_MASS_MATRIX IS KEPT FOR THE DIAGONAL SCALING METHOD.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ get_relative_permeability()

subroutine ai_backtracking_parameters::get_relative_permeability ( type(multi_dimensions), intent(in)  Mdims,
real, dimension(:,:), intent(in)  saturation,
real, dimension(:,:), intent(in)  Imble_frac,
real, dimension(:,:), intent(in)  end_point_relperm,
real, dimension(:,:), intent(in)  exponent_relperm,
real, dimension(:,:), intent(out)  relperm 
)
Here is the caller graph for this function:

◆ include_wells_and_compressibility_into_rhs()

subroutine force_bal_cty_assem_solve::include_wells_and_compressibility_into_rhs ( type(multi_dimensions), intent(in)  Mdims,
type( vector_field ), intent(inout)  rhs_p,
real, dimension( :, : ), intent(in)  DIAG_SCALE_PRES,
real, dimension( : ), intent(in)  MASS_MN_PRES,
real, dimension( : ), intent(in)  MASS_SUF,
type (multi_pipe_package), intent(in)  pipes_aux,
real, dimension( :, :, : ), intent(in)  DIAG_SCALE_PRES_COUP 
)

Include in the pressure matrix the compressibility terms (based on taylor expansion series) to ensure that we account for this term as implicitly as possible. For wells it introduces the coupling between pressures.

Author
Chris Pain, Pablo Salinas
Here is the caller graph for this function:

◆ jacdia()

subroutine viscocity_tensor_les_calc::jacdia ( real, dimension(n,n)  AA,
real, dimension(n,n)  V,
real, dimension(n)  D,
integer  N,
real, dimension(n,n)  A 
)

find the eigen-vectors V and the eigen values A so that AA=V^T D V & D is diagonal. It uses the algorithm of Matrix Computations 2nd edition, p196. sprint_to_do!!!!MOVE TO FORTRAN 90

Here is the call graph for this function:
Here is the caller graph for this function:

◆ jacpos()

subroutine viscocity_tensor_les_calc::jacpos ( real  SINALF,
real  COSALF,
integer  P,
integer  Q,
real, dimension(n,n)  A,
integer  N 
)
Here is the caller graph for this function:

◆ jacpre()

subroutine viscocity_tensor_les_calc::jacpre ( real  SINALF,
real  COSALF,
integer  P,
integer  Q,
real, dimension(n,n)  A,
integer  N 
)

PRE-MULTIPLY matrix A by transpose of Rotation matrix is realised by passing -SINALF down into SINALF.

Here is the caller graph for this function:

◆ mult_inv_mass_vel_vector()

subroutine force_bal_cty_assem_solve::mult_inv_mass_vel_vector ( type(multi_dimensions), intent(in)  Mdims,
type(multi_ndgln), intent(in)  ndgln,
real, dimension(:,:,:), intent(inout)  vel_vector,
real, dimension(:), intent(in)  MASS_ELE 
)

Multiplies the inv of the lumped mass matrix times the vel_vector vel_vector = vel_vector / (mass_ele/vel_local_nodes)

Author
Pablo Salinas
Here is the caller graph for this function:

◆ oneeletens_all()

subroutine viscocity_tensor_les_calc::oneeletens_all ( real, dimension(ndim,x_nloc), intent(in)  LOC_X_ALL,
integer, intent(in)  LES_DISOPT,
logical, intent(in)  ONE_OVER_H2,
real, dimension(ndim,ndim, nphase), intent(inout)  TENSXX_ALL,
integer, intent(in)  X_NLOC,
integer, intent(in)  NDIM,
real, dimension(ndim,ndim, nphase), intent(in)  MEAN_UDER_U,
integer, intent(in)  NPHASE 
)

REPRESENTS THE SIZE AND SHAPE OF THE SURROUNDING ELEMENTS. LES_DISOPT=LES option.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ p0_limiter()

subroutine assemb_force_cty::p0_limiter

: Computes a limited velocity when using a P0DG velocity discretisation

Here is the caller graph for this function:

◆ porous_assemb_force_cty()

subroutine cv_assemb_force_cty::porous_assemb_force_cty ( type( state_type ), intent(inout)  packed_state,
type( tensor_field ), intent(in)  pressure,
type(multi_dimensions), intent(in)  Mdims,
type(multi_gi_dimensions), intent(in)  FE_GIdims,
type(multi_shape_funs), intent(in)  FE_funs,
type (multi_sparsities), intent(in)  Mspars,
type(multi_ndgln), intent(in)  ndgln,
type (multi_matrices), intent(inout)  Mmat,
real, dimension( :, : ), intent(in)  X_ALL,
real, dimension(:,:,:), intent(in)  U_SOURCE_CV_ALL 
)

and faster to compute than for Navier-Stokes. Therefore, here the RHS and the Mass matrix are computed for this case

Here is the call graph for this function:
Here is the caller graph for this function:

◆ project_velocity_to_affine_space()

subroutine force_bal_cty_assem_solve::project_velocity_to_affine_space ( type(multi_dimensions), intent(in)  Mdims,
type (multi_matrices), intent(in)  Mmat,
type (multi_sparsities), intent(in)  Mspars,
type(multi_ndgln), intent(in)  ndgln,
type(tensor_field), intent(inout)  velocity,
type( vector_field ), intent(inout)  deltap,
type(tensor_field), intent(inout)  cdp_tensor 
)

Project back the velocity from a non divergent-free space to a divergent free space.

Author
Pablo Salinas
Here is the call graph for this function:
Here is the caller graph for this function:

◆ shock_front_in_ele()

logical function ai_backtracking_parameters::shock_front_in_ele ( integer, intent(in)  ele,
type(multi_dimensions), intent(in)  Mdims,
real, dimension(:,:), intent(in)  sat,
type(multi_ndgln), intent(in)  ndgln,
real, dimension(:,:), intent(in)  Imble_frac 
)
Here is the caller graph for this function:

◆ shock_front_mobility_ratio()

real function ai_backtracking_parameters::shock_front_mobility_ratio ( integer, intent(in)  ele,
type(multi_dimensions), intent(in)  Mdims,
real, dimension(:,:), intent(in)  sat,
type(multi_ndgln), intent(in)  ndgln,
real, dimension(:,:), intent(in)  Imble_frac,
real, dimension(:), intent(in)  total_mobility 
)
Here is the caller graph for this function:

◆ solve_and_update_pressure()

subroutine force_bal_cty_assem_solve::solve_and_update_pressure ( type(multi_dimensions), intent(in)  Mdims,
type( vector_field ), intent(inout)  rhs_p,
real, dimension(mdims%npres, mdims%cv_nonods), intent(inout)  P_all,
type( vector_field ), intent(inout)  deltap,
type(petsc_csr_matrix), intent(inout)  cmc_petsc,
real, dimension(mdims%npres, mdims%cv_nonods), intent(in)  diagonal_CMC,
logical, intent(in), optional  update_pres 
)

Compute deltaP by solving the pressure equation using the CMC matrix.

Author
Pablo Salinas
Here is the caller graph for this function:

◆ solve_and_update_velocity()

subroutine force_bal_cty_assem_solve::solve_and_update_velocity ( type (multi_matrices), intent(inout)  Mmat,
type(tensor_field), intent(inout)  Velocity,
type(tensor_field), intent(inout)  CDP_tensor,
real, dimension(mdims%ndim * mdims%nphase, mdims%u_nonods), intent(in)  U_RHS,
type( vector_field ), intent(inout)  diagonal_A 
)

Update velocity by solving the momentum equation for a given pressure, the RHS is formed here If rescale_mom_matrices = .true., here the RHS rescaled.

Author
Pablo Salinas
Here is the caller graph for this function:

◆ stokes_anderson_acceleration()

subroutine force_bal_cty_assem_solve::stokes_anderson_acceleration ( type( state_type ), intent(inout)  packed_state,
type(multi_dimensions), intent(in)  Mdims,
type (multi_matrices), intent(inout)  Mmat,
type (multi_sparsities), intent(in)  Mspars,
real, dimension( :, :, : ), intent(in)  INV_B,
type( vector_field ), intent(inout)  rhs_p,
type(multi_ndgln), intent(in)  ndgln,
real, dimension(:), intent(in)  MASS_ELE,
type( vector_field ), intent(inout)  diagonal_A,
type(tensor_field), intent(inout)  velocity,
type(tensor_field), intent(inout)  P_all,
type( vector_field ), intent(inout)  deltap,
type(petsc_csr_matrix), intent(inout)  cmc_petsc,
integer, intent(in)  stokes_max_its 
)

Generic subroutine that perform the Anderson acceleration solver. This is storing a set of results for a system that converges based on a FPI and finding an optimal combination of all of these results that minimise the residual Method explained in DOI.10.1137/16M1076770.

Author
Pablo Salinas
Here is the call graph for this function:
Here is the caller graph for this function:

◆ update_components()

subroutine volumefraction_assemble_solve::update_components

WARNING: Still work in progress.

Here is the call graph for this function:

◆ viscocity_tensor_les_calc_u()

subroutine viscocity_tensor_les_calc::viscocity_tensor_les_calc_u ( real, dimension( ndim, ndim, nphase, u_nloc, totele ), intent(inout)  LES_U_UDIFFUSION,
real, dimension( nphase, u_nloc, totele ), intent(inout)  LES_U_UDIFFUSION_VOL,
real, dimension( nphase, u_nloc, totele ), intent(inout)  Q_SCHEME_ABS_CONT_VOL,
real, dimension( ndim, ndim, nphase, u_nloc, totele ), intent(in)  DUX_ELE_ALL,
integer, intent(in)  NDIM,
integer, intent(in)  NPHASE,
integer, intent(in)  U_NLOC,
integer, intent(in)  X_NLOC,
integer, intent(in)  TOTELE,
integer, intent(in)  X_NONODS,
real, dimension( ndim, x_nonods ), intent(in)  X_ALL,
integer, dimension( x_nloc * totele ), intent(in)  X_NDGLN,
integer, intent(in)  LES_DISOPT,
real, intent(in)  CS,
integer, dimension( u_nloc * totele ), intent(in)  U_NDGLN,
integer, intent(in)  U_NONODS,
real, dimension( ndim, nphase, u_nonods ), intent(in)  U_ALL 
)
Here is the call graph for this function:
Here is the caller graph for this function: