-
Notifications
You must be signed in to change notification settings - Fork 11
Feature/111 inflow outflow bcs #112
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
base: v0.1.0-dev
Are you sure you want to change the base?
Conversation
Codecov ReportAttention: Patch coverage is
📢 Thoughts on this report? Let us know! |
This reduces the amount of duplicate code for default gpu backend
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It would make sense to add some simple tests for each of the new BCs in 2D and 3D to satisfy codecov.
This would likely be under a new PR, but with the variety of BCs available it could be useful to add a dedicated "Boundary Conditions" page under "Mesh Generation" in the docs.
!! | ||
!! \begin{equation} | ||
!! \overleftrightarrow{f} = \begin{pmatrix} | ||
!! \rho u \hat{x} + \rho v \hat{y} + \rho w \hat{z} \\ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Consistent spacing
!! \rho u \hat{x} + \rho v \hat{y} + \rho w \hat{z} \\ | |
!! \rho u \hat{x} + \rho v \hat{y} + \rho w \hat{z} \\ |
integer :: ndiagnostics | ||
|
||
! Model parameters | ||
real(prec) :: p0 = 10.0_prec**(5) ! Reference pressure for potential temperature () |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Do you want Pascal as the unit here?
real(prec) :: p0 = 10.0_prec**(5) ! Reference pressure for potential temperature () | |
real(prec) :: p0 = 10.0_prec**(5) ! Reference pressure for potential temperature (Pa) |
nhat = this%geometry%nhat%boundary(i,j,iEl,1,1:2) | ||
|
||
this%solution%extBoundary(i,j,iEl,1:this%nvar) = & | ||
this%hbc2d_noslip(this%solution%boundary(i,j,iEl,1:this%nvar),nhat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Capitalize for consistency
this%hbc2d_noslip(this%solution%boundary(i,j,iEl,1:this%nvar),nhat) | |
this%hbc2d_NoSlip(this%solution%boundary(i,j,iEl,1:this%nvar),nhat) |
nhat = this%geometry%nhat%boundary(i,j,iEl,1,1:2) | ||
|
||
this%solutiongradient%extBoundary(i,j,iEl,1:this%nvar,1:2) = & | ||
this%pbc2d_noslip(this%solution%boundary(i,j,iEl,1:this%nvar),nhat) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this%pbc2d_noslip(this%solution%boundary(i,j,iEl,1:this%nvar),nhat) | |
this%pbc2d_NoSlip(this%solution%boundary(i,j,iEl,1:this%nvar),nhat) |
While I agree with this, I've been thinking on this issue of the ever growing number of potential boundary conditions. What I'd propose is a new module with a class defined for mapping boundary conditions to procedure pointers. This class would be something like type SELF_BoundaryCondition
procedure(SELF_BCFunction),pointer :: bcfunction
integer :: bcflag_id
character(len=SELF_BCNAME_LENGTH) :: bcflag_name We could set such a class up as a linked list which could allow for dynamic insertion of boundary conditions on the fly.. Having methods like do concurrent(j=1:4,iel=1:this%mesh%nElem)
bcid = this%mesh%sideInfo(5,j,iEl) ! Boundary Condition ID
e2 = this%mesh%sideInfo(3,j,iEl) ! Neighboring Element ID
if(e2 == 0) then
! Get a function pointer for the boundary condition id
bfunc = this%boundaryconditions%GetBCFunc_for_id( bcid )
do i = 1,this%solution%interp%N+1 ! Loop over quadrature points
x = this%geometry%x%boundary(i,j,iEl,1,1:2)
this%solution%extBoundary(i,j,iEl,1:this%nvar) = bcfunc(x,this%t)
endif
enddo |
This PR adds inflow and outflow boundary condition integer parameters and overridable type bound procedures in the template model classes for 2D and 3D models.
Resolves #111