From 88078ad10d5a57e9d54cad984861d05afff37aae Mon Sep 17 00:00:00 2001 From: Mahesh Natarajan Date: Mon, 16 Sep 2024 15:23:21 -0700 Subject: [PATCH] Increase shift for checking turbine loation to 1e-3 instead of 1e-12 (#1813) Co-authored-by: Mahesh Natarajan --- Source/WindFarmParametrization/ERF_InitWindFarm.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/Source/WindFarmParametrization/ERF_InitWindFarm.cpp b/Source/WindFarmParametrization/ERF_InitWindFarm.cpp index c0e0e8278..40d9a4009 100644 --- a/Source/WindFarmParametrization/ERF_InitWindFarm.cpp +++ b/Source/WindFarmParametrization/ERF_InitWindFarm.cpp @@ -211,6 +211,10 @@ WindFarm::fill_Nturb_multifab(const Geometry& geom, int i_lo = geom.Domain().smallEnd(0); int i_hi = geom.Domain().bigEnd(0); int j_lo = geom.Domain().smallEnd(1); int j_hi = geom.Domain().bigEnd(1); auto dx = geom.CellSizeArray(); + if(dx[0]<= 1e-3 or dx[1]<=1e-3 or dx[2]<= 1e-3) { + Abort("The value of mesh spacing for wind farm parametrization cannot be less than 1e-3 m. " + "It should be usually of order 1 m"); + } auto ProbLoArr = geom.ProbLoArray(); int num_turb = xloc.size(); @@ -228,8 +232,8 @@ WindFarm::fill_Nturb_multifab(const Geometry& geom, Real y2 = ProbLoArr[1] + (lj+1)*dx[1]; for(int it=0; it x1 and d_xloc_ptr[it]+1e-12 < x2 and - d_yloc_ptr[it]+1e-12 > y1 and d_yloc_ptr[it]+1e-12 < y2){ + if( d_xloc_ptr[it]+1e-3 > x1 and d_xloc_ptr[it]+1e-3 < x2 and + d_yloc_ptr[it]+1e-3 > y1 and d_yloc_ptr[it]+1e-3 < y2){ Nturb_array(i,j,k,0) = Nturb_array(i,j,k,0) + 1; } }