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

add option for direction-dependent bc's #136

Merged

Conversation

asalmgren
Copy link
Contributor

No description provided.

@asalmgren asalmgren marked this pull request as draft July 30, 2024 02:27
Copy link
Contributor

@mukul1992 mukul1992 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I caught a few mistakes and some possible ones.

@@ -430,7 +432,7 @@ Godunov::ExtrapVelToFacesOnBox ( Box const& bx, int ncomp,
sth += Real(0.5) * l_dt * f(i ,j,k,n);
}

HydroBC::SetXEdgeBCs(i, j, k, n, q, stl, sth, bc.lo(0), dlo.x, bc.hi(0), dhi.x, true);
HydroBC::SetXEdgeBCs(i, j, k, n, q, stl, sth, stl, sth, bc.lo(0), dlo.x, bc.hi(0), dhi.x, true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Are these calls a substitute for Godunov_cc_zbc_lo type calls in A-W? In A-W, those use u_ad/v_ad/w_ad as the "edge" velocities. Are you sure using stl/sth is correct?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, on a second look, to match with A-W, these calls should be passing u_ad/v_ad/w_ad instead of stl and sth as velm and velp.

See the Godunov_cc_xbc_lo type calls in incflo_godunov_predict.cpp in A-W for reference. Note that these are coded separately from the Godunov_trans_xbc type functions in A-W. They are mostly similar in implementation though but need to make sure..

@@ -88,7 +89,8 @@ void PredictStateOnXFace ( const int i, const int j, const int k, const int n,
}

}
else if (i == domain_ihi+1 && (bc.hi(0) == BCType::ext_dir))
else if (i == domain_ihi+1 && ((bc.hi(0) == BCType::ext_dir) ||
(bc.lo(0) == BCType::direction_dependent && umac <= 0.0)) )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(bc.lo(0) == BCType::direction_dependent && umac <= 0.0)) )
(bc.hi(0) == BCType::direction_dependent && umac <= 0.0)) )

@@ -153,7 +156,8 @@ void PredictStateOnYFace ( const int i, const int j, const int k, const int n,
amrex_calc_yslope_extdir(i,j ,k,n,order,S, extdir_or_ho_jlo, extdir_or_ho_jhi, domain_jlo, domain_jhi);
}
}
else if (j == domain_jhi+1 && (bc.hi(1) == BCType::ext_dir))
else if (j == domain_jhi+1 && ((bc.hi(1) == BCType::ext_dir) ||
(bc.lo(1) == BCType::direction_dependent && vmac <= 0.0)) )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(bc.lo(1) == BCType::direction_dependent && vmac <= 0.0)) )
(bc.hi(1) == BCType::direction_dependent && vmac <= 0.0)) )

@@ -218,7 +223,8 @@ void PredictStateOnZFace ( const int i, const int j, const int k, const int n,
amrex_calc_zslope_extdir(i,j,k ,n,order,S, extdir_or_ho_klo, extdir_or_ho_khi, domain_klo, domain_khi);
}
}
else if (k == domain_khi+1 && (bc.hi(2) == BCType::ext_dir))
else if (k == domain_khi+1 && ((bc.hi(2) == BCType::ext_dir) ||
(bc.lo(2) == BCType::direction_dependent && wmac <= 0.0)) )
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
(bc.lo(2) == BCType::direction_dependent && wmac <= 0.0)) )
(bc.hi(2) == BCType::direction_dependent && wmac <= 0.0)) )

@asalmgren asalmgren marked this pull request as ready for review July 30, 2024 19:36
@asalmgren asalmgren requested a review from WeiqunZhang July 30, 2024 19:36
@@ -258,7 +259,7 @@ Godunov::ExtrapVelToFacesOnBox (Box const& bx, int ncomp,
}

const auto bc = HydroBC::getBC(i, j, k, n, domain, pbc, bc_arr);
HydroBC::SetYEdgeBCs(i, j, k, n, q, lo, hi, bc.lo(1), dlo.y, bc.hi(1), dhi.y, true);
HydroBC::SetYEdgeBCs(i, j, k, n, q, lo, hi, lo, hi, bc.lo(1), dlo.y, bc.hi(1), dhi.y, true);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be vad here instead of lo/hi?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

should it be uad/vad/wad here in this file instead of lo/hi or stl/sth?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Rplace stl/sth with uad/vad/wad?

@@ -774,7 +788,8 @@ void PredictStateOnYFace ( const int i, const int j, const int k, const int n,
amrex::Real sm, sp;
amrex::Tie(sm,sp) = Limiter::sm_sp(s0,sedge1,sedge2);

SetYBCs<Limiter>(i, j, k, n, sm, sp, sedge1, sedge2, S, bc.lo(1), bc.hi(1), domlo, domhi);
SetYBCs<Limiter>(i, j, k, n, sm, sp, sedge1, sedge2, S, vel_edge(i,j,k), vel_edge(i+1,j,k),
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

vel_edge(i,j+1,k) ?

@asalmgren asalmgren marked this pull request as draft July 31, 2024 20:16
@asalmgren asalmgren marked this pull request as ready for review August 6, 2024 15:08
@asalmgren asalmgren merged commit 186df80 into AMReX-Fluids:development Aug 8, 2024
14 checks passed
@asalmgren asalmgren deleted the add_direction_dependent_bcs branch August 8, 2024 15:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants