proteus.m_comp_co2.m_comp_co2 module

class proteus.m_comp_co2.m_comp_co2.ThetaScheme(transport, integrateInterpolationPoints=False)[source]

Bases: BackwardEuler

Set flags that indicate that all terms are implicit.

updateTimeHistory(resetFromDOF=False)[source]

Push necessary information into time history arrays

class proteus.m_comp_co2.m_comp_co2.RKEV(transport, timeOrder=1, runCFL=0.1, integrateInterpolationPoints=False)[source]

Bases: SSP

Set flags that indicate that all terms are implicit.

TimeIntegration = <module 'proteus.TimeIntegration' from '/work/cekees/proteus/proteus/TimeIntegration.py'>[source]
choose_dt()[source]

Modify self.dt

initialize_dt(t0, tOut, q)[source]

Modify self.dt

setCoefficients()[source]

beta are all 1’s here mwf not used right now

updateStage()[source]

Need to switch to use coefficients

initializeTimeHistory(resetFromDOF=True)[source]

Push necessary information into time history arrays

updateTimeHistory(resetFromDOF=False)[source]

assumes successful step has been taken

generateSubsteps(tList)[source]

create list of substeps over time values given in tList. These correspond to stages

resetOrder(order)[source]

initialize data structures for stage updges

setFromOptions(nOptions)[source]

allow classes to set various numerical parameters

class proteus.m_comp_co2.m_comp_co2.Coefficients(nd, Ksw_types, vgm_n_types, vgm_alpha_types, thetaR_types, thetaSR_types, gravity, density, beta, rho_n=1.0, p_ref_n=0.0, diagonal_conductivity=True, getSeepageFace=None, density_model=None, DENSITY_MODEL=None, PSK_TYPE='VGM', STABILIZATION_TYPE='Implicit_FCT', ENTROPY_TYPE=2, LUMPED_MASS_MATRIX=False, MONOLITHIC=False, VMS=0.0, SC=0.0, FCT=True, num_fct_iter=1, cE=1.0, uL=0.0, uR=1.0, split_z=0, D_m=0.0, split_materials=None, split_anchor_alpha=0.0, split_anchor_Sg_tol=0.001, split_anchor_X_tol=2e-05, split_anchor_zfloor=1e-08, split_anchor_layer1=1, cK=1.0, outputQuantDOFs=False, k_d=0.0, c_sat=1.0, dissolution_mode='kinetic', X_sat=0.0, injection_ports=None, injection_ramp_tau=0.0, injection_point_source=False, krn_end_types=None, S_gr_types=None, mu_n=1.0, reconstruct_velocity_rt0=False, immiscible=0, T_C=20.0)[source]

Bases: TC_base

version of Re where element material type id’s used in evals

Set the number of components (equations) of the PDE and initialize the dicitionaries describing the form of the coefficients. Strings naming each component (used for viewing and archiving) and a structure defining the sparsity pattern of diffusion tensors may also be provided.

conservativeHeadRichardsMualemVanGenuchtenHetEvaluateV2(rho, beta, gravity, alpha, n, thetaR, thetaSR, KWs, u, mass, dmass, f, df, a, da)[source]
conservativeHeadRichardsMualemVanGenuchten_sd_het(colind, materialTypes, rho, beta, gravity, alpha, n, thetaR, thetaSR, KWs, u, mass, dmass, f, df, a, da, vol_frac, linearize_at_zero, pc_eps)[source]
attachModels(modelList)[source]

Give the TC object access to other models in a loosely coupled split operator formulation (e.g. a transport equation for concentration might get velocity from a flow equation)

preStep(t, firstStep=False)[source]

Give the TC object an opportunity to modify itself before the time step.

initializeMesh(mesh)[source]

Give the TC object access to the mesh for any mesh-dependent information.

initializeElementQuadrature(t, cq)[source]

Give the TC object access to the element quadrature storage

initializeElementBoundaryQuadrature(t, cebq, cebq_global)[source]

Give the TC object access to the element boundary quadrature storage

initializeGlobalExteriorElementBoundaryQuadrature(t, cebqe)[source]

Give the TC object access to the exterior element boundary quadrature storage

evaluate(t, c)[source]

Evaluate the coefficients at a given time, t, using the coefficient storage passed in as the dictionary c.

postStep(t, firstStep=False)[source]

Give the TC object an opportunity to modify itself after the time step.

apply_dissolution_flash(t)[source]

Finite-rate implicit dissolution (local-equilibrium flash limit).

Called ONCE per step from the transport coefficients’ postStep (Sequential_MinModelStep runs flow, then transport, so by here BOTH S_n and c are the converged end-of-step values). The whole exchange runs in C++ (m_comp_co2.h::dissolutionFlash via the flow model’s self.m_comp_co2 object): it (1) relaxes c toward the gas-limited equilibrium with an implicit linear-driving-force step (rate k_d*S_n), recovering S_n from exact M-conservation, mutating S_n (flow.u[1].dof) and c (tadr.u[0].dof) IN PLACE, and (2) rebuilds TADR’s quadrature old-mass q[(‘m’,0)] from the updated fields using the same valFromDOF/l2g/phi convention as the residual. Python only repairs the nodal time history and the ghost values.

