Skip to content

Commit

Permalink
WIP: Thermomechanical solver WIP commit, evolves temp
Browse files Browse the repository at this point in the history
  • Loading branch information
jacob-moore22 committed Sep 17, 2024
1 parent cf5d7bc commit 24e8316
Show file tree
Hide file tree
Showing 9 changed files with 292 additions and 429 deletions.
34 changes: 33 additions & 1 deletion single-node-refactor/src/Solvers/SGH_solver_3D/src/position.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -61,4 +61,36 @@ void SGH3D::update_position(double rk_alpha,
node_coords(1, node_gid, dim) = node_coords(0, node_gid, dim) + rk_alpha * dt * half_vel;
}
}); // end parallel for over nodes
} // end subroutine
} // end subroutine



/////////////////////////////////////////////////////////////////////////////
///
/// \fn update_temperature
///
/// \brief Updates the nodal temperature based on temperature gradients
///
/// \param Runge Kutta time integration alpha value
/// \param Time step size
/// \param Number of dimensions in the mesh (REMOVE)
/// \param Number of nodes in the mesh
/// \param View of nodal position data
/// \param View of nodal velocity data
///
/////////////////////////////////////////////////////////////////////////////
// void SGH3D::update_position(double rk_alpha,
// double dt,
// const size_t num_dims,
// const size_t num_nodes,
// DCArrayKokkos<double>& node_coords,
// const DCArrayKokkos<double>& node_vel) const
// {
// // loop over all the nodes in the mesh
// FOR_ALL(node_gid, 0, num_nodes, {
// for (int dim = 0; dim < num_dims; dim++) {
// double half_vel = (node_vel(1, node_gid, dim) + node_vel(0, node_gid, dim)) * 0.5;
// node_coords(1, node_gid, dim) = node_coords(0, node_gid, dim) + rk_alpha * dt * half_vel;
// }
// }); // end parallel for over nodes
// } // end subroutine
Original file line number Diff line number Diff line change
Expand Up @@ -79,20 +79,23 @@ namespace SGTM3D_State
material_pt_state::mass,
material_pt_state::volume_fraction,
material_pt_state::specific_internal_energy,
material_pt_state::eroded_flag
material_pt_state::eroded_flag,
material_pt_state::heat_flux
};

// Material corner state to be initialized for the SGH solver
static const std::vector<material_corner_state> required_material_corner_state =
{
material_corner_state::force
material_corner_state::force,
material_corner_state::heat_flux
};

// Corner state to be initialized for the SGH solver
static const std::vector<corner_state> required_corner_state =
{
corner_state::force,
corner_state::mass
corner_state::mass,
corner_state::heat_flux
};
}

Expand Down Expand Up @@ -243,6 +246,26 @@ class SGTM3D : public Solver
const double dt,
const double rk_alpha) const;


void get_heat_flux(
const Material_t& Materials,
const Mesh_t& mesh,
const DCArrayKokkos<double>& GaussPoints_vol,
const DCArrayKokkos<double>& node_coords,
const DCArrayKokkos<double>& node_temp,
const DCArrayKokkos<double>& MaterialPoints_q_flux,
const DCArrayKokkos<double>& MaterialPoints_statev,
const DCArrayKokkos<double>& corner_q_flux,
const DCArrayKokkos<double>& MaterialCorners_q_flux,
const corners_in_mat_t corners_in_mat_elem,
const DCArrayKokkos<size_t>& MaterialToMeshMaps_elem,
const size_t num_mat_elems,
const size_t mat_id,
const double fuzz,
const double small,
const double dt,
const double rk_alpha) const;

// **** Functions defined in geometry.cpp **** //
void update_position(
double rk_alpha,
Expand All @@ -252,6 +275,14 @@ class SGTM3D : public Solver
DCArrayKokkos<double>& node_coords,
const DCArrayKokkos<double>& node_vel) const;

void update_temperature(
double rk_alpha,
double dt,
const size_t num_dims,
const size_t num_nodes,
DCArrayKokkos<double>& node_temperature,
const DCArrayKokkos<double>& node_vel) const;

// **** Functions defined in momentum.cpp **** //
void update_velocity(
double rk_alpha,
Expand Down
Loading

0 comments on commit 24e8316

Please sign in to comment.