Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RZ solver and user material model updates #225

Merged
merged 35 commits into from
Sep 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
9cb544b
updated var name for eos_state_vars
Aug 30, 2024
4152757
updated and fixed bugs in RZ solver
Aug 30, 2024
3c5db1c
ENH: refactor dynamic objective calls
Aug 13, 2024
05ea480
BUG: dont use host class pointer in device kernel
Aug 13, 2024
8f48419
WIP: refactor adjoint equations for generic objective
Aug 15, 2024
03bd8b6
WIP: refactor adjoint for generic objective
Aug 15, 2024
a76b006
BUG: use midpoint evaluation
Aug 16, 2024
91b72c8
BUG: ensure t0 for IVP gradient contribution
Aug 19, 2024
b929245
ENH: generalize objective gradient term tally
Aug 20, 2024
4581308
ENH: check for <= zero density in region input
Aug 21, 2024
c8963f5
WIP: internal energy objective
Aug 21, 2024
2979780
WIP: internal energy objective
Aug 21, 2024
b68e2ae
BUG: optimization if check
Aug 21, 2024
25d8424
ENH: Internal energy objective
Aug 22, 2024
e051b1a
BUG: missing recast error
Aug 23, 2024
3dc277d
BUG: elem_sie access bug in objective
Aug 24, 2024
4aad9c7
ENH: taylor anvil yaml example script for optimization
Aug 27, 2024
094d806
WIP: pressure vessel UI
Aug 29, 2024
05d4b41
DOC: remove unused params in yaml files, add new yaml example
Aug 29, 2024
8b6fd83
DOC: missing params in yaml file example
Aug 29, 2024
ec4b7a8
WIP: pressure vessel problem support
Aug 31, 2024
19831b8
ENH: Restructuring common to seperate .cpp from .h
jacob-moore22 Aug 28, 2024
ed88b8c
ENH: Cleanup geometry
jacob-moore22 Aug 28, 2024
8e39ef2
ENH: Tidy up mesh (removed unused function definition)
jacob-moore22 Aug 28, 2024
94eb2fd
ENH: Silence cuda warnings
jacob-moore22 Aug 28, 2024
a26fdf6
ENH: Pull RZ functions from 3D solver
jacob-moore22 Aug 28, 2024
fcc4862
ENH: Add basic abaqus mesh reader
jacob-moore22 Aug 28, 2024
405bc33
ENH: Adding Abaqus mesh reader and testing
jacob-moore22 Aug 28, 2024
343c29e
ENH: Add gitattributes file to ignore data/meshes from code statistics
jacob-moore22 Aug 28, 2024
92f0380
BUG: remove bug line from .gitattributes
jacob-moore22 Aug 28, 2024
80401f3
ENH: Add extra * to make sure it grabs both files and directories for…
jacob-moore22 Aug 28, 2024
14ebdeb
ENH: Add timer outputs for driver
jacob-moore22 Aug 29, 2024
2a753cd
ENH: Add precision to conservation outputs
jacob-moore22 Sep 3, 2024
ae5f44f
Merge branch 'main' into RZsolver
jacob-moore22 Sep 5, 2024
c10b4b1
Merge branch 'main' into RZsolver
jacob-moore22 Sep 5, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -433,7 +433,8 @@ void SGH3D::get_force(const Material_t& Materials,
node_vel,
GaussPoints_vol(elem_gid),
dt,
rk_alpha);
rk_alpha,
Materials.strength_global_vars);
} // end logical on increment_based strength model
}); // end parallel for loop over elements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,8 @@ void SGH3D::update_state(
node_vel,
GaussPoints_vol(gauss_gid),
dt,
rk_alpha);
rk_alpha,
Materials.strength_global_vars);
}); // end parallel for over mat elem lid
} // end if state_based strength model

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -414,11 +414,21 @@ void SGHRZ::get_force_rz(const Material_t& Materials,
// Wilkins used elem_area*0.25 for the corner area, we will use the corner
// areas calculated using Barlow's symmetry and energy preserving area partitioning
if (node_radius > tiny) {

// sigma_RZ / R_p
corner_force(corner_gid, 0) += tau(1, 0) * corner_areas(corner_lid) / node_radius;
double force_term_1 = tau(1, 0) * corner_areas(corner_lid) / node_radius;
jacob-moore22 marked this conversation as resolved.
Show resolved Hide resolved
//force_term_1 = tau(1, 0) * 0.25*elem_area / node_radius; // Wilkins

corner_force(corner_gid, 0) += force_term_1;
MaterialCorners_force(mat_corner_lid, 0) += force_term_1;

// (sigma_RR - sigma_theta) / R_p
corner_force(corner_gid, 1) += (tau(1, 1) - tau(2, 2)) * corner_areas(corner_lid) / node_radius;
double force_term_2 = (tau(1, 1) - tau(2, 2)) * corner_areas(corner_lid) / node_radius;
//force_term_2 = (tau(1, 1) - tau(2, 2)) * 0.25*elem_area / node_radius; // Wilkins

corner_force(corner_gid, 1) += force_term_2;
MaterialCorners_force(mat_corner_lid, 1) += force_term_2;

} // end if radius >0

} // end if eroded
Expand Down Expand Up @@ -449,7 +459,8 @@ void SGHRZ::get_force_rz(const Material_t& Materials,
node_vel,
GaussPoints_vol(elem_gid),
dt,
rk_alpha);
rk_alpha,
Materials.strength_global_vars);
} // end logical on increment_based strength model
}); // end parallel for loop over elements

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,8 @@ void SGHRZ::update_state_rz(
node_vel,
GaussPoints_vol(gauss_gid),
dt,
rk_alpha);
rk_alpha,
Materials.strength_global_vars);


}); // end parallel for over mat elem lid
Expand Down
11 changes: 6 additions & 5 deletions single-node-refactor/src/common/include/material.h
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ static std::map<std::string, model::EOSModels> eos_models_map
{ "no_eos", model::noEOS },
{ "gamma_law_gas", model::gammaLawGasEOS },
{ "void", model::voidEOS },
{ "user_defined", model::userDefinedEOS },
{ "user_defined_eos", model::userDefinedEOS },
};

