Slope (.pfb) files not read correctly

10 views
Skip to first unread message

MABOSSANI AKARA

unread,
Sep 26, 2025, 1:49:57 PMSep 26
to ParFlow
Hello All,
I have used the Priority Flow script to generate slope files for my simulation.
The slope file looks fine when I converted to .pfb (slope_from_priority_flow.png).
I then run Parflow and set "<runname>.PrintSlopes = True".
The slope file that Parflow returned (slope_from_parflow.png) is different from the one I provided.
It appears as if Parflow is not reading or distributing the file correctly.
As a result, the simulated pressure field does not show any stream network.
Any suggestions will be appreciated.
Below are my script and figures.
# -----------------------------------------------------------------------------
# Make a directory for the simulation run and copy files
# -----------------------------------------------------------------------------
runname = 'Oueme_parking_lot'

# Create a directory in the outputs folder for this run
run_dir = get_absolute_path(f'outputs/{runname}')
mkdir(run_dir)
print(run_dir)

Oueme_Test = Run(runname, run_dir)
Oueme_Test.FileVersion = 4

input_dir=os.path.join(os.getcwd(), 'inputs')
files=["oueme_SlopeX.pfb","oueme_SlopeY.pfb","hkzone_single.pfb","oueme_single.pfsol"]
for fname in files:
    shutil.copy(os.path.join(input_dir,fname), run_dir)

# -----------------------------------------------------------------------------

Oueme_Test.FileVersion = 4

# -----------------------------------------------------------------------------
# Set Processor topology
# -----------------------------------------------------------------------------
Oueme_Test.Process.Topology.P = 1
Oueme_Test.Process.Topology.Q = 1
Oueme_Test.Process.Topology.R = 1

# -----------------------------------------------------------------------------
# Computational Grid
# -----------------------------------------------------------------------------

Oueme_Test.ComputationalGrid.Lower.X = 0.0
Oueme_Test.ComputationalGrid.Lower.Y = 0.0
Oueme_Test.ComputationalGrid.Lower.Z = 0.0

Oueme_Test.ComputationalGrid.DX = 500#
Oueme_Test.ComputationalGrid.DY = 500#
Oueme_Test.ComputationalGrid.DZ = 5.0

Oueme_Test.ComputationalGrid.NX = 55
Oueme_Test.ComputationalGrid.NY = 54
Oueme_Test.ComputationalGrid.NZ = 1
# -----------------------------------------------------------------------------
# Variable dz
# -----------------------------------------------------------------------------

Oueme_Test.Solver.Nonlinear.VariableDz = False

# -----------------------------------------------------------------------------
# Names of the GeomInputs
# -----------------------------------------------------------------------------

Oueme_Test.GeomInput.Names = "domaininput indi_input"

# -----------------------------------------------------------------------------
# Domain Geometry Input
# -----------------------------------------------------------------------------
Oueme_Test.GeomInput.domaininput.InputType = "SolidFile"
Oueme_Test.GeomInput.domaininput.GeomNames = "domain"
Oueme_Test.GeomInput.domaininput.FileName = "oueme_single.pfsol"

# -----------------------------------------------------------------------------
# Domain Geometry
# -----------------------------------------------------------------------------
Oueme_Test.Domain.GeomName = "domain"
Oueme_Test.Geom.domain.Patches = "top bottom side"

# -----------------------------------------------------------------------------
# Indicator Geometry Input
# -----------------------------------------------------------------------------

Oueme_Test.GeomInput.indi_input.InputType = "IndicatorField"
Oueme_Test.GeomInput.indi_input.GeomNames = ("z1 z2 z3")
Oueme_Test.Geom.indi_input.FileName = "hkzone_single.pfb"

Oueme_Test.GeomInput.z1.Value = 15
Oueme_Test.GeomInput.z2.Value = 16
Oueme_Test.GeomInput.z3.Value = 21
# -----------------------------------------------------------------------------
# Permeability (values in m/s)
# -----------------------------------------------------------------------------

Oueme_Test.Geom.Perm.Names = "domain z1 z2 z3"
#Oueme_Test.Geom.Perm.Names = "domain"


Oueme_Test.Geom.domain.Perm.Type = "Constant"
Oueme_Test.Geom.domain.Perm.Value = 1e-7

Oueme_Test.Geom.z1.Perm.Type = "Constant"
Oueme_Test.Geom.z1.Perm.Value = 1e-8

