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

Parsing for composite bodies/abutting meshes #68

Merged
merged 6 commits into from
Apr 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
24 changes: 24 additions & 0 deletions app/exawind/exawind.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,30 @@ int main(int argc, char** argv)
: false;
sim.set_holemap_alg(holemap_alg);

if (node["composite_body"]) {
const YAML::Node& composite_mesh = node["composite_body"];
const int num_composite = static_cast<int>(composite_mesh.size());
sim.set_composite_num(num_composite);

for (int i = 0; i < num_composite; i++) {
const YAML::Node& composite_node = composite_mesh[i];

const int num_body_tags = composite_node["num_body_tags"].as<int>();

const auto body_tags =
composite_node["body_tags"].as<std::vector<int>>();

const auto dominance_tags =
composite_node["dominance_tags"].as<std::vector<int>>();

const double search_tol =
composite_node["search_tolerance"].as<double>();

sim.set_composite_body(
i, num_body_tags, body_tags, dominance_tags, search_tol);
}
}

const YAML::Node yaml_replace_all = node["nalu_replace_all"];
for (int i = 0; i < num_nwsolvers; i++) {
if (nalu_comms.at(i) != MPI_COMM_NULL) {
Expand Down
3 changes: 2 additions & 1 deletion src/OversetSimulation.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -95,8 +95,9 @@ void OversetSimulation::perform_overset_connectivity()
m_tg.profile();
if ((m_is_adaptive_holemap_alg == 1) &&
(m_complementary_comm_initialized == false)) {
m_tg.assembleComms();
m_tg.assembleComplementComms();
m_complementary_comm_initialized = true;
if (m_num_composite_bodies > 0) m_tg.assembleCompositeMap();
}
m_tg.performConnectivity();
if (m_has_amr) m_tg.performConnectivityAMR();
Expand Down
28 changes: 27 additions & 1 deletion src/OversetSimulation.h
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@ class OversetSimulation
bool m_complementary_comm_initialized{false};
//! Flag for holemap algorithm
bool m_is_adaptive_holemap_alg{false};
//! Number of composite bodies
int m_num_composite_bodies{0};
//! Tioga instance
TIOGA::tioga m_tg;
//! Determine unstructured and structured solver types
Expand Down Expand Up @@ -107,7 +109,31 @@ class OversetSimulation
void set_holemap_alg(bool alg)
{
m_is_adaptive_holemap_alg = alg;
if (m_is_adaptive_holemap_alg == true) m_tg.setHoleMapAlgorithm(1);
if (m_is_adaptive_holemap_alg) m_tg.setHoleMapAlgorithm(1);
}

void set_composite_num(const int num_composite)
{
m_num_composite_bodies = num_composite;
m_tg.setNumCompositeBodies(num_composite);
}

void set_composite_body(
int body_index,
marchdf marked this conversation as resolved.
Show resolved Hide resolved
const int num_body_tags,
std::vector<int> bodytags,
marchdf marked this conversation as resolved.
Show resolved Hide resolved
std::vector<int> dominance_tags,
const double search_tol)
{
if (m_is_adaptive_holemap_alg) {
m_tg.registerCompositeBody(
(body_index + 1), num_body_tags, bodytags.data(),
dominance_tags.data(), search_tol);
} else {
throw std::runtime_error(
"The composite body feature requires the use of adaptive "
"holemap");
}
}
};

Expand Down
2 changes: 1 addition & 1 deletion test/meshes
22 changes: 22 additions & 0 deletions test/test_files/nalu-nalu-panel/nalu-nalu-panel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Example input file

exawind:
nalu_wind_inp:
- nalu_platform.yaml
- nalu_panel.yaml
num_timesteps: 10
additional_picard_iterations: 2
use_adaptive_holemap: true
composite_body:
- composite_name: first_body
num_body_tags: 2
body_tags: [1,2]
dominance_tags: [0,1]
search_tolerance: 1e-12

# Variables for overset exchange
nalu_vars:
- velocity
- pressure
- turbulent_ke
- specific_dissipation_rate
179 changes: 179 additions & 0 deletions test/test_files/nalu-nalu-panel/nalu_panel.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,179 @@
# -*- mode: yaml -*-

Simulations:
- name: sim1
time_integrator: ti_1
optimizer: opt1

linear_solvers:

- name: solve_scalar
type: hypre
method: hypre_gmres
preconditioner: boomerAMG
tolerance: 1e-5
max_iterations: 200
kspace: 5
output_level: 0

- name: solve_cont
type: hypre
method: hypre_gmres
preconditioner: boomerAMG
tolerance: 1e-5
max_iterations: 200
kspace: 5
output_level: 0

realms:
- name: assembly
mesh: ../../meshes/panel_cap.exo
use_edges: yes
automatic_decomposition_type: rcb
rebalance_mesh: yes
stk_rebalance_method: parmetis

equation_systems:
name: theEqSys
max_iterations: 3
decoupled_overset_solve: yes

solver_system_specification:
velocity: solve_scalar
pressure: solve_cont
turbulent_ke: solve_scalar
specific_dissipation_rate: solve_scalar
ndtw: solve_cont

systems:

- WallDistance:
name: myNDTW
max_iterations: 1
convergence_tolerance: 1.0e-8
update_frequency: 1000000000
exchange_fringe_data: yes

- LowMachEOM:
name: myLowMach
max_iterations: 1
convergence_tolerance: 1e-7

- ShearStressTransport:
name: mySST
max_iterations: 1
convergence_tolerance: 1e-8

initial_conditions:

- constant: ic_1
target_name: [panel-HEX]
value:
pressure: 0.0
velocity: [51.8,0.0,0.0]
turbulent_ke: 0.095118
specific_dissipation_rate: 250.0

material_properties:
target_name: [panel-HEX]
specifications:
- name: density
type: constant
value: 1.20

- name: viscosity
type: constant
value: 1.8e-5

boundary_conditions:

- wall_boundary_condition: bc_panel_struct
target_name: panel_struct
wall_user_data:
velocity: [0.0, 0.0, 0.0]
turbulent_ke: 0.0

- wall_boundary_condition: bc_panel_surf
target_name: panel_surf
wall_user_data:
velocity: [0.0, 0.0, 0.0]
turbulent_ke: 0.0

- overset_boundary_condition: bc_ovst
overset_connectivity_type: tioga
overset_user_data:
mesh_tag_offset: 1
tioga_options:
set_resolutions: no
mesh_group:
- overset_name: panel
mesh_parts: [ panel-HEX ]
wall_parts: [ panel_surf, panel_struct]
ovset_parts: [ panel_outer ]

solution_options:
name: myOptions
turbulence_model: sst
projected_timescale_type: momentum_diag_inv #### Use 1/diagA formulation

options:
- hybrid_factor:
velocity: 1.0
turbulent_ke: 1.0
specific_dissipation_rate: 1.0

- upw_factor:
velocity: 0.0
turbulent_ke: 0.0
specific_dissipation_rate: 0.0

- alpha_upw:
velocity: 1.0
turbulent_ke: 1.0
specific_dissipation_rate: 1.0

- limiter:
pressure: no
velocity: no

- projected_nodal_gradient:
pressure: element
velocity: element

- relaxation_factor:
velocity: 0.7
pressure: 0.3
turbulent_ke: 0.7
specific_dissipation_rate: 0.7

output:
output_data_base_name: out/panel.e
output_frequency: 1
output_node_set: no
output_variables:
- velocity
- pressure
- dpdx
- mesh_displacement
- iblank
- iblank_cell
- turbulent_ke
- specific_dissipation_rate
- minimum_distance_to_wall
- sst_f_one_blending
- turbulent_viscosity
- q_criterion
- vorticity

Time_Integrators:
- StandardTimeIntegrator:
name: ti_1
start_time: 0
termination_step_count: 100
time_step: 0.005
time_stepping_type: fixed
time_step_count: 0
second_order_accuracy: yes

realms:
- assembly
Loading
Loading