# PorousFlow Mass Fraction Aqueous Equilibrium Chemistry

This Material forms a std::vector<std::vector ...> of mass-fractions (total concentrations of primary species (m{3}(primary species)/m{3}(solution)) and since this is for an aqueous system only, mass-fraction equals volume-fraction) corresponding to an aqueous equilibrium chemistry system. The first mass fraction is the concentration of the first primary species, etc, and the last mass fraction is the concentration of H2O.

This forms PorousFlow mass-fractions appropriate for an aqueous equilibrium chemistry simulation. The first of these are the total concentrations of the primary species of the chemical reaction system, while the last one is the mass-fraction of the remaining component, which is assumed to be pure water.

warning

The numerical implementation of the chemical-reactions part of PorousFlow is quite simplistic, with very few guards against strange numerical behavior that might arise during the non-linear iterative process that MOOSE uses to find the solution. Therefore, care must be taken to define your chemical reactions so that the primary species concentrations remain small, but nonzero.

Details concerning aqueous equilibrium chemistry may be found in the chemical reactions module. The PorousFlowMassFractionAqueousEquilibriumChemistry computes the secondary concentrations, and adds them appropriately to the primary concentrations to form the mass-fractions. There are two main differences between the chemical reactions module and PorousFlow. These are:

• The molar volumes must be specified in PorousFlow. This is so that the concentrations may be measured in rather than mol.m.

• Unlike the chemical reactions module, users of PorousFlow must specify the stoichiometric coefficients themselves. In each reaction, the primary concentrations (variables) must be brought to the left-hand-side. The right-hand-sides are the secondary species, by definition. For instance, consider a 2-reaction system consisting of 3 primary variables, , and . The reactions are (1) Then the reactions input is 1 2 -3 4 -5 6.

note

If the equilibrium constants are AuxVariables that depend on temperature (or other Variables) the computed Jacobian will not be exact and you may experience poor nonlinear convergence. If this becomes frustrating, please contact the moose-users google group.

## Input Parameters

• reactionsA matrix defining the aqueous reactions. The matrix is entered as a long vector: the first row is entered first, followed by the second row, etc. There should be num_reactions rows. All primary species should appear only on the LHS of each reaction (and there should be just one secondary species on the RHS, by definition) so they may have negative coefficients. Each row should have number of primary_concentrations entries, which are the stoichiometric coefficients. The first coefficient must always correspond to the first primary species, etc

C++ Type:std::vector

Options:

Description:A matrix defining the aqueous reactions. The matrix is entered as a long vector: the first row is entered first, followed by the second row, etc. There should be num_reactions rows. All primary species should appear only on the LHS of each reaction (and there should be just one secondary species on the RHS, by definition) so they may have negative coefficients. Each row should have number of primary_concentrations entries, which are the stoichiometric coefficients. The first coefficient must always correspond to the first primary species, etc

• equilibrium_constantsEquilibrium constant for each equation (dimensionless). If these are temperature dependent AuxVariables, the Jacobian will not be exact

C++ Type:std::vector

Options:

Description:Equilibrium constant for each equation (dimensionless). If these are temperature dependent AuxVariables, the Jacobian will not be exact

• PorousFlowDictatorThe UserObject that holds the list of PorousFlow variable names

C++ Type:UserObjectName

Options:

Description:The UserObject that holds the list of PorousFlow variable names

• num_reactionsNumber of equations in the system of chemical reactions

C++ Type:unsigned int

Options:

Description:Number of equations in the system of chemical reactions

• primary_activity_coefficientsActivity coefficients for the primary species (dimensionless) (one for each)

C++ Type:std::vector

Options:

Description:Activity coefficients for the primary species (dimensionless) (one for each)

• secondary_activity_coefficientsActivity coefficients for the secondary species (dimensionless) (one for each reaction)

C++ Type:std::vector

Options:

Description:Activity coefficients for the secondary species (dimensionless) (one for each reaction)

• mass_fraction_varsList of variables that represent the mass fractions. For the aqueous phase these are concentrations of the primary species with units m^{3}(chemical)/m^{3}(fluid phase). For the other phases (if any) these will typically be initialised to zero and will not change throughout the simulation. Format is 'f_ph0^c0 f_ph0^c1 f_ph0^c2 ... f_ph0^c(N-1) f_ph1^c0 f_ph1^c1 fph1^c2 ... fph1^c(N-1) ... fphP^c0 f_phP^c1 fphP^c2 ... fphP^c(N-1)' where N=number of primary species and P=num_phases, and it is assumed that f_ph^cN=1-sum(f_ph^c,{c,0,N-1}) so that f_ph^cN need not be given.