Oueme_Test.Geom.z2.Perm.Type = "Constant"
Oueme_Test.Geom.z2.Perm.Value = 1e-6

Oueme_Test.Geom.z3.Perm.Type = "Constant"
Oueme_Test.Geom.z3.Perm.Value = 1e-6

Oueme_Test.Perm.TensorType = "TensorByGeom"
Oueme_Test.Geom.Perm.TensorByGeom.Names = "domain"
Oueme_Test.Geom.domain.Perm.TensorValX = 1.0
Oueme_Test.Geom.domain.Perm.TensorValY = 1.0
Oueme_Test.Geom.domain.Perm.TensorValZ = 1.0

# -----------------------------------------------------------------------------
# Specific Storage
# -----------------------------------------------------------------------------

Oueme_Test.SpecificStorage.Type = "Constant"
Oueme_Test.SpecificStorage.GeomNames = "domain"
Oueme_Test.Geom.domain.SpecificStorage.Value = 1.0e-7

# -----------------------------------------------------------------------------
# Phases
# -----------------------------------------------------------------------------

Oueme_Test.Phase.Names = "water"
Oueme_Test.Phase.water.Density.Type = "Constant"
Oueme_Test.Phase.water.Density.Value = 1.0
Oueme_Test.Phase.water.Viscosity.Type = "Constant"
Oueme_Test.Phase.water.Viscosity.Value = 1.0

# -----------------------------------------------------------------------------
# Contaminants
# -----------------------------------------------------------------------------

Oueme_Test.Contaminants.Names = ""

# -----------------------------------------------------------------------------
# Gravity
# -----------------------------------------------------------------------------

Oueme_Test.Gravity = 1.0

# -----------------------------------------------------------------------------
# Timing (time units is set by units of permeability)
# -----------------------------------------------------------------------------

Oueme_Test.TimingInfo.BaseUnit = 1.0
Oueme_Test.TimingInfo.StartCount = 0
Oueme_Test.TimingInfo.StartTime = 0.0
Oueme_Test.TimingInfo.StopTime = 72000# 100years
Oueme_Test.TimingInfo.DumpInterval = 3600
Oueme_Test.TimeStep.Type = "Constant"
Oueme_Test.TimeStep.Value = 3600

# -----------------------------------------------------------------------------
# Time Cycles
# -----------------------------------------------------------------------------

Oueme_Test.Cycle.Names = "constant rainrec"
Oueme_Test.Cycle.constant.Names = "alltime"
Oueme_Test.Cycle.constant.alltime.Length = 1
Oueme_Test.Cycle.constant.Repeat = -1

Oueme_Test.Cycle.rainrec.Names = "rain rec"
Oueme_Test.Cycle.rainrec.rain.Length = 60000
Oueme_Test.Cycle.rainrec.rec.Length = 72000
Oueme_Test.Cycle.rainrec.Repeat = -1
# -----------------------------------------------------------------------------
# Porosity
# -----------------------------------------------------------------------------

Oueme_Test.Geom.Porosity.GeomNames = "domain z1 z2 z3"
#Oueme_Test.Geom.Porosity.GeomNames = "domain"

Oueme_Test.Geom.domain.Porosity.Type = "Constant"
Oueme_Test.Geom.domain.Porosity.Value = 0.02

Oueme_Test.Geom.z1.Porosity.Type = "Constant"
Oueme_Test.Geom.z1.Porosity.Value = 0.02

Oueme_Test.Geom.z2.Porosity.Type = "Constant"
Oueme_Test.Geom.z2.Porosity.Value = 0.02

Oueme_Test.Geom.z3.Porosity.Type = "Constant"
Oueme_Test.Geom.z3.Porosity.Value = 0.02

# -----------------------------------------------------------------------------
# Domain
# -----------------------------------------------------------------------------

Oueme_Test.Domain.GeomName = "domain"

# ----------------------------------------------------------------------------
# Mobility
# ----------------------------------------------------------------------------

Oueme_Test.Phase.water.Mobility.Type = "Constant"
Oueme_Test.Phase.water.Mobility.Value = 1.0

# -----------------------------------------------------------------------------
# Wells
# -----------------------------------------------------------------------------

Oueme_Test.Wells.Names = ""

# -----------------------------------------------------------------------------
# Boundary Conditions
# -----------------------------------------------------------------------------