Conserves per-node CO2 (rho_w-normalized) M = rho_n*S_n + (X_sat/c_sat)*(1-S_n)*c exactly. k_d is the dissolution rate: k_d -> inf recovers the instantaneous local-equilibrium flash (dissolves in place), finite k_d lets the free-gas plume rise before it dissolves over a slower timescale. X_sat is the physical solubility mass fraction. See the kernel comment in proteus/m_comp_co2/m_comp_co2.h.

class proteus.m_comp_co2.m_comp_co2.LevelModel(uDict, phiDict, testSpaceDict, matType, dofBoundaryConditionsDict, dofBoundaryConditionsSetterDict, coefficients, elementQuadrature, elementBoundaryQuadrature, fluxBoundaryConditionsDict=None, advectiveFluxBoundaryConditionsSetterDict=None, diffusiveFluxBoundaryConditionsSetterDictDict=None, stressTraceBoundaryConditionsSetterDict=None, stabilization=None, shockCapturing=None, conservativeFluxDict=None, numericalFluxType=None, TimeIntegrationClass=None, massLumping=False, reactionLumping=False, options=None, name='defaultName', reuse_trial_and_test_quadrature=True, sd=True, movingDomain=False, bdyNullSpace=False)[source]

Bases: OneLevelTransport

Allocate storage and initialize some variables.

Parameters:
  • uDict (dict) – Dictionary of proteus.FemTools.FiniteElementFunction objects.

  • phiDict (dict) – Dictionary of proteus.FemTools.FiniteElementFunction objects.

  • testSpaceDict (dict) – Dictionary of FiniteElementSpace objects

  • dofBoundaryConditionsDict (dict) – Dictionary of DOFBoundaryConditions objects for the Dirichlet conditions.

  • coefficients (proteus.TransportCoefficients.TC_base) – Problem’s Transport Coefficients class.

  • elementQuadratureDict (dict) – Dictionary of dictionaries of quadrature rules for each element integral in each component equation.

  • elementBoundaryQuadratureDict (dict) – Dictionary of dictionaries of quadrature rules for each element boundary integral in each component equation

  • stabilization (bool)

  • shockCapturing (bool)

  • numericalFlux (bool)

  • bdyNullSpace (bool) – Indicates whether the boundary conditions create a global null space.

Notes

The constructor sets the input arguments, calculates dimensions, and allocates storage. The meanings of variable suffixes are

  • global – per physical domain

  • element – per element

  • elementBoundary – per element boundary

The prefix n means ‘number of’.

Storage is divided into quantities required at different sets of points or geometric entities. Each type of storage has a dictionary for all the quantities of that type. The names and dimensions of the storage dictionaries are

  • e – at element

  • q – at element quadrature, unique to elements

  • ebq – at element boundary quadrature, unique to elements

  • ebq_global – at element boundary quadrature, unique to element boundary

  • ebqe – at element boundary quadrature, unique to global, exterior element boundary

  • phi_ip – at the generalized interpolation points required to build a nonlinear phi

nCalls = 0[source]
getExtraSparsityElements()[source]

Jacobian nonzeros not implied by the FE element graph (Transport hook).

Node-split couples z_a and z_b (comp-1) of a split interface node that share NO element, so findNonzeros never allocates the (z_a,z_b)/(z_b,z_a) cross slots – the interface-flux off-diagonal tangent has nowhere to land (kernel drops it). Return ONE synthetic comp-1 “element” block whose elements are the interface pairs (2 local DOFs = [z_a, z_b]); fed through sparsityInfo.findNonzeros it allocates the full 2x2 block per pair (the z-z diagonals already exist). Empty list when split_z==0 -> sparsity byte-identical.

FCTStep(component)[source]
kth_FCT_step()[source]
calculateCoefficients()[source]
calculateElementResidual()[source]

Calculate all the element residuals

getResidual(u, r)[source]

Calculate the element residuals and add in to the global residual

invert(u, r=None, ulow=None)[source]

Unified invert method that handles both standard and FCT modes using self.coefficients.FCT as the switching flag.

getJacobian(jacobian)[source]
calculateElementQuadrature()[source]

Calculate the physical location and weights of the quadrature rules and the shape information at the quadrature points.

This function should be called only when the mesh changes.

calculateElementBoundaryQuadrature()[source]

Calculate the physical location and weights of the quadrature rules and the shape information at the quadrature points on element boundaries.

This function should be called only when the mesh changes.

calculateExteriorElementBoundaryQuadrature()[source]

Calculate the physical location and weights of the quadrature rules and the shape information at the quadrature points on global element boundaries.

This function should be called only when the mesh changes.

estimate_mt()[source]
calculateSolutionAtQuadrature()[source]
calculateAuxiliaryQuantitiesAfterStep()[source]