static std::map<std::string, model::ErosionModels> erosion_model_map
Expand Down Expand Up @@ -184,7 +184,7 @@ struct MaterialFunctions_t
const DCArrayKokkos<double>& MaterialPoints_stress,
const size_t MaterialPoints_lid,
const size_t mat_id,
const DCArrayKokkos<double>& MaterialPoints_state_vars,
const DCArrayKokkos<double>& MaterialPoints_eos_state_vars,
const DCArrayKokkos<double>& MaterialPoints_sspd,
const double den,
const double sie,
Expand All @@ -194,7 +194,7 @@ struct MaterialFunctions_t
const DCArrayKokkos<double>& MaterialPoints_stress,
const size_t MaterialPoints_lid,
const size_t mat_id,
const DCArrayKokkos<double>& MaterialPoints_state_vars,
const DCArrayKokkos<double>& MaterialPoints_eos_state_vars,
const DCArrayKokkos<double>& MaterialPoints_sspd,
const double den,
const double sie,
Expand All @@ -207,7 +207,7 @@ struct MaterialFunctions_t
const DCArrayKokkos<double>& MaterialPoints_stress,
const size_t MaterialPoints_lid,
const size_t mat_id,
const DCArrayKokkos<double>& MaterialPoints_state_vars,
const DCArrayKokkos<double>& MaterialPoints_strength_state_vars,
const DCArrayKokkos<double>& MaterialPoints_sspd,
const double den,
const double sie,
Expand All @@ -217,7 +217,8 @@ struct MaterialFunctions_t
const DCArrayKokkos<double>& node_vel,
const double vol,
const double dt,
const double rk_alpha) = NULL;
const double rk_alpha,
const RaggedRightArrayKokkos<double> &strength_global_vars) = NULL;

// -- Erosion --

Expand Down
1 change: 1 addition & 0 deletions single-node-refactor/src/input/parse_yaml.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1707,6 +1707,7 @@ void parse_materials(Yaml::Node& root, Material_t& Materials)
break;

case model::userDefinedStrength:

