PETSc Error in Poroelastic Simulation with PyLith 4.2.0

Dear Baagaard:

I have a question regarding my current work. I am simulating reservoir pressure changes, and in my input file I am using the following settings:

[pylithapp.problem.bc.bc_zpos_shangyou]
label = boundary_zpos_shangyou
use_initial = False
use_time_history = True
db_auxiliary_field = spatialdata.spatialdb.UniformDB
db_auxiliary_field.description = Neumann BC shangyou edge
db_auxiliary_field.values = [time_history_amplitude_normal, time_history_amplitude_tangential_1, time_history_amplitude_tangential_2, time_history_start_time]
db_auxiliary_field.data = [-1MPa, 0MPa, 0*MPa, 1.0]
time_history = spatialdata.spatialdb.TimeHistory
time_history.description = Impulse time history
time_history.filename = impulseshang.timedb
auxiliary_subfields.time_history_amplitude.basis_order = 0
auxiliary_subfields.time_history_start_time.basis_order = 0

together with another input file to apply the pressure change.

However, considering the effect of water gravity, the pressure on different terrains should act along the local surface normal. Therefore, I would like to apply time-varying pressure at each point individually, rather than applying the same time variation across the entire surface.

May I ask if this idea is feasible in PyLith? I believe I asked a similar question before, and you kindly provided some replies, but I am still confused and not sure how to resolve this issue.

Thank you very much for your time and guidance.

Best regards,

impulseshangtimedb.txt (67.4 KB)

PyLith currently lacks a mechanism for specifying boundary conditions that vary independently in space and time. The current implementation utilizes spatial variations in parameters, while maintaining the same temporal function with spatial variations in the time shift and amplitude. Time-Dependent Boundary Conditions — PyLith 5.0.0dev documentation

Some workarounds include:

  1. Using multiple, overlapping Neumann boundary conditions so that the sum of the boundary conditions gives the function you want.
  2. Decomposing a boundary condition into multiple boundary conditions that do not overlap.

Thank you very much for your kind reply! I will give it a try.

Dear baagaard:

I would also like to ask whether PyLith can be used to simulate and calculate the Peak Ground Acceleration (PGA) and Peak Ground Velocity (PGV) during an earthquake.I saw simulations of P-wave and S-wave propagation in barwaves-2d, but I’m not sure whether it can be used to simulate and compute the entire earthquake process.

I would also like to ask whether PyLith can be used to simulate and calculate the Peak Ground Acceleration (PGA) and Peak Ground Velocity (PGV) during an earthquake.I saw simulations of P-wave and S-wave propagation in barwaves-2d, but I’m not sure whether it can be used to simulate and compute the entire earthquake process.

PyLith v3 and later have limited capabilities for dynamic simulations (including inertia). We are still working on reimplementing the dynamic formulations in our multi-physics approach. PyLith v2.2.2 supports both prescribed and spontaneous rupture for both quasistatic and dynamic simulations.

Thank you for your help! Following your suggestion, I tried using a combination of two boundary conditions in my model. I used the time_history_amplitude_normal related content as follows:

[pylithapp.problem.bc.bc_zpos_shangyou]
label = boundary_zpos_shangyou
use_initial = False
use_time_history = True
db_auxiliary_field = spatialdata.spatialdb.UniformDB
db_auxiliary_field.description = Neumann BC shangyou edge
db_auxiliary_field.values = [time_history_amplitude_normal, time_history_amplitude_tangential_1, time_history_amplitude_tangential_2, time_history_start_time]
db_auxiliary_field.data = [-1MPa, 0MPa, 0*MPa, 1.0]
time_history = spatialdata.spatialdb.TimeHistory
time_history.description = Impulse time history
time_history.filename = impulseshang.timedb
auxiliary_subfields.time_history_amplitude.basis_order = 0
auxiliary_subfields.time_history_start_time.basis_order = 0

This part works without any issues.

Then, I wanted to add an initial pressure field that varies spatially (i.e., one pressure value for each grid point in the model). For this, I used:

[pylithapp.problem.bc.bc_zpos_shangyou]
label = boundary_zpos_shangyou
db_auxiliary_field = spatialdata.spatialdb.UniformDB
db_auxiliary_field.description = Neumann BC shangyou edge
db_auxiliary_field.filename = shangyouchushi.spatialdb

