Skip to content

Commit

Permalink
Merge pull request #202 from abhinavmuta/dtsph
Browse files Browse the repository at this point in the history
Add dt to WCSPH in DB2D and output times to DB3D.
  • Loading branch information
prabhuramachandran committed Apr 10, 2019
2 parents 6995000 + 8e6bab6 commit a253afa
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 7 deletions.
13 changes: 7 additions & 6 deletions pysph/examples/dam_break_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,19 +48,19 @@ class DamBreak2D(Application):
def add_user_options(self, group):
corrections = ['', 'mixed-corr', 'grad-corr', 'kernel-corr', 'crksph']
group.add_argument(
'--dx', action='store', type=float, dest='dx', default=dx,
'--dx', action='store', type=float, dest='dx', default=dx,
help='Particle spacing.'
)
group.add_argument(
'--hdx', action='store', type=float, dest='hdx', default=hdx,
'--hdx', action='store', type=float, dest='hdx', default=hdx,
help='Specify the hdx factor where h = hdx * dx.'
)
group.add_argument(
"--kernel-corr", action="store", type=str, dest='kernel_corr',
default='', help="Type of Kernel Correction", choices=corrections
)
group.add_argument(
'--staggered-grid', action="store_true", dest='staggered_grid',
'--staggered-grid', action="store_true", dest='staggered_grid',
default=False, help="Use a staggered grid for particles.",
)

Expand All @@ -77,14 +77,15 @@ def configure_scheme(self):
tf=tf, output_at_times=[0.4, 0.6, 0.8, 1.0]
)
if self.options.scheme == 'wcsph':
dt = 0.125 * self.h / co
self.scheme.configure(h0=self.h, hdx=self.hdx)
kernel = WendlandQuintic(dim=2)
from pysph.sph.integrator import EPECIntegrator
from pysph.sph.integrator import PECIntegrator
kw.update(
dict(
integrator_cls=EPECIntegrator,
integrator_cls=PECIntegrator,
kernel=kernel, adaptive_timestep=True, n_damp=50,
fixed_h=False
fixed_h=False, dt=dt
)
)
elif self.options.scheme == 'aha':
Expand Down
3 changes: 2 additions & 1 deletion pysph/examples/dam_break_3d.py
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,8 @@ def configure_scheme(self):
dt = 0.25*h0/(1.1 * self.co)
s.configure_solver(
kernel=kernel, integrator_cls=EPECIntegrator, tf=tf, dt=dt,
adaptive_timestep=True, n_damp=50
adaptive_timestep=True, n_damp=50,
output_at_times=[0.4, 0.6, 1.0]
)

def create_particles(self):
Expand Down

0 comments on commit a253afa

Please sign in to comment.