OGS  master
exchange.prj
<OpenGeoSysProject>
  <meshes>
    <mesh>exchange.vtu</mesh>
    <mesh>exchange_upstream.vtu</mesh>
    <mesh>exchange_downstream.vtu</mesh>
    <mesh>ReactiveDomain_exchange.vtu</mesh>
  </meshes>
  <processes>
    <process>
      <name>hc</name>
      <type>ComponentTransport</type>
      <integration_order>2</integration_order>
      <coupling_scheme>staggered</coupling_scheme>
      <process_variables>
        <concentration>Ca</concentration>
        <concentration>Cl</concentration>
        <concentration>H</concentration>
        <concentration>K</concentration>
        <concentration>N(5)</concentration>
        <concentration>Na</concentration>
        <pressure>pressure</pressure>
      </process_variables>
      <specific_body_force>0</specific_body_force>
      <secondary_variables>
        <secondary_variable internal_name="darcy_velocity" output_name="darcy_velocity" />
      </secondary_variables>
    </process>
  </processes>
  <media>
    <medium id="0">
      <phases>
        <phase>
          <type>AqueousLiquid</type>
          <components>
            <component>
              <name>Ca</name>
              <properties>
                <property>
                  <name>pore_diffusion</name>
                  <type>Constant</type>
                  <value>0</value>
                </property>
                <property>
                  <name>retardation_factor</name>
                  <type>Constant</type>
                  <value>1</value>
                </property>
                <property>
                  <name>decay_rate</name>
                  <type>Constant</type>
                  <value>0</value>
                </property>
              </properties>
            </component>
            <component>
              <name>Cl</name>
              <properties>
                <property>
                  <name>pore_diffusion</name>
                  <type>Constant</type>
                  <value>0</value>
                </property>
                <property>
                  <name>retardation_factor</name>
                  <type>Constant</type>
                  <value>1</value>
                </property>
                <property>
                  <name>decay_rate</name>
                  <type>Constant</type>
                  <value>0</value>
                </property>
              </properties>
            </component>
            <component>
              <name>H</name>
              <properties>
                <property>
                  <name>pore_diffusion</name>
                  <type>Constant</type>
                  <value>0</value>
                </property>
                <property>
                  <name>retardation_factor</name>
                  <type>Constant</type>
                  <value>1</value>
                </property>
                <property>
                  <name>decay_rate</name>
                  <type>Constant</type>
                  <value>0</value>
                </property>
              </properties>
            </component>
            <component>
              <name>K</name>
              <properties>
                <property>
                  <name>pore_diffusion</name>
                  <type>Constant</type>
                  <value>0</value>
                </property>
                <property>
                  <name>retardation_factor</name>
                  <type>Constant</type>
                  <value>1</value>
                </property>
                <property>
                  <name>decay_rate</name>
                  <type>Constant</type>
                  <value>0</value>
                </property>
              </properties>
            </component>
            <component>
              <name>N(5)</name>
              <properties>
                <property>
                  <name>pore_diffusion</name>
                  <type>Constant</type>
                  <value>0</value>
                </property>
                <property>
                  <name>retardation_factor</name>
                  <type>Constant</type>
                  <value>1</value>
                </property>
                <property>
                  <name>decay_rate</name>
                  <type>Constant</type>
                  <value>0</value>
                </property>
              </properties>
            </component>
            <component>
              <name>Na</name>
              <properties>
                <property>
                  <name>pore_diffusion</name>
                  <type>Constant</type>
                  <value>0</value>
                </property>
                <property>
                  <name>retardation_factor</name>
                  <type>Constant</type>
                  <value>1</value>
                </property>
                <property>
                  <name>decay_rate</name>
                  <type>Constant</type>
                  <value>0</value>
                </property>
              </properties>
            </component>
          </components>
          <properties>
            <property>
              <name>density</name>
              <type>Constant</type>
              <value>1.00e+03</value>
            </property>
            <property>
              <name>viscosity</name>
              <type>Constant</type>
              <value>1.00e-03</value>
            </property>
          </properties>
        </phase>
        <phase>
          <type>Solid</type>
          <components>
            <component>
              <name>X</name>
              <properties>
                <property>
                  <name>molality</name>
                  <type>Constant</type>
                  <value>1.1e-3</value>
                </property>
              </properties>
            </component>
          </components>
        </phase>
      </phases>
      <properties>
        <property>
          <name>permeability</name>
          <type>Constant</type>
          <value>1.73207e-12</value>
        </property>
        <property>
          <name>porosity</name>
          <type>Constant</type>
          <value>0.1</value>
        </property>
        <property>
          <name>longitudinal_dispersivity</name>
          <type>Constant</type>
          <value>0.002</value>
        </property>
        <property>
          <name>transversal_dispersivity</name>
          <type>Constant</type>
          <value>0.1</value>
        </property>
      </properties>
    </medium>
  </media>
  <time_loop>
    <global_process_coupling>
      <max_iter>6</max_iter>
      <convergence_criteria>
        <convergence_criterion>
          <type>DeltaX</type>
          <norm_type>NORM2</norm_type>
          <reltol>1e-14</reltol>
        </convergence_criterion>
        <convergence_criterion>
          <type>DeltaX</type>
          <norm_type>NORM2</norm_type>
          <reltol>1e-14</reltol>
        </convergence_criterion>
        <convergence_criterion>
          <type>DeltaX</type>
          <norm_type>NORM2</norm_type>
          <reltol>1e-14</reltol>
        </convergence_criterion>
        <convergence_criterion>
          <type>DeltaX</type>
          <norm_type>NORM2</norm_type>
          <reltol>1e-14</reltol>
        </convergence_criterion>
        <convergence_criterion>
          <type>DeltaX</type>
          <norm_type>NORM2</norm_type>
          <reltol>1e-14</reltol>
        </convergence_criterion>
        <convergence_criterion>
          <type>DeltaX</type>
          <norm_type>NORM2</norm_type>
          <reltol>1e-14</reltol>
        </convergence_criterion>
        <convergence_criterion>
          <type>DeltaX</type>
          <norm_type>NORM2</norm_type>
          <reltol>1e-14</reltol>
        </convergence_criterion>
      </convergence_criteria>
    </global_process_coupling>
    <processes>
      <process ref="hc">
        <nonlinear_solver>basic_picard</nonlinear_solver>
        <convergence_criterion>
          <type>DeltaX</type>
          <norm_type>NORM2</norm_type>
          <reltol>1e-14</reltol>
        </convergence_criterion>
        <time_discretization>
          <type>BackwardEuler</type>
        </time_discretization>
        <time_stepping>
          <type>FixedTimeStepping</type>
          <t_initial>0.0</t_initial>
          <t_end>72000</t_end>
          <timesteps>
            <pair>
              <repeat>400</repeat>
              <delta_t>180</delta_t>
            </pair>
          </timesteps>
        </time_stepping>
      </process>
      <process ref="hc">
        <nonlinear_solver>basic_picard</nonlinear_solver>
        <convergence_criterion>
          <type>DeltaX</type>
          <norm_type>NORM2</norm_type>
          <reltol>1e-14</reltol>
        </convergence_criterion>
        <time_discretization>
          <type>BackwardEuler</type>
        </time_discretization>
        <time_stepping>
          <type>FixedTimeStepping</type>
          <t_initial>0.0</t_initial>
          <t_end>72000</t_end>
          <timesteps>
            <pair>
              <repeat>400</repeat>
              <delta_t>180</delta_t>
            </pair>
          </timesteps>
        </time_stepping>
      </process>
      <process ref="hc">
        <nonlinear_solver>basic_picard</nonlinear_solver>
        <convergence_criterion>
          <type>DeltaX</type>
          <norm_type>NORM2</norm_type>
          <reltol>1e-14</reltol>
        </convergence_criterion>
        <time_discretization>
          <type>BackwardEuler</type>
        </time_discretization>
        <time_stepping>
          <type>FixedTimeStepping</type>
          <t_initial>0.0</t_initial>
          <t_end>72000</t_end>
          <timesteps>
            <pair>
              <repeat>400</repeat>
              <delta_t>180</delta_t>
            </pair>
          </timesteps>
        </time_stepping>
      </process>
      <process ref="hc">
        <nonlinear_solver>basic_picard</nonlinear_solver>
        <convergence_criterion>
          <type>DeltaX</type>
          <norm_type>NORM2</norm_type>
          <reltol>1e-14</reltol>
        </convergence_criterion>
        <time_discretization>
          <type>BackwardEuler</type>
        </time_discretization>
        <time_stepping>
          <type>FixedTimeStepping</type>
          <t_initial>0.0</t_initial>
          <t_end>72000</t_end>
          <timesteps>
            <pair>
              <repeat>400</repeat>
              <delta_t>180</delta_t>
            </pair>
          </timesteps>
        </time_stepping>
      </process>
      <process ref="hc">
        <nonlinear_solver>basic_picard</nonlinear_solver>
        <convergence_criterion>
          <type>DeltaX</type>
          <norm_type>NORM2</norm_type>
          <reltol>1e-14</reltol>
        </convergence_criterion>
        <time_discretization>
          <type>BackwardEuler</type>
        </time_discretization>
        <time_stepping>
          <type>FixedTimeStepping</type>
          <t_initial>0.0</t_initial>
          <t_end>72000</t_end>
          <timesteps>
            <pair>
              <repeat>400</repeat>
              <delta_t>180</delta_t>
            </pair>
          </timesteps>
        </time_stepping>
      </process>
      <process ref="hc">
        <nonlinear_solver>basic_picard</nonlinear_solver>
        <convergence_criterion>
          <type>DeltaX</type>
          <norm_type>NORM2</norm_type>
          <reltol>1e-14</reltol>
        </convergence_criterion>
        <time_discretization>
          <type>BackwardEuler</type>
        </time_discretization>
        <time_stepping>
          <type>FixedTimeStepping</type>
          <t_initial>0.0</t_initial>
          <t_end>72000</t_end>
          <timesteps>
            <pair>
              <repeat>400</repeat>
              <delta_t>180</delta_t>
            </pair>
          </timesteps>
        </time_stepping>
      </process>
      <process ref="hc">
        <nonlinear_solver>basic_picard</nonlinear_solver>
        <convergence_criterion>
          <type>DeltaX</type>
          <norm_type>NORM2</norm_type>
          <reltol>1e-14</reltol>
        </convergence_criterion>
        <time_discretization>
          <type>BackwardEuler</type>
        </time_discretization>
        <time_stepping>
          <type>FixedTimeStepping</type>
          <t_initial>0.0</t_initial>
          <t_end>72000</t_end>
          <timesteps>
            <pair>
              <repeat>400</repeat>
              <delta_t>180</delta_t>
            </pair>
          </timesteps>
        </time_stepping>
      </process>
    </processes>
    <output>
      <type>VTK</type>
      <prefix>exchangeOutput</prefix>
      <timesteps>
        <pair>
          <repeat>4</repeat>
          <each_steps>100</each_steps>
        </pair>
      </timesteps>
      <variables>
        <variable>Ca</variable>
        <variable>Cl</variable>
        <variable>H</variable>
        <variable>K</variable>
        <variable>N(5)</variable>
        <variable>Na</variable>
        <variable>pressure</variable>
      </variables>
    </output>
  </time_loop>
  <chemical_system chemical_solver="Phreeqc">
    <mesh>ReactiveDomain_exchange</mesh>
    <database>phreeqc.dat</database>
    <solution>
      <temperature>25</temperature>
      <pressure>1</pressure>
      <pe>12.5</pe>
      <components>
        <component>Ca</component>
        <component>Cl</component>
        <component>K</component>
        <component>N(5)</component>
        <component>Na</component>
      </components>
      <charge_balance>pH</charge_balance>
    </solution>
    <exchangers>
      <exchange_site>
        <ion_exchanging_species>X</ion_exchanging_species>
      </exchange_site>
    </exchangers>
    <knobs>
      <max_iter>500</max_iter>
      <relative_convergence_tolerance>1e-12</relative_convergence_tolerance>
      <tolerance>1e-15</tolerance>
      <step_size>5</step_size>
      <scaling>0</scaling>
    </knobs>
  </chemical_system>
  <parameters>
    <parameter>
      <name>c0_Ca</name>
      <type>Constant</type>
      <value>1e-12</value>
    </parameter>
    <parameter>
      <name>c_inlet_Ca</name>
      <type>Constant</type>
      <value>6.0e-04</value>
    </parameter>
    <parameter>
      <name>c0_Cl</name>
      <type>Constant</type>
      <value>1e-12</value>
    </parameter>
    <parameter>
      <name>c_inlet_Cl</name>
      <type>Constant</type>
      <value>1.20e-03</value>
    </parameter>
    <parameter>
      <name>c0_H</name>
      <type>Constant</type>
      <value>1.0e-07</value>
    </parameter>
    <parameter>
      <name>c_inlet_H</name>
      <type>Constant</type>
      <value>1.0e-07</value>
    </parameter>
    <parameter>
      <name>c0_K</name>
      <type>Constant</type>
      <value>0.2e-3</value>
    </parameter>
    <parameter>
      <name>c_inlet_K</name>
      <type>Constant</type>
      <value>1e-12</value>
    </parameter>
    <parameter>
      <name>c0_N(5)</name>
      <type>Constant</type>
      <value>1.2e-3</value>
    </parameter>
    <parameter>
      <name>c_inlet_N(5)</name>
      <type>Constant</type>
      <value>1e-12</value>
    </parameter>
    <parameter>
      <name>c0_Na</name>
      <type>Constant</type>
      <value>1.0e-3</value>
    </parameter>
    <parameter>
      <name>c_inlet_Na</name>
      <type>Constant</type>
      <value>1e-12</value>
    </parameter>
    <parameter>
      <name>p0</name>
      <type>Constant</type>
      <value>1e5</value>
    </parameter>
    <parameter>
      <name>p_upstream</name>
      <type>Constant</type>
      <value>1e5</value>
    </parameter>
    <parameter>
      <name>p_downstream_Neumann</name>
      <type>Constant</type>
      <value>-2.777777777777778e-4</value>
    </parameter>
  </parameters>
  <process_variables>
    <process_variable>
      <name>Ca</name>
      <components>1</components>
      <order>1</order>
      <initial_condition>c0_Ca</initial_condition>
      <boundary_conditions>
        <boundary_condition>
          <mesh>exchange_upstream</mesh>
          <type>Dirichlet</type>
          <parameter>c_inlet_Ca</parameter>
        </boundary_condition>
      </boundary_conditions>
    </process_variable>
    <process_variable>
      <name>Cl</name>
      <components>1</components>
      <order>1</order>
      <initial_condition>c0_Cl</initial_condition>
      <boundary_conditions>
        <boundary_condition>
          <mesh>exchange_upstream</mesh>
          <type>Dirichlet</type>
          <parameter>c_inlet_Cl</parameter>
        </boundary_condition>
      </boundary_conditions>
    </process_variable>
    <process_variable>
      <name>H</name>
      <components>1</components>
      <order>1</order>
      <initial_condition>c0_H</initial_condition>
      <boundary_conditions>
        <boundary_condition>
          <mesh>exchange_upstream</mesh>
          <type>Dirichlet</type>
          <parameter>c_inlet_H</parameter>
        </boundary_condition>
      </boundary_conditions>
    </process_variable>
    <process_variable>
      <name>K</name>
      <components>1</components>
      <order>1</order>
      <initial_condition>c0_K</initial_condition>
      <boundary_conditions>
        <boundary_condition>
          <mesh>exchange_upstream</mesh>
          <type>Dirichlet</type>
          <parameter>c_inlet_K</parameter>
        </boundary_condition>
      </boundary_conditions>
    </process_variable>
    <process_variable>
      <name>N(5)</name>
      <components>1</components>
      <order>1</order>
      <initial_condition>c0_N(5)</initial_condition>
      <boundary_conditions>
        <boundary_condition>
          <mesh>exchange_upstream</mesh>
          <type>Dirichlet</type>
          <parameter>c_inlet_N(5)</parameter>
        </boundary_condition>
      </boundary_conditions>
    </process_variable>
    <process_variable>
      <name>Na</name>
      <components>1</components>
      <order>1</order>
      <initial_condition>c0_Na</initial_condition>
      <boundary_conditions>
        <boundary_condition>
          <mesh>exchange_upstream</mesh>
          <type>Dirichlet</type>
          <parameter>c_inlet_Na</parameter>
        </boundary_condition>
      </boundary_conditions>
    </process_variable>
    <process_variable>
      <name>pressure</name>
      <components>1</components>
      <order>1</order>
      <initial_condition>p0</initial_condition>
      <boundary_conditions>
        <boundary_condition>
          <mesh>exchange_upstream</mesh>
          <type>Dirichlet</type>
          <parameter>p_upstream</parameter>
        </boundary_condition>
        <boundary_condition>
          <mesh>exchange_downstream</mesh>
          <type>Neumann</type>
          <parameter>p_downstream_Neumann</parameter>
        </boundary_condition>
      </boundary_conditions>
    </process_variable>
  </process_variables>
  <nonlinear_solvers>
    <nonlinear_solver>
      <name>basic_picard</name>
      <type>Picard</type>
      <max_iter>100</max_iter>
      <linear_solver>general_linear_solver</linear_solver>
    </nonlinear_solver>
  </nonlinear_solvers>
  <linear_solvers>
    <linear_solver>
      <name>general_linear_solver</name>
      <eigen>
        <solver_type>BiCGSTAB</solver_type>
        <precon_type>ILUT</precon_type>
        <max_iteration_step>100</max_iteration_step>
        <error_tolerance>1e-14</error_tolerance>
      </eigen>
    </linear_solver>
  </linear_solvers>
  <test_definition>
    <vtkdiff>
      <regex>exchangeOutput_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
      <field>pressure</field>
      <absolute_tolerance>1e-6</absolute_tolerance>
      <relative_tolerance>1e-10</relative_tolerance>
    </vtkdiff>
    <vtkdiff>
      <regex>exchangeOutput_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
      <field>Ca</field>
      <absolute_tolerance>1e-10</absolute_tolerance>
      <relative_tolerance>1e-16</relative_tolerance>
    </vtkdiff>
    <vtkdiff>
      <regex>exchangeOutput_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
      <field>Cl</field>
      <absolute_tolerance>1e-10</absolute_tolerance>
      <relative_tolerance>1e-16</relative_tolerance>
    </vtkdiff>
    <vtkdiff>
      <regex>exchangeOutput_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
      <field>H</field>
      <absolute_tolerance>1e-10</absolute_tolerance>
      <relative_tolerance>1e-16</relative_tolerance>
    </vtkdiff>
    <vtkdiff>
      <regex>exchangeOutput_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
      <field>K</field>
      <absolute_tolerance>1e-10</absolute_tolerance>
      <relative_tolerance>1e-16</relative_tolerance>
    </vtkdiff>
    <vtkdiff>
      <regex>exchangeOutput_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
      <field>N(5)</field>
      <absolute_tolerance>1e-10</absolute_tolerance>
      <relative_tolerance>1e-16</relative_tolerance>
    </vtkdiff>
    <vtkdiff>
      <regex>exchangeOutput_ts_[0-9]*_t_[0-9]*.000000.vtu</regex>
      <field>Na</field>
      <absolute_tolerance>1e-10</absolute_tolerance>
      <relative_tolerance>1e-16</relative_tolerance>
    </vtkdiff>
  </test_definition>
</OpenGeoSysProject>