RUN({
Materials.MaterialFunctions(mat_id).calc_stress = &UserDefinedStrengthModel::calc_stress;
});
Expand Down
5 changes: 3 additions & 2 deletions single-node-refactor/src/material_models/eos/gamma_law_eos.h
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@ namespace GammaLawGasEOSModel {
const DCArrayKokkos<double>& MaterialPoints_stress,
const size_t mat_pt_lid,
const size_t mat_id,
const DCArrayKokkos<double>& MaterialPoints_eos_state_vars,
const DCArrayKokkos<double>& MaterialPoints_sspd,
const double den,
const double sie,
Expand All @@ -92,7 +93,7 @@ namespace GammaLawGasEOSModel {
const DCArrayKokkos<double>& MaterialPoints_stress,
const size_t mat_pt_lid,
const size_t mat_id,
const DCArrayKokkos<double>& MaterialPoints_state_vars,
const DCArrayKokkos<double>& MaterialPoints_eos_state_vars,
const DCArrayKokkos<double>& MaterialPoints_sspd,
const double den,
const double sie,
Expand All @@ -113,7 +114,7 @@ namespace GammaLawGasEOSModel {
const DCArrayKokkos<double>& MaterialPoints_stress,
const size_t mat_pt_lid,
const size_t mat_id,
const DCArrayKokkos<double>& MaterialPoints_state_vars,
const DCArrayKokkos<double>& MaterialPoints_eos_state_vars,
const DCArrayKokkos<double>& MaterialPoints_sspd,
const double den,
const double sie,
Expand Down
22 changes: 20 additions & 2 deletions single-node-refactor/src/material_models/eos/no_eos.h
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,31 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
///
/////////////////////////////////////////////////////////////////////////////
namespace NoEOSModel {

// host side function
static void initialize(const DCArrayKokkos<double>& MaterialPoints_pres,
const DCArrayKokkos<double>& MaterialPoints_stress,
const size_t mat_pt_lid,
const size_t mat_id,
const DCArrayKokkos<double>& MaterialPoints_eos_state_vars,
const DCArrayKokkos<double>& MaterialPoints_sspd,
const double den,
const double sie,
const RaggedRightArrayKokkos<double> &eos_global_vars,
const size_t num_vars)
{



return;
} // end func

KOKKOS_FUNCTION
static void calc_pressure(const DCArrayKokkos<double>& MaterialPoints_pres,
const DCArrayKokkos<double>& MaterialPoints_stress,
const size_t mat_pt_lid,
const size_t mat_id,
const DCArrayKokkos<double>& MaterialPoints_state_vars,
const DCArrayKokkos<double>& MaterialPoints_eos_state_vars,
const DCArrayKokkos<double>& MaterialPoints_sspd,
const double den,
const double sie,
Expand All @@ -74,7 +92,7 @@ namespace NoEOSModel {
const DCArrayKokkos<double>& MaterialPoints_stress,
const size_t mat_pt_lid,
const size_t mat_id,
const DCArrayKokkos<double>& MaterialPoints_state_vars,
const DCArrayKokkos<double>& MaterialPoints_eos_state_vars,
const DCArrayKokkos<double>& MaterialPoints_sspd,
const double den,
const double sie,
Expand Down
46 changes: 42 additions & 4 deletions single-node-refactor/src/material_models/eos/user_defined_eos.h
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,30 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/////////////////////////////////////////////////////////////////////////////
namespace UserDefinedEOSModel
{
// host side function
static void initialize(const DCArrayKokkos<double>& MaterialPoints_pres,
const DCArrayKokkos<double>& MaterialPoints_stress,
const size_t mat_pt_lid,
const size_t mat_id,
const DCArrayKokkos<double>& MaterialPoints_eos_state_vars,
const DCArrayKokkos<double>& MaterialPoints_sspd,
const double den,
const double sie,
const RaggedRightArrayKokkos<double> &eos_global_vars,
const size_t num_vars)
{



return;
} // end func

KOKKOS_FUNCTION
static void calc_pressure(const DCArrayKokkos<double>& MaterialPoints_pres,
const DCArrayKokkos<double>& MaterialPoints_stress,
const size_t mat_pt_lid,
const size_t mat_id,
const DCArrayKokkos<double>& MaterialPoints_state_vars,
const DCArrayKokkos<double>& MaterialPoints_eos_state_vars,
const DCArrayKokkos<double>& MaterialPoints_sspd,
const double den,
const double sie,
Expand All @@ -88,7 +105,7 @@ namespace UserDefinedEOSModel
const DCArrayKokkos<double>& MaterialPoints_stress,
const size_t mat_pt_lid,
const size_t mat_id,
const DCArrayKokkos<double>& MaterialPoints_state_vars,
const DCArrayKokkos<double>& MaterialPoints_eos_state_vars,
const DCArrayKokkos<double>& MaterialPoints_sspd,
const double den,
const double sie,
Expand Down Expand Up @@ -131,12 +148,30 @@ namespace UserDefinedEOSModel
// ------------------------------------------------------------------------------
namespace NotionalEOSModel {

// host side function
static void initialize(const DCArrayKokkos<double>& MaterialPoints_pres,
const DCArrayKokkos<double>& MaterialPoints_stress,
const size_t mat_pt_lid,
const size_t mat_id,
const DCArrayKokkos<double>& MaterialPoints_eos_state_vars,
const DCArrayKokkos<double>& MaterialPoints_sspd,
const double den,
const double sie,
const RaggedRightArrayKokkos<double> &eos_global_vars,
const size_t num_vars)
{



return;
} // end func

KOKKOS_FUNCTION
static void calc_pressure(const DCArrayKokkos<double>& MaterialPoints_pres,
const DCArrayKokkos<double>& MaterialPoints_stress,
const size_t mat_pt_lid,
const size_t mat_id,
const DCArrayKokkos<double>& MaterialPoints_state_vars,
const DCArrayKokkos<double>& MaterialPoints_eos_state_vars,
const DCArrayKokkos<double>& MaterialPoints_sspd,
const double den,
const double sie,
Expand All @@ -153,7 +188,7 @@ namespace NotionalEOSModel {
const DCArrayKokkos<double>& MaterialPoints_stress,
const size_t mat_pt_lid,
const size_t mat_id,
const DCArrayKokkos<double>& MaterialPoints_state_vars,
const DCArrayKokkos<double>& MaterialPoints_eos_state_vars,
const DCArrayKokkos<double>& MaterialPoints_sspd,
const double den,
const double sie,
Expand All @@ -169,4 +204,7 @@ namespace NotionalEOSModel {
} // end namespace





#endif // end Header Guard
58 changes: 38 additions & 20 deletions single-node-refactor/src/material_models/eos/void_eos.h
Original file line number Diff line number Diff line change
Expand Up @@ -55,37 +55,55 @@ ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
/////////////////////////////////////////////////////////////////////////////
namespace VoidEOSModel {

// host side function
static void initialize(const DCArrayKokkos<double>& MaterialPoints_pres,
const DCArrayKokkos<double>& MaterialPoints_stress,
const size_t mat_pt_lid,
const size_t mat_id,
const DCArrayKokkos<double>& MaterialPoints_eos_state_vars,
const DCArrayKokkos<double>& MaterialPoints_sspd,
const double den,
const double sie,
const RaggedRightArrayKokkos<double> &eos_global_vars,
const size_t num_vars)
{



return;
} // end func

KOKKOS_FUNCTION
static void calc_pressure(const DCArrayKokkos<double>& elem_pres,
const DCArrayKokkos<double>& elem_stress,
const size_t mat_pt_lid,
const size_t mat_id,
const DCArrayKokkos<double>& elem_state_vars,
const DCArrayKokkos<double>& elem_sspd,
const double den,
const double sie,
const RaggedRightArrayKokkos<double> &eos_global_vars)
static void calc_pressure(const DCArrayKokkos<double>& MaterialPoints_pres,
const DCArrayKokkos<double>& MaterialPoints_stress,
const size_t mat_pt_lid,
const size_t mat_id,
const DCArrayKokkos<double>& MaterialPoints_eos_state_vars,
const DCArrayKokkos<double>& MaterialPoints_sspd,
const double den,
const double sie,
const RaggedRightArrayKokkos<double> &eos_global_vars)
{
// pressure of a void is 0
elem_pres(mat_pt_lid) = 0.0;
MaterialPoints_pres(mat_pt_lid) = 0.0;

return;
} // end func

KOKKOS_FUNCTION
static void calc_sound_speed(const DCArrayKokkos<double>& elem_pres,
const DCArrayKokkos<double>& elem_stress,
const size_t mat_pt_lid,
const size_t mat_id,
const DCArrayKokkos<double>& elem_state_vars,
const DCArrayKokkos<double>& elem_sspd,
const double den,
const double sie,
const RaggedRightArrayKokkos<double> &eos_global_vars)
static void calc_sound_speed(const DCArrayKokkos<double>& MaterialPoints_pres,
const DCArrayKokkos<double>& MaterialPoints_stress,
const size_t mat_pt_lid,
const size_t mat_id,
const DCArrayKokkos<double>& MaterialPoints_eos_state_vars,
const DCArrayKokkos<double>& MaterialPoints_sspd,
const double den,
const double sie,
const RaggedRightArrayKokkos<double> &eos_global_vars)
{

// sound speed of a void is 0, machine small must be used for CFL calculation
elem_sspd(mat_pt_lid) = 1.0e-32;
MaterialPoints_sspd(mat_pt_lid) = 1.0e-32;

return;
} // end func
Expand Down
Loading
Loading