# Test goal: Test variable sorption parameters with simple 2D transport.
# Author: Pavel Exner
# Source for reference:
#   - qualitative, check in Paraview
#   - simple convective transport from right to left
#   - same as test 03, but the sorption process is postponed to the time 5
flow123d_version: 4.0.0a01
problem: !Coupling_Sequential
  description: Test variable sorption parameters with simple 2D transport.
  mesh:
    mesh_file: ../00_mesh/rectangle_5x1.msh
  flow_equation: !Flow_Darcy_LMH
    nonlinear_solver:
      linear_solver: !Petsc
        a_tol: 1.0e-07
    input_fields:
      - region: rectangle
        conductivity: 0.125
      - region: .BOUNDARY
        bc_type: dirichlet
        bc_pressure: !FieldFormula
          value: X[0]
    output:
      fields:
        - pressure_p0
        - velocity_p0
    output_stream:
      file: test_20.pvd
      format: !vtk
        variant: ascii
  solute_equation: !Coupling_OperatorSplitting
    transport: !Solute_Advection_FV
      input_fields:
        - region: ALL
          init_conc: 0
          porosity: 0.25
        - region: .BOUNDARY
          bc_conc: !FieldFormula
            value: 0.05*t
    substances:
      - A
      - As-lin
      - B
      - Bs-lang
      - C
      - Cs-freund
    output_stream:
      file: transport_test_20.pvd
      format: !vtk
        variant: ascii
      times:
        - step: 1.5
    time:
      end_time: 15.0
    reaction_term: !Sorption
      solvent_density: 1.0
      substances:
        - A
        - As-lin
        - Bs-lang
        - Cs-freund
      solubility:
        - 1.0
        - 1.0
        - 1.0
        - 1.0
      input_fields:
        - region: ALL
          rock_density: 1.0
          sorption_type: !FieldFormula
            value:
              # using selection type integers in FieldFormula
              - 0                           # 0-none
              - ' ((1) if (t>5) else (0)) ' # 1-linear
              - ' ((2) if (t>5) else (0)) ' # 1-langmuir
              - ' ((3) if (t>5) else (0)) ' # 1-freundlich
          distribution_coefficient: !FieldFormula
            value:
              - 0
              - ' ((0.6) if (t>5) else (0.0)) '
              - ' ((0.4) if (t>5) else (0.0)) '
              - ' ((0.6) if (t>5) else (0.0)) '
          isotherm_other: !FieldFormula
            value:
              - 0
              - 0
              - ' ((0.6) if (t>5) else (0.0)) '
              - ' ((0.4) if (t>5) else (0.0)) '
      output:
        fields: []
    balance:
      cumulative: true
