-
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
Open
fluidnumerics-joe
wants to merge
4
commits into
v0.1.0-dev
Choose a base branch
from
feature/111-inflow-outflow-bcs
base: v0.1.0-dev
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
0eb5cd8
Draft compressible ideal gas LES 3D solver
fluidnumerics-joe 058f807
Add inflow,outflow,and no slip boundary condition flags and generic m…
fluidnumerics-joe 5f9231b
Call parent class method in Set*BoundaryCondition on GPU side
fluidnumerics-joe 5293d3f
Fix build issues with incorrect rank for solutiongradient
fluidnumerics-joe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -479,6 +479,33 @@ | |||||
this%hbc2d_NoNormalFlow(this%solution%boundary(i,j,iEl,1:this%nvar),nhat) | ||||||
enddo | ||||||
|
||||||
elseif(bcid == SELF_BC_INFLOW) then | ||||||
|
||||||
do i = 1,this%solution%interp%N+1 ! Loop over quadrature points | ||||||
nhat = this%geometry%nhat%boundary(i,j,iEl,1,1:2) | ||||||
|
||||||
this%solution%extBoundary(i,j,iEl,1:this%nvar) = & | ||||||
this%hbc2d_Inflow(this%solution%boundary(i,j,iEl,1:this%nvar),nhat) | ||||||
enddo | ||||||
|
||||||
elseif(bcid == SELF_BC_OUTFLOW) then | ||||||
|
||||||
do i = 1,this%solution%interp%N+1 ! Loop over quadrature points | ||||||
nhat = this%geometry%nhat%boundary(i,j,iEl,1,1:2) | ||||||
|
||||||
this%solution%extBoundary(i,j,iEl,1:this%nvar) = & | ||||||
this%hbc2d_Outflow(this%solution%boundary(i,j,iEl,1:this%nvar),nhat) | ||||||
enddo | ||||||
|
||||||
elseif(bcid == SELF_BC_NOSLIP) then | ||||||
|
||||||
do i = 1,this%solution%interp%N+1 ! Loop over quadrature points | ||||||
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) | ||||||
enddo | ||||||
|
||||||
endif | ||||||
endif | ||||||
|
||||||
|
@@ -534,6 +561,33 @@ | |||||
this%pbc2d_NoNormalFlow(dsdx,nhat) | ||||||
enddo | ||||||
|
||||||
elseif(bcid == SELF_BC_INFLOW) then | ||||||
|
||||||
do i = 1,this%solution%interp%N+1 ! Loop over quadrature points | ||||||
nhat = this%geometry%nhat%boundary(i,j,iEl,1,1:2) | ||||||
|
||||||
this%solutiongradient%extBoundary(i,j,iEl,1:this%nvar,1:2) = & | ||||||
this%pbc2d_Inflow(this%solution%boundary(i,j,iEl,1:this%nvar),nhat) | ||||||
enddo | ||||||
|
||||||
elseif(bcid == SELF_BC_OUTFLOW) then | ||||||
|
||||||
do i = 1,this%solution%interp%N+1 ! Loop over quadrature points | ||||||
nhat = this%geometry%nhat%boundary(i,j,iEl,1,1:2) | ||||||
|
||||||
this%solutiongradient%extBoundary(i,j,iEl,1:this%nvar,1:2) = & | ||||||
this%pbc2d_Outflow(this%solution%boundary(i,j,iEl,1:this%nvar),nhat) | ||||||
enddo | ||||||
|
||||||
elseif(bcid == SELF_BC_NOSLIP) then | ||||||
|
||||||
do i = 1,this%solution%interp%N+1 ! Loop over quadrature points | ||||||
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 commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
enddo | ||||||
|
||||||
endif | ||||||
endif | ||||||
|
||||||
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
! //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ! | ||
! | ||
! Maintainers : support@fluidnumerics.com | ||
! Official Repository : https://github.com/FluidNumerics/self/ | ||
! | ||
! Copyright © 2024 Fluid Numerics LLC | ||
! | ||
! Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
! | ||
! 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
! | ||
! 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in | ||
! the documentation and/or other materials provided with the distribution. | ||
! | ||
! 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from | ||
! this software without specific prior written permission. | ||
! | ||
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
! HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
! LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
! THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
! THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
! | ||
! //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ! | ||
|
||
module self_CIGLES3D | ||
|
||
use self_CIGLES3D_t | ||
|
||
implicit none | ||
|
||
type,extends(CIGLES3D_t) :: CIGLES3D | ||
endtype CIGLES3D | ||
|
||
endmodule self_CIGLES3D | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,151 @@ | ||
! //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ! | ||
! | ||
! Maintainers : support@fluidnumerics.com | ||
! Official Repository : https://github.com/FluidNumerics/self/ | ||
! | ||
! Copyright © 2024 Fluid Numerics LLC | ||
! | ||
! Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: | ||
! | ||
! 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. | ||
! | ||
! 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in | ||
! the documentation and/or other materials provided with the distribution. | ||
! | ||
! 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from | ||
! this software without specific prior written permission. | ||
! | ||
! THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS “AS IS” AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT | ||
! LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT | ||
! HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT | ||
! LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY | ||
! THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF | ||
! THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. | ||
! | ||
! //////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////////// ! | ||
|
||
module self_CIGLES3D | ||
|
||
use self_CIGLES3D_t | ||
|
||
implicit none | ||
|
||
type,extends(CIGLES3D_t) :: CIGLES3D | ||
contains | ||
! procedure :: setboundarycondition => setboundarycondition_CIGLES3D | ||
! procedure :: boundaryflux => boundaryflux_CIGLES3D | ||
! procedure :: fluxmethod => fluxmethod_CIGLES3D | ||
|
||
endtype CIGLES3D | ||
|
||
! interface | ||
! subroutine setboundarycondition_CIGLES3D_gpu(extboundary,boundary,sideinfo,nhat,N,nel) & | ||
! bind(c,name="setboundarycondition_CIGLES3D_gpu") | ||
! use iso_c_binding | ||
! type(c_ptr),value :: extboundary,boundary,sideinfo,nhat | ||
! integer(c_int),value :: N,nel | ||
! endsubroutine setboundarycondition_CIGLES3D_gpu | ||
! endinterface | ||
|
||
! interface | ||
! subroutine fluxmethod_CIGLES3D_gpu(solution,flux,rho0,c,N,nel,nvar) & | ||
! bind(c,name="fluxmethod_CIGLES3D_gpu") | ||
! use iso_c_binding | ||
! use SELF_Constants | ||
! type(c_ptr),value :: solution,flux | ||
! real(c_prec),value :: rho0,c | ||
! integer(c_int),value :: N,nel,nvar | ||
! endsubroutine fluxmethod_CIGLES3D_gpu | ||
! endinterface | ||
|
||
! interface | ||
! subroutine boundaryflux_CIGLES3D_gpu(fb,fextb,nhat,nscale,flux,rho0,c,N,nel) & | ||
! bind(c,name="boundaryflux_CIGLES3D_gpu") | ||
! use iso_c_binding | ||
! use SELF_Constants | ||
! type(c_ptr),value :: fb,fextb,flux,nhat,nscale | ||
! real(c_prec),value :: rho0,c | ||
! integer(c_int),value :: N,nel | ||
! endsubroutine boundaryflux_CIGLES3D_gpu | ||
! endinterface | ||
|
||
contains | ||
|
||
! subroutine boundaryflux_CIGLES3D(this) | ||
! implicit none | ||
! class(CIGLES3D),intent(inout) :: this | ||
|
||
! call boundaryflux_CIGLES3D_gpu(this%solution%boundary_gpu, & | ||
! this%solution%extBoundary_gpu, & | ||
! this%geometry%nhat%boundary_gpu, & | ||
! this%geometry%nscale%boundary_gpu, & | ||
! this%flux%boundarynormal_gpu, & | ||
! this%rho0,this%c,this%solution%interp%N, & | ||
! this%solution%nelem) | ||
|
||
! endsubroutine boundaryflux_CIGLES3D | ||
|
||
! subroutine fluxmethod_CIGLES3D(this) | ||
! implicit none | ||
! class(CIGLES3D),intent(inout) :: this | ||
|
||
! call fluxmethod_CIGLES3D_gpu(this%solution%interior_gpu, & | ||
! this%flux%interior_gpu, & | ||
! this%rho0,this%c,this%solution%interp%N,this%solution%nelem, & | ||
! this%solution%nvar) | ||
|
||
! endsubroutine fluxmethod_CIGLES3D | ||
|
||
! subroutine setboundarycondition_CIGLES3D(this) | ||
! !! Boundary conditions are set to periodic boundary conditions | ||
! implicit none | ||
! class(CIGLES3D),intent(inout) :: this | ||
! ! local | ||
! integer :: i,iEl,j,k,e2,bcid | ||
! real(prec) :: x(1:3) | ||
|
||
! if(this%prescribed_bcs_enabled) then | ||
! call gpuCheck(hipMemcpy(c_loc(this%solution%extboundary), & | ||
! this%solution%extboundary_gpu,sizeof(this%solution%extboundary), & | ||
! hipMemcpyDeviceToHost)) | ||
|
||
! ! Prescribed boundaries are still done on the CPU | ||
! do iEl = 1,this%solution%nElem ! Loop over all elements | ||
! do k = 1,6 ! Loop over all sides | ||
|
||
! bcid = this%mesh%sideInfo(5,j,iEl) ! Boundary Condition ID | ||
! e2 = this%mesh%sideInfo(3,j,iEl) ! Neighboring Element ID | ||
|
||
! if(e2 == 0) then | ||
! if(bcid == SELF_BC_PRESCRIBED) then | ||
|
||
! do j = 1,this%solution%interp%N+1 ! Loop over quadrature points | ||
! do i = 1,this%solution%interp%N+1 ! Loop over quadrature points | ||
! x = this%geometry%x%boundary(i,j,k,iEl,1,1:3) | ||
|
||
! this%solution%extBoundary(i,j,k,iEl,1:this%nvar) = & | ||
! this%hbc3D_Prescribed(x,this%t) | ||
! enddo | ||
! enddo | ||
|
||
! endif | ||
! endif | ||
|
||
! enddo | ||
! enddo | ||
|
||
! call gpuCheck(hipMemcpy(this%solution%extBoundary_gpu, & | ||
! c_loc(this%solution%extBoundary), & | ||
! sizeof(this%solution%extBoundary), & | ||
! hipMemcpyHostToDevice)) | ||
! endif | ||
! call setboundarycondition_CIGLES3D_gpu(this%solution%extboundary_gpu, & | ||
! this%solution%boundary_gpu, & | ||
! this%mesh%sideInfo_gpu, & | ||
! this%geometry%nhat%boundary_gpu, & | ||
! this%solution%interp%N, & | ||
! this%solution%nelem) | ||
|
||
! endsubroutine setboundarycondition_CIGLES3D | ||
|
||
endmodule self_CIGLES3D |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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