|
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) |
|