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

Fix duct output. #104

Merged
merged 2 commits into from
Dec 19, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/main.f90
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ program cans
call initgrid(gtype,ng(3),gr,l(3),dzc_g,dzf_g,zc_g,zf_g)
if(myid == 0) then
open(99,file=trim(datadir)//'grid.bin',access='stream')
write(99,rec=1) dzc_g(1:ng(3)),dzf_g(1:ng(3)),zc_g(1:ng(3)),zf_g(1:ng(3))
write(99) dzc_g(1:ng(3)),dzf_g(1:ng(3)),zc_g(1:ng(3)),zf_g(1:ng(3))
close(99)
open(99,file=trim(datadir)//'grid.out')
do kk=0,ng(3)+1
Expand Down
32 changes: 16 additions & 16 deletions src/output.f90
Original file line number Diff line number Diff line change
Expand Up @@ -430,14 +430,14 @@ subroutine out2d_duct(fname,ng,lo,hi,idir,l,dl,z_g,u,v,w) ! e.g. for a duct
call MPI_ALLREDUCE(MPI_IN_PLACE,w2(1,1),ng(1)*ng(3),MPI_REAL_RP,MPI_SUM,MPI_COMM_WORLD,ierr)
call MPI_ALLREDUCE(MPI_IN_PLACE,vw(1,1),ng(1)*ng(3),MPI_REAL_RP,MPI_SUM,MPI_COMM_WORLD,ierr)
call MPI_ALLREDUCE(MPI_IN_PLACE,uv(1,1),ng(1)*ng(3),MPI_REAL_RP,MPI_SUM,MPI_COMM_WORLD,ierr)
um(:,:) = um(:,:)*grid_area_ratio
vm(:,:) = vm(:,:)*grid_area_ratio
wm(:,:) = wm(:,:)*grid_area_ratio
u2(:,:) = sqrt(u2(:,:)*grid_area_ratio - um(:,:)**2)
v2(:,:) = sqrt(v2(:,:)*grid_area_ratio - vm(:,:)**2)
w2(:,:) = sqrt(w2(:,:)*grid_area_ratio - wm(:,:)**2)
vw(:,:) = vw(:,:)*grid_area_ratio - vm(:,:)*wm(:,:)
uv(:,:) = uv(:,:)*grid_area_ratio - um(:,:)*vm(:,:)
um(:,:) = um(:,:)*grid_area_ratio
vm(:,:) = vm(:,:)*grid_area_ratio
wm(:,:) = wm(:,:)*grid_area_ratio
u2(:,:) = u2(:,:)*grid_area_ratio - um(:,:)**2
v2(:,:) = v2(:,:)*grid_area_ratio - vm(:,:)**2
w2(:,:) = w2(:,:)*grid_area_ratio - wm(:,:)**2
vw(:,:) = vw(:,:)*grid_area_ratio - vm(:,:)*wm(:,:)
uv(:,:) = uv(:,:)*grid_area_ratio - um(:,:)*vm(:,:)
if(myid == 0) then
open(newunit=iunit,file=fname)
do k=1,ng(3)
Expand Down Expand Up @@ -488,14 +488,14 @@ subroutine out2d_duct(fname,ng,lo,hi,idir,l,dl,z_g,u,v,w) ! e.g. for a duct
call MPI_ALLREDUCE(MPI_IN_PLACE,w2(1,1),ng(1)*ng(3),MPI_REAL_RP,MPI_SUM,MPI_COMM_WORLD,ierr)
call MPI_ALLREDUCE(MPI_IN_PLACE,uv(1,1),ng(1)*ng(3),MPI_REAL_RP,MPI_SUM,MPI_COMM_WORLD,ierr)
call MPI_ALLREDUCE(MPI_IN_PLACE,uw(1,1),ng(1)*ng(3),MPI_REAL_RP,MPI_SUM,MPI_COMM_WORLD,ierr)
um(:,:) = um(:,:)*grid_area_ratio
vm(:,:) = vm(:,:)*grid_area_ratio
wm(:,:) = wm(:,:)*grid_area_ratio
u2(:,:) = sqrt(u2(:,:)*grid_area_ratio - um(:,:)**2)
v2(:,:) = sqrt(v2(:,:)*grid_area_ratio - vm(:,:)**2)
w2(:,:) = sqrt(w2(:,:)*grid_area_ratio - wm(:,:)**2)
uv(:,:) = uv(:,:)*grid_area_ratio - um(:,:)*vm(:,:)
uw(:,:) = uw(:,:)*grid_area_ratio - um(:,:)*wm(:,:)
um(:,:) = um(:,:)*grid_area_ratio
vm(:,:) = vm(:,:)*grid_area_ratio
wm(:,:) = wm(:,:)*grid_area_ratio
u2(:,:) = u2(:,:)*grid_area_ratio - um(:,:)**2
v2(:,:) = v2(:,:)*grid_area_ratio - vm(:,:)**2
w2(:,:) = w2(:,:)*grid_area_ratio - wm(:,:)**2
uv(:,:) = uv(:,:)*grid_area_ratio - um(:,:)*vm(:,:)
uw(:,:) = uw(:,:)*grid_area_ratio - um(:,:)*wm(:,:)
if(myid == 0) then
open(newunit=iunit,file=fname)
do k=1,ng(3)
Expand Down
Loading