# Test goal: Transport 1D-2D (convection, dual porosity, sources).
# Author: Pavel Exner (last edit)
# Source for reference:
#   only qualitative check in Paraview
#
# features:
#   - convection and dispersion (DG)
#   - dual porosity
#   - mobile/immobile sorption
#   - conc sources
#   - time dependent porosity
#
# similar to tests: 21-03, 22-01

flow123d_version: 3.1.0
problem: !Coupling_Sequential
  description: 'Transport 1D-2D (convection, dispersion, reaction term, sources).'
  mesh:
    mesh_file: ../00_mesh/square_1x1_frac_fork.msh
    regions:
      - !Union
        name: 1d_domain
        regions:
          - 1d_upper
          - 1d_lower
          - 1d_left_branch

  flow_equation: !Flow_Darcy_MH
    input_fields:
      - region: 1d_domain
        conductivity: 1.0e-06
        cross_section: 0.04
        sigma: 0.9
      - region: 2d
        conductivity: 1.0e-07
      - region: .BOUNDARY
        bc_type: dirichlet
        bc_pressure: !FieldFormula
          value: x+y
    nonlinear_solver:
      linear_solver: !Petsc
        a_tol: 1.0e-12
        r_tol: 1.0e-12

  solute_equation: !Coupling_OperatorSplitting
    substances:
      - name: age # water age
        molar_mass: 0.018
      - name: U235 # uranium 235
        molar_mass: 0.235
    transport: !Solute_AdvectionDiffusion_DG
      input_fields:
        - region: ALL
          init_conc: 0
          porosity: !FieldFormula
            value: 0.25+t*5e-7
          sources_density:
            - 0.25
            - 0
        # source is in the whole volume (l+s) -> times porosity
        - region: .BOUNDARY
          bc_conc:
            - 0.0
            - 1.0
      solver: !Petsc
        a_tol: 1.0e-12
        r_tol: 1.0e-12
    time:
      end_time: 1e6
    balance:
      cumulative: true

    reaction_term: !DualPorosity
      input_fields:
        - region: ALL
          diffusion_rate_immobile:
            - 0.01
            - 0.01
          porosity_immobile: 0.25
          init_conc_immobile:
            - 0.0
            - 0.0
      reaction_mobile: !SorptionMobile
        solvent_density: 1000 # water
        substances:
          - age
          - U235
        solubility:
          - 1.0
          - 1.0
        input_fields: &anchor1
          - region: ALL
            rock_density: 2800 # granit
            sorption_type:
              - none
              - freundlich
            distribution_coefficient:
              - 0
              - 1.598e-4
            isotherm_other:
              - 0
              - 1.0
        output:
          fields: []
      reaction_immobile: !SorptionImmobile
        solvent_density: 1000 # water
        substances:
          - age
          - U235
        solubility:
          - 1.0
          - 1.0
        input_fields: *anchor1
        output:
          fields: []
      output:
        fields: []
    output_stream:
      times:
        - step: 1e5
