#################
# Test goal: Test output of advection 1D-2D transport with balance output.
# Author: Jan Stebel
# Source for reference: qualitative

flow123d_version: 4.0.0a01
problem: !Coupling_Sequential
  description: 'Tutorial problem: Transport 1D-2D (convection, dual porosity, sorption, sources), balance output.'
  mesh:
    mesh_file: ../00_mesh/square_1x1_frac_fork.msh
  # mesh
    regions:
      - !Union
        name: 1d_domain
        regions:
          - 1d_upper
          - 1d_lower
          - 1d_left_branch
  # mesh
  flow_equation: !Flow_Darcy_LMH
    nonlinear_solver:
      linear_solver: !Petsc
        a_tol: 1.0e-12
        r_tol: 1.0e-12
    # primary equation
    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[0]+X[1]
    output:
      fields:
        - pressure_p0
        - velocity_p0
    balance: {add_output_times: false}

  # primary equation
    output_stream:
      file: flow.pvd
      format: !vtk
        variant: ascii
  solute_equation: !Coupling_OperatorSplitting
    transport: !Solute_Advection_FV
      input_fields:
        - region: ALL
          init_conc: 0
          porosity: 0.25
          sources_density:
            - 0.25
            - 0
          # source is in the whole volume (l+s) -> times porosity
        - region: .BOUNDARY
          bc_conc:
            - 0.0
            - 1.0
    substances:
      - name: age
        molar_mass: 0.018
      # water age
      - name: U235
        molar_mass: 0.235
      # uranium 235
    time:
      end_time: 1000000.0
    balance:
      add_output_times: true
      times:
        - step: 200000.0
        - 300000.0
    output_stream:
      file: transport.pvd
      format: !vtk
        variant: ascii
  # secondary_equation
# problem
      times:
        - step: 500000.0
