Skip to content

Commit

Permalink
Temporary changes to fragmenting cylinder example
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloseleson committed Jul 9, 2024
1 parent e4306b3 commit f349e2a
Show file tree
Hide file tree
Showing 2 changed files with 44 additions and 19 deletions.
31 changes: 28 additions & 3 deletions examples/mechanics/fragmenting_cylinder.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -56,9 +56,13 @@ void fragmentingCylinderExample( const std::string filename )
// ====================================================
// Force model
// ====================================================
/*
using model_type = CabanaPD::ForceModel<CabanaPD::PMB, CabanaPD::Fracture,
CabanaPD::TemperatureIndependent,
CabanaPD::DynamicCriticalStretch>;
*/
using model_type = CabanaPD::ForceModel<CabanaPD::PMB, CabanaPD::Fracture>;

model_type force_model( delta, K, G0 );
// using model_type =
// CabanaPD::ForceModel<CabanaPD::LPS, CabanaPD::Fracture>;
Expand All @@ -77,6 +81,7 @@ void fragmentingCylinderExample( const std::string filename )
// Boundary conditions
// ====================================================
std::array<double, 3> system_size = inputs["system_size"];
/*
double height = system_size[2];
double dx = particles->dx[0];
double Rin = inputs["cylinder_inner_radius"];
Expand All @@ -85,13 +90,33 @@ void fragmentingCylinderExample( const std::string filename )
Rin - dx / 0.5, Rin + dx / 0.5, -0.5 * height, 0.5 * height );
auto bc = createBoundaryCondition( CabanaPD::ForceValueBCTag{}, 0.0,
exec_space{}, *particles, plane );
*/

double Rin = inputs["cylinder_inner_radius"];
double Rout = inputs["cylinder_outer_radius"];

double length = system_size[0];
double width = system_size[1];
double height = system_size[2];

CabanaPD::RegionBoundary<CabanaPD::Rectilinear> plane(
-0.1 * Rin, 0.1 * Rin, -0.1 * Rin, 0.1 * Rin, -0.5 * height,
0.5 * height );
auto bc = createBoundaryCondition( CabanaPD::ForceValueBCTag{}, 0.0,
exec_space{}, *particles, plane );

/*
CabanaPD::RegionBoundary<CabanaPD::Rectilinear> plane(
-0.5 * length, 0.5 * length, -0.5 * width, 0.5 * width, -0.5 * height,
0.5 * height ); auto bc = createBoundaryCondition(
CabanaPD::ForceValueBCTag{}, 0.0, exec_space{}, *particles, plane );
*/

// ====================================================
// Custom particle initialization
// ====================================================
double x_center = 0.5 * ( low_corner[0] + high_corner[0] );
double y_center = 0.5 * ( low_corner[1] + high_corner[1] );
double Rout = inputs["cylinder_outer_radius"];

// Do not create particles outside given cylindrical region
auto init_op = KOKKOS_LAMBDA( const int, const double x[3] )
Expand All @@ -109,8 +134,8 @@ void fragmentingCylinderExample( const std::string filename )
auto v = particles->sliceVelocity();
auto f = particles->sliceForce();

double vrmax = inputs["max_radial_initial_velocity"];
double vzmax = inputs["max_vertical_initial_velocity"];
double vrmax = inputs["max_radial_velocity"];
double vzmax = inputs["max_vertical_velocity"];
double zmin = low_corner[2];

auto init_functor = KOKKOS_LAMBDA( const int pid )
Expand Down
32 changes: 16 additions & 16 deletions examples/mechanics/inputs/fragmenting_cylinder.json
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
{
"num_cells" : {"value": [67, 67, 134]},
"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": 1.88e+6, "unit": "J/m^2"},
"horizon" : {"value": 0.00225, "unit": "m"},
"cylinder_outer_radius" : {"value": 0.025, "unit": "m"},
"cylinder_inner_radius" : {"value": 0.02, "unit": "m"},
"max_radial_initial_velocity" : {"value": 200, "unit": "m/s"},
"max_vertical_initial_velocity" : {"value": 50, "unit": "m/s"},
"final_time" : {"value": 4.0e-4, "unit": "s"},
"timestep" : {"value": 7.5e-8, "unit": "s"},
"timestep_safety_factor" : {"value": 0.85},
"output_frequency" : {"value": 50},
"output_reference" : {"value": false}
"num_cells" : {"value": [269, 269, 537]},
"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": 1.88e+6, "unit": "J/m^2"},
"horizon" : {"value": 5.59e-4, "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"},
"max_vertical_velocity" : {"value": 50, "unit": "m/s"},
"final_time" : {"value": 4.0e-4, "unit": "s"},
"timestep" : {"value": 1.0e-8, "unit": "s"},
"timestep_safety_factor" : {"value": 0.85},
"output_frequency" : {"value": 50},
"output_reference" : {"value": false}
}

0 comments on commit f349e2a

Please sign in to comment.