Oueme_Test.BCPressure.PatchNames = "top bottom side"
#Oueme_Test.BCPressure.PatchNames = Oueme_Test.Geom.domain.Patches

Oueme_Test.Patch.side.BCPressure.Type = "FluxConst"
Oueme_Test.Patch.side.BCPressure.Cycle = "constant"
Oueme_Test.Patch.side.BCPressure.alltime.Value = 0.0

Oueme_Test.Patch.bottom.BCPressure.Type = "FluxConst"
Oueme_Test.Patch.bottom.BCPressure.Cycle = "constant"
Oueme_Test.Patch.bottom.BCPressure.alltime.Value = 0.0

# recharge
Oueme_Test.Patch.top.BCPressure.Type = "OverlandKinematic"
Oueme_Test.Patch.top.BCPressure.Cycle = "rainrec"
Oueme_Test.Patch.top.BCPressure.rain.Value = -1.4e-4#30 mm/yr
Oueme_Test.Patch.top.BCPressure.rec.Value = 0.0#30 mm/yr

# -----------------------------------------------------------------------------
# Topo slopes in x-direction
# -----------------------------------------------------------------------------

Oueme_Test.TopoSlopesX.Type = "PFBFile"
#Oueme_Test.TopoSlopesX.Type = "Constant"
Oueme_Test.TopoSlopesX.GeomNames = "domain"
#Oueme_Test.TopoSlopesX.Geom.domain.Value = 0
Oueme_Test.TopoSlopesX.FileName = "oueme_SlopeX.pfb"

# -----------------------------------------------------------------------------
# Topo slopes in y-direction
# -----------------------------------------------------------------------------

Oueme_Test.TopoSlopesY.Type = "PFBFile"
Oueme_Test.TopoSlopesY.GeomNames = "domain"
Oueme_Test.TopoSlopesY.FileName = "oueme_SlopeY.pfb"

# -----------------------------------------------------------------------------
# Mannings coefficient
# -----------------------------------------------------------------------------

Oueme_Test.Mannings.Type = "Constant"
Oueme_Test.Mannings.GeomNames = "domain"
Oueme_Test.Mannings.Geom.domain.Value = 5.52e-7# LT^-1/3

# -----------------------------------------------------------------------------
# Relative Permeability
# -----------------------------------------------------------------------------

Oueme_Test.Phase.RelPerm.Type = "VanGenuchten"
Oueme_Test.Phase.RelPerm.GeomNames = "domain z1 z2 z3"

Oueme_Test.Geom.domain.RelPerm.Alpha = 3.03
Oueme_Test.Geom.domain.RelPerm.N = 3.03

Oueme_Test.Geom.z1.RelPerm.Alpha = 2.83
Oueme_Test.Geom.z1.RelPerm.N = 3.03

Oueme_Test.Geom.z2.RelPerm.Alpha = 2.63
Oueme_Test.Geom.z2.RelPerm.N = 3.03

Oueme_Test.Geom.z3.RelPerm.Alpha = 2.73
Oueme_Test.Geom.z3.RelPerm.N = 3.03

#-----------------------------------------------------------------------------
# Saturation
# -----------------------------------------------------------------------------

Oueme_Test.Phase.Saturation.Type = "VanGenuchten"
Oueme_Test.Phase.Saturation.GeomNames = "domain z1 z2 z3"

Oueme_Test.Geom.domain.Saturation.Alpha = 3.63
Oueme_Test.Geom.domain.Saturation.N = 3.03
Oueme_Test.Geom.domain.Saturation.SRes = 0.1
Oueme_Test.Geom.domain.Saturation.SSat = 0.22

Oueme_Test.Geom.z1.Saturation.Alpha = 2.83
Oueme_Test.Geom.z1.Saturation.N = 3.03
Oueme_Test.Geom.z1.Saturation.SRes = 0.1
Oueme_Test.Geom.z1.Saturation.SSat = 0.22

Oueme_Test.Geom.z2.Saturation.Alpha = 2.63
Oueme_Test.Geom.z2.Saturation.N = 3.03
Oueme_Test.Geom.z2.Saturation.SRes = 0.1
Oueme_Test.Geom.z2.Saturation.SSat = 0.22

Oueme_Test.Geom.z3.Saturation.Alpha = 2.73
Oueme_Test.Geom.z3.Saturation.N = 3.03
Oueme_Test.Geom.z3.Saturation.SRes = 0.1
Oueme_Test.Geom.z3.Saturation.SSat = 0.22

