Skip to content

Commit

Permalink
Increase shift for checking turbine loation to 1e-3 instead of 1e-12 (e…
Browse files Browse the repository at this point in the history
…rf-model#1813)

Co-authored-by: Mahesh Natarajan <[email protected]>
  • Loading branch information
nataraj2 and Mahesh Natarajan authored Sep 16, 2024
1 parent 811ce38 commit 88078ad
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions Source/WindFarmParametrization/ERF_InitWindFarm.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();

Expand All @@ -228,8 +232,8 @@ WindFarm::fill_Nturb_multifab(const Geometry& geom,
Real y2 = ProbLoArr[1] + (lj+1)*dx[1];

for(int it=0; it<num_turb; it++){
if( d_xloc_ptr[it]+1e-12 > 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;
}
}
Expand Down

0 comments on commit 88078ad

Please sign in to comment.