I feel my understanding might be incorrect because this part keeps failing. My intention was to introduce a .spatialdb file to implement it. The file content is as follows:

// This spatial database specifies the initial displacement and
// velocity on the +x boundary. For the linear variation (data-dim ==
// 1) in displacement, we only need to specify the two end points with
// a SimpleDB.
#SPATIAL.ascii 1
SimpleDB {
num-values = 3
value-names = initial_amplitude_normal initial_amplitude_tangential_1 initial_amplitude_tangential_2
value-units = MPa MPa MPa
num-locs = 1
data-dim = 1
space-dim = 3
cs-data = cartesian {
to-meters = 1.0e+3 // specify coordinates in km
space-dim = 3
}
}

However, it keeps producing the error:

/public1/home/a8s000279/pylith-4.2.1-linux-x86_64/lib/python3.12/site-packages/pythia/init.py:16: UserWarning: pkg_resources is deprecated as an API…

./pylithapp.cfg:476:
– pyre.inventory(error)
– timedependent.bc.neumanntimedependent.uniformdb.filename ← ‘shangyouchushi.spatialdb’
– unrecognized property ‘timedependent.bc.neumanntimedependent.uniformdb.filename’

pylithapp: configuration error(s)

How should I resolve this?

Is it because I set this surface as NeumannTimeDependent that the spatial file above only works for Dirichlet boundaries? Does this mean I cannot implement the idea of applying the same time_history_amplitude_normal and impulseshang.timedb to the entire surface, while assigning a continuous but different initial_amplitude_normal to different points on this surface?

The error you are getting arises from specifying a UniformDB but parameters for a SimpleDB. Both Neumann and Dirichlet boundary conditions work with any of the various types of spatial databases (UniformDB, SimpleDB, SimpleGridDB, AnalyticDB).

I have already changed it to SimpleDB, but the same issue still occurs. Could it be because I set the timehistory part as UniformDB earlier? Since both conditions are applied to the same surface, could this be causing a conflict?

Now is:[pylithapp.problem.bc.bc_zpos_shangyou]
label = boundary_zpos_shangyou2
field = pressure
db_auxiliary_field = spatialdata.spatialdb.SimpleDB
db_auxiliary_field.description = Flow into external boundary of shangyou
db_auxiliary_field.filename = shangyouchushi.spatialdb

[pylithapp.problem.bc.bc_zpos_shangyou]
label = boundary_zpos_shangyou
use_initial = False
use_time_history = True
db_auxiliary_field = spatialdata.spatialdb.UniformDB
db_auxiliary_field.description = Neumann BC shangyou edge
db_auxiliary_field.values = [time_history_amplitude_normal, time_history_amplitude_tangential_1, time_history_amplitude_tangential_2, time_history_start_time]
db_auxiliary_field.data = [-1MPa,0MPa,0*MPa, 1.0]
time_history = spatialdata.spatialdb.TimeHistory
time_history.description = Impulse time history
time_history.filename = impulseshang.timedb
auxiliary_subfields.time_history_amplitude.basis_order = 0
auxiliary_subfields.time_history_start_time.basis_order = 0

If your parameters are the following, then you have two boundary conditions named bc_zpos_shangyou:

[pylithapp.problem.bc.bc_zpos_shangyou]
label = boundary_zpos_shangyou2
field = pressure
db_auxiliary_field = spatialdata.spatialdb.SimpleDB
db_auxiliary_field.description = Flow into external boundary of shangyou
db_auxiliary_field.filename = shangyouchushi.spatialdb

[pylithapp.problem.bc.bc_zpos_shangyou]
label = boundary_zpos_shangyou

If you have two boundary conditions on a boundary with a label “boundary_zpos_shangyou”, then you want:

[pylithapp.problem]
bc = [bc_zpos_shangyou_pressure, bc_zpos_shangyou_displacement]

[pylithapp.problem.bc.bc_zpos_shangyou_pressure]
label = boundary_zpos_shangyou
field = pressure
# Remaining settings added here

[pylithapp.problem.bc.bc_zpos_shangyou_displacement]
label = boundary_zpos_shangyou
field = displacement
# Remaining settings added here

Note that multiple boundary conditions can use the same label (nodeset or physical group), but they need different names in the PyLith list of boundary conditions.

Thank you for your reply, it was very helpful to me. The issue has now been resolved. Thanks again!