Skip to content

Commit

Permalink
Changes to thermal deformation cube example
Browse files Browse the repository at this point in the history
  • Loading branch information
pabloseleson committed Oct 17, 2024
1 parent 9571abf commit f42ea8f
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 6 deletions.
10 changes: 5 additions & 5 deletions examples/thermomechanics/inputs/thermal_deformation_cube.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"num_cells" : {"value": [40, 40, 40]},
"num_cells" : {"value": [49, 49, 49]},
"system_size" : {"value": [0.1, 0.1, 0.1], "unit": "m"},
"density" : {"value": 8915, "unit": "kg/m^3"},
"elastic_modulus" : {"value": 115e+9, "unit": "Pa"},
"thermal_expansion_coeff" : {"value": 17e-6, "unit": "oC^{-1}"},
"thermal_conductivity" : {"value": 387, "unit": "W/(m.K)"},
"specific_heat_capacity" : {"value": 385, "unit": "J/(kg.K)"},
"reference_temperature" : {"value": 100.0, "unit": "oC"},
"horizon" : {"value": 0.0075, "unit": "m"},
"horizon" : {"value": 0.0062, "unit": "m"},
"final_time" : {"value": 8, "unit": "s"},
"timestep" : {"value": 5.1e-8, "unit": "s"},
"thermal_subcycle_steps": {"value": 100},
"output_frequency" : {"value": 1},
"timestep" : {"value": 0.02, "unit": "s"},
"thermal_subcycle_steps": {"value": 1},
"output_frequency" : {"value": 10},
"output_reference" : {"value": true}
}
23 changes: 22 additions & 1 deletion examples/thermomechanics/thermal_deformation_heat_transfer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

#include <CabanaPD.hpp>

// Simulate thermally-induced deformation in a rectangular plate.
// Simulate thermally-induced deformation in a cube.
void thermalDeformationHeatTransferExample( const std::string filename )
{
// ====================================================
Expand Down Expand Up @@ -104,6 +104,22 @@ void thermalDeformationHeatTransferExample( const std::string filename )
// ====================================================
// Boundary condition
// ====================================================

// Temperature profile imposed on top and bottom surfaces
double dy = particles->dx[1];
using plane_type = CabanaPD::RegionBoundary<CabanaPD::RectangularPrism>;

// Top surface: y-direction
plane_type plane1( low_corner[0], high_corner[0], high_corner[1] - dy,
high_corner[1] + dy, low_corner[2], high_corner[2] );

// Bottom surface: y-direction
plane_type plane2( low_corner[0], high_corner[0], low_corner[1] - dy,
low_corner[1] + dy, low_corner[2], high_corner[2] );

std::vector<plane_type> planes = { plane1, plane2 };

/*
// Temperature profile imposed on top, bottom, left, and right surfaces
double dx = particles->dx[0];
double dy = particles->dx[1];
Expand Down Expand Up @@ -135,8 +151,11 @@ void thermalDeformationHeatTransferExample( const std::string filename )
high_corner[1], high_corner[2] - dz,
high_corner[2] + dz );
// std::vector<plane_type> planes = { plane1, plane2, plane3,
// plane4, plane5, plane6 };
std::vector<plane_type> planes = { plane1, plane2, plane3,
plane4, plane5, plane6 };
*/

temp = particles->sliceTemperature();
// This is purposely delayed until after solver init so that ghosted
Expand Down Expand Up @@ -167,6 +186,7 @@ void thermalDeformationHeatTransferExample( const std::string filename )
createOutputProfile( MPI_COMM_WORLD, num_cells[1], profile_dim, file_name,
*particles, value );

/*
// Output y-displacement along the x-axis
createDisplacementProfile( MPI_COMM_WORLD,
"ydisplacement_xaxis_profile.txt", *particles,
Expand All @@ -186,6 +206,7 @@ void thermalDeformationHeatTransferExample( const std::string filename )
createDisplacementMagnitudeProfile(
MPI_COMM_WORLD, "displacement_magnitude_yaxis_profile.txt", *particles,
num_cells[1], 1 );
*/
}

// Initialize MPI+Kokkos.
Expand Down

0 comments on commit f42ea8f

Please sign in to comment.