C++ Type:std::vector

Options:

Description:List of variables that represent the mass fractions. For the aqueous phase these are concentrations of the primary species with units m^{3}(chemical)/m^{3}(fluid phase). For the other phases (if any) these will typically be initialised to zero and will not change throughout the simulation. Format is 'f_ph0^c0 f_ph0^c1 f_ph0^c2 ... f_ph0^c(N-1) f_ph1^c0 f_ph1^c1 fph1^c2 ... fph1^c(N-1) ... fphP^c0 f_phP^c1 fphP^c2 ... fphP^c(N-1)' where N=number of primary species and P=num_phases, and it is assumed that f_ph^cN=1-sum(f_ph^c,{c,0,N-1}) so that f_ph^cN need not be given.

### Required Parameters

Default:False

C++ Type:bool

Options:

• boundaryThe list of boundary IDs from the mesh where this boundary condition applies

C++ Type:std::vector

Options:

Description:The list of boundary IDs from the mesh where this boundary condition applies

• computeTrueWhen false, MOOSE will not call compute methods on this material. The user must call computeProperties() after retrieving the Material via MaterialPropertyInterface::getMaterial(). Non-computed Materials are not sorted for dependencies.

Default:True

C++ Type:bool

Options:

Description:When false, MOOSE will not call compute methods on this material. The user must call computeProperties() after retrieving the Material via MaterialPropertyInterface::getMaterial(). Non-computed Materials are not sorted for dependencies.

• blockThe list of block ids (SubdomainID) that this object will be applied

C++ Type:std::vector

Options:

Description:The list of block ids (SubdomainID) that this object will be applied

• equilibrium_constants_as_log10FalseIf true, the equilibrium constants are written in their log10 form, eg, -2. If false, the equilibrium constants are written in absolute terms, eg, 0.01

Default:False

C++ Type:bool

Options:

Description:If true, the equilibrium constants are written in their log10 form, eg, -2. If false, the equilibrium constants are written in absolute terms, eg, 0.01

### Optional Parameters

• output_propertiesList of material properties, from this material, to output (outputs must also be defined to an output type)

C++ Type:std::vector

Options:

Description:List of material properties, from this material, to output (outputs must also be defined to an output type)

• outputsnone Vector of output names were you would like to restrict the output of variables(s) associated with this object

Default:none

C++ Type:std::vector

Options:

Description:Vector of output names were you would like to restrict the output of variables(s) associated with this object

### Outputs Parameters

• enableTrueSet the enabled status of the MooseObject.

Default:True

C++ Type:bool

Options:

Description:Set the enabled status of the MooseObject.

• use_displaced_meshFalseWhether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

Default:False

C++ Type:bool

Options:

Description:Whether or not this object should use the displaced mesh for computation. Note that in the case this is true but no displacements are provided in the Mesh block the undisplaced mesh will still be used.

• control_tagsAdds user-defined labels for accessing object parameters via control logic.

C++ Type:std::vector

Options:

Description:Adds user-defined labels for accessing object parameters via control logic.

• seed0The seed for the master random number generator

Default:0

C++ Type:unsigned int

Options:

Description:The seed for the master random number generator

• implicitTrueDetermines whether this object is calculated using an implicit or explicit form

Default:True

C++ Type:bool

Options:

Description:Determines whether this object is calculated using an implicit or explicit form

• constant_onNONEWhen ELEMENT, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps.When SUBDOMAIN, MOOSE will only call computeSubdomainProperties() for the 0th quadrature point, and then copy that value to the other qps. Evaluations on element qps will be skipped

Default:NONE

C++ Type:MooseEnum

Options:NONE ELEMENT SUBDOMAIN

Description:When ELEMENT, MOOSE will only call computeQpProperties() for the 0th quadrature point, and then copy that value to the other qps.When SUBDOMAIN, MOOSE will only call computeSubdomainProperties() for the 0th quadrature point, and then copy that value to the other qps. Evaluations on element qps will be skipped