From 9fda161c2d895a08323b099d3cc1a78d3ca98f0c Mon Sep 17 00:00:00 2001 From: Tony Martinez Date: Thu, 27 Jul 2023 09:49:49 -0600 Subject: [PATCH] Added flag to ensure that mac velocity not sampled for init or restart in Actuator (#889) Co-authored-by: Michael Kuhn --- amr-wind/wind_energy/actuator/Actuator.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/amr-wind/wind_energy/actuator/Actuator.cpp b/amr-wind/wind_energy/actuator/Actuator.cpp index 0ecc66ae2e..54f4485ae6 100644 --- a/amr-wind/wind_energy/actuator/Actuator.cpp +++ b/amr-wind/wind_energy/actuator/Actuator.cpp @@ -188,7 +188,9 @@ void Actuator::update_positions() m_container->update_positions(); // Sample velocities at the new locations - if (m_sample_nmhalf) { + if (m_sample_nmhalf && + (m_sim.time().current_time() > m_sim.time().start_time())) { + // Avoid using mac velocities if at init or restart const auto& umac = m_sim.repo().get_field("u_mac"); const auto& vmac = m_sim.repo().get_field("v_mac"); const auto& wmac = m_sim.repo().get_field("w_mac");