Skip to content

Commit

Permalink
Changes to fragmenting cylinder example
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloseleson committed Jul 11, 2024
1 parent 0f66f66 commit c83600e
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 27 deletions.
13 changes: 3 additions & 10 deletions examples/mechanics/fragmenting_cylinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,8 @@ void fragmentingCylinderExample( const std::string filename )
double dy = particles->dx[1];
double dz = particles->dx[2];

double magnitude = inputs["grid_perturbation_factor"];

auto init_functor = KOKKOS_LAMBDA( const int pid )
{
// Density
Expand All @@ -135,19 +137,10 @@ void fragmentingCylinderExample( const std::string filename )
vr * Kokkos::sin( Kokkos::atan2( x( pid, 1 ), x( pid, 0 ) ) );
v( pid, 2 ) = vzmax * zfactor;

// Perturb nodes
// Perturb particle positions
double random_number_x = ( (double)rand() / ( RAND_MAX ) );
double random_number_y = ( (double)rand() / ( RAND_MAX ) );
double random_number_z = ( (double)rand() / ( RAND_MAX ) );

// std::cout << "pid = " << pid << " ; random_number_x = " <<
// random_number_x << " ; random_number_y = " << random_number_y << " ;
// random_number_z = " << random_number_z << std::endl;

// double magnitude = 0.01;
// double magnitude = 0.005;
double magnitude = 0.001;
// double magnitude = 0.0;
x( pid, 0 ) =
x( pid, 0 ) + ( 2 * random_number_x - 1.0 ) * magnitude * dx;
x( pid, 1 ) =
Expand Down
35 changes: 18 additions & 17 deletions examples/mechanics/inputs/fragmenting_cylinder.json
Original file line number Diff line number Diff line change
@@ -1,19 +1,20 @@
{
"num_cells" : {"value": [51, 51, 101]},
"system_size" : {"value": [0.05, 0.05, 0.1], "unit": "m"},
"density" : {"value": 7800, "unit": "kg/m^3"},
"bulk_modulus" : {"value": 130e+9, "unit": "Pa"},
"shear_modulus" : {"value": 78e+9, "unit": "Pa"},
"fracture_energy" : {"value": 3.74e+6, "unit": "J/m^2"},
"horizon" : {"value": 4.0e-3, "unit": "m"},
"cylinder_outer_radius" : {"value": 0.025, "unit": "m"},
"cylinder_inner_radius" : {"value": 0.02, "unit": "m"},
"max_radial_velocity" : {"value": 200, "unit": "m/s"},
"min_radial_velocity" : {"value": 50, "unit": "m/s"},
"max_vertical_velocity" : {"value": 100, "unit": "m/s"},
"final_time" : {"value": 5e-4, "unit": "s"},
"timestep" : {"value": 2.0e-7, "unit": "s"},
"timestep_safety_factor" : {"value": 0.85},
"output_frequency" : {"value": 50},
"output_reference" : {"value": false}
"num_cells" : {"value": [51, 51, 101]},
"system_size" : {"value": [0.05, 0.05, 0.1], "unit": "m"},
"grid_perturbation_factor" : {"value": 0.001},
"density" : {"value": 7800, "unit": "kg/m^3"},
"bulk_modulus" : {"value": 130e+9, "unit": "Pa"},
"shear_modulus" : {"value": 78e+9, "unit": "Pa"},
"fracture_energy" : {"value": 374400, "unit": "J/m^2"},
"horizon" : {"value": 0.004, "unit": "m"},
"cylinder_outer_radius" : {"value": 0.025, "unit": "m"},
"cylinder_inner_radius" : {"value": 0.02, "unit": "m"},
"max_radial_velocity" : {"value": 200, "unit": "m/s"},
"min_radial_velocity" : {"value": 50, "unit": "m/s"},
"max_vertical_velocity" : {"value": 100, "unit": "m/s"},
"final_time" : {"value": 2.5e-4, "unit": "s"},
"timestep" : {"value": 2.0e-7, "unit": "s"},
"timestep_safety_factor" : {"value": 0.85},
"output_frequency" : {"value": 50},
"output_reference" : {"value": false}
}

0 comments on commit c83600e

Please sign in to comment.