# -----------------------------------------------------------------------------
# Phase sources:
# -----------------------------------------------------------------------------

Oueme_Test.PhaseSources.water.Type = "Constant"
Oueme_Test.PhaseSources.water.GeomNames = "domain"
Oueme_Test.PhaseSources.water.Geom.domain.Value = 0.0

# ---------------------------------------------------------
# Initial conditions: water pressure
# ---------------------------------------------------------

Oueme_Test.ICPressure.Type = "HydroStaticPatch"
Oueme_Test.ICPressure.GeomNames = "domain"
Oueme_Test.Geom.domain.ICPressure.Value = 1.005
Oueme_Test.Geom.domain.ICPressure.RefGeom = "domain"
Oueme_Test.Geom.domain.ICPressure.RefPatch = "bottom"

# -------------------------------------------------------------
# Outputs
# ------------------------------------------------------------

# Writing output (all pfb):
#Oueme_Test.NetCDF.WritePressure = True
Oueme_Test.Solver.PrintSubsurfData = True
Oueme_Test.Solver.PrintPressure = True
Oueme_Test.Solver.PrintSaturation = True
Oueme_Test.Solver.PrintMask = True
Oueme_Test.Solver.PrintVelocities = True
Oueme_Test.Solver.PrintSlopes = True
#Oueme_Test.Solver.PrintEvapTrans = True
#Oueme_Test.Solver.PrintEvapTransSum = True
Oueme_Test.Solver.PrintOverlandSum = True
Oueme_Test.Solver.PrintMannings = True
Oueme_Test.Solver.PrintSpecificStorage = True
#Oueme_Test.Solver.PrintChannelWidth =True

# -----------------------------------------------------------------------------
# Exact solution specification for error calculations
# -----------------------------------------------------------------------------

Oueme_Test.KnownSolution = "NoKnownSolution"

# -----------------------------------------------------------------------------
# Set solver parameters
# -----------------------------------------------------------------------------

# ParFlow Solution
Oueme_Test.Solver = "Richards"
Oueme_Test.Solver.MaxIter = 2500

Oueme_Test.Solver.TerrainFollowingGrid = True
Oueme_Test.Solver.TerrainFollowingGrid.SlopeUpwindFormulation = "Upwind"

Oueme_Test.Solver.Nonlinear.MaxIter = 80
Oueme_Test.Solver.Nonlinear.ResidualTol = 1e-5
Oueme_Test.Solver.Nonlinear.EtaValue = 0.001

Oueme_Test.Solver.PrintSubsurf = False
Oueme_Test.Solver.Drop = 1e-20
Oueme_Test.Solver.AbsTol = 1e-10

Oueme_Test.Solver.Nonlinear.EtaChoice = "EtaConstant"
Oueme_Test.Solver.Nonlinear.EtaValue = 0.001
Oueme_Test.Solver.Nonlinear.UseJacobian = True
Oueme_Test.Solver.Nonlinear.StepTol = 1e-25
Oueme_Test.Solver.Nonlinear.Globalization = "LineSearch"
Oueme_Test.Solver.Linear.KrylovDimension = 80
Oueme_Test.Solver.Linear.MaxRestarts = 2
Oueme_Test.Solver.MaxConvergenceFailures = 6

Oueme_Test.Solver.Linear.Preconditioner = "MGSemi"
Oueme_Test.Solver.Linear.Preconditioner = "PFMG"
Oueme_Test.Solver.Linear.Preconditioner.PCMatrixType = "FullJacobian"

# -----------------------------------------------------------------------------
# Distribute CLM and ParFlow inputs
# -----------------------------------------------------------------------------

Oueme_Test.ComputationalGrid.NZ = 1
Oueme_Test.dist("oueme_SlopeX.pfb")
Oueme_Test.dist("oueme_SlopeY.pfb")
Oueme_Test.dist("hkzone_single.pfb")

# write
Oueme_Test.write()
Oueme_Test.write(file_format='yaml')
Oueme_Test.write(file_format='json')

# -----------------------------------------------------------------------------
# Run Simulation
# -----------------------------------------------------------------------------
Oueme_Test.run(skip_validation=True)

simulated_pressure.pngslope_from_parflow.pngslope_from_priority_flow.png
Reply all
Reply to author
Forward
0 new messages