Skip to content

Commit

Permalink
fixup: inputs for problems with contact
Browse files Browse the repository at this point in the history
  • Loading branch information
streeve committed Nov 20, 2024
1 parent ba1e048 commit 4a9e0b9
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 9 deletions.
8 changes: 4 additions & 4 deletions examples/mechanics/disk_impact.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ void diskImpactExample( const std::string filename )
{
auto radius = system_size / 2.0 - 1e-10;
auto r2 = px[0] * px[0] + px[1] * px[1];
if ( r2 > radius * radius )
if ( r2 > radius * radius || px[2] < 0.0 )
return false;
return true;
};
Expand All @@ -51,8 +51,8 @@ void diskImpactExample( const std::string filename )
};
particles->updateParticles( exec_space{}, init_functor );

double dx = particles->dx[0];
double r_c = dx * 2.0;
double r_c = inputs["contact_horizon_factor"];
r_c *= particles->dx[0];
CabanaPD::NormalRepulsionModel contact_model( delta, r_c, K );

auto cabana_pd = CabanaPD::createSolverFracture<memory_space>(
Expand All @@ -72,7 +72,7 @@ void diskImpactExample( const std::string filename )
( x( p, 2 ) - z ) * ( x( p, 2 ) - z ) );
if ( r < impact_r )
{
double fmag = -1.0e17 * ( r - impact_r ) * ( r - impact_r );
double fmag = 1.0e17 * ( r - impact_r ) * ( r - impact_r );
f( p, 0 ) += fmag * x( p, 0 ) / r;
f( p, 1 ) += fmag * x( p, 1 ) / r;
f( p, 2 ) += fmag * ( x( p, 2 ) - z ) / r;
Expand Down
3 changes: 2 additions & 1 deletion examples/mechanics/fragmenting_cylinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,8 @@ void fragmentingCylinderExample( const std::string filename )
};
particles->updateParticles( exec_space{}, init_functor );

double r_c = dx[0] * 2.0;
double r_c = inputs["contact_horizon_factor"];
r_c *= dx[0];
CabanaPD::NormalRepulsionModel contact_model( delta, r_c, K );

// ====================================================
Expand Down
9 changes: 5 additions & 4 deletions examples/mechanics/inputs/disk_impact.json
Original file line number Diff line number Diff line change
@@ -1,15 +1,16 @@
{
"num_cells" : {"value": [149, 149, 5]},
"low_corner" : {"value": [-0.037, -0.037, -2.5e-3], "unit": "m"},
"high_corner" : {"value": [0.037, 0.037, 0.0], "unit": "m"},
"dx" : {"value": [0.0005, 0.0005, 0.0005], "note": "This is used to enable a larger box in Z."},
"low_corner" : {"value": [-0.03725, -0.03725, -10.0e-2], "unit": "m"},
"high_corner" : {"value": [0.03725, 0.03725, 2.5e-3], "unit": "m"},
"density" : {"value": 2200.0, "unit": "kg/m^3"},
"bulk_modulus" : {"value": 14.9e+9, "unit": "Pa"},
"fracture_energy" : {"value": 10.0575, "unit": "J/m^2"},
"horizon" : {"value": 0.0015, "unit": "m"},
"contact_horizon_factor" : {"value": 0.9},
"final_time" : {"value": 2.0e-4, "unit": "s"},
"timestep" : {"value": 1.0e-7, "unit": "s"},
"timestep_safety_factor" : {"value": 0.85},
"output_frequency" : {"value": 50},
"output_frequency" : {"value": 25},
"output_reference" : {"value": false},
"impactor_radius" : {"value": 5e-3, "unit": "m"},
"impactor_velocity" : {"value": -100.0, "unit": "m/s"}
Expand Down
1 change: 1 addition & 0 deletions examples/mechanics/inputs/fragmenting_cylinder.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"shear_modulus" : {"value": 78e+9, "unit": "Pa"},
"critical_stretch" : {"value": 0.02},
"horizon" : {"value": 0.00417462, "unit": "m"},
"contact_horizon_factor" : {"value": 0.9},
"cylinder_outer_radius" : {"value": 0.025, "unit": "m"},
"cylinder_inner_radius" : {"value": 0.02, "unit": "m"},
"max_radial_velocity" : {"value": 200, "unit": "m/s"},
Expand Down

0 comments on commit 4a9e0b9

Please sign in to comment.