Skip to content

Commit ceb604e

Browse files
author
Menglong Zhao
committed
Add switches for removing cell crossing for a HFS 1D flux tube, similar to Tom's implementation on removing cell crossing for LFS 1D flux tube which has already been in the code. This enables producing a 1D full SOL (with both inner and outer target plates) with high resolution
1 parent e47115b commit ceb604e

File tree

2 files changed

+39
-3
lines changed

2 files changed

+39
-3
lines changed

Diff for: bbb/geometry.m

+33-3
Original file line numberDiff line numberDiff line change
@@ -786,7 +786,7 @@ call set_indirect_address(0)
786786

787787
c... For 1D poloidal flux-tube geometry (nysol=1), reset cell vertex
788788
c... locations near ix=ixpt2 on iy=1 surface if nxpt2msh or nxpt2psh > 1
789-
if (nxpt2msh+nxpt2psh > 0) call reset1dmeshpt
789+
if (nxpt2msh+nxpt2psh > 0 .or. nxpt1msh+nxpt1psh > 0) call reset1dmeshpt
790790

791791
* Define guard cells around the edge of the mesh --
792792
call guardc
@@ -2889,10 +2889,14 @@ real xn(0:nx+1,0:ny+1), xvn(0:nx+1,0:ny+1),
28892889
Use(Share) # nxomit,nxpt2msh,nxpt2psh,rxpt2msh,zxpt2psh
28902890

28912891
c... local scalars
2892-
integer ix,ix2
2892+
integer ix,ix2,ix1
28932893
real lenginc,theta
28942894

2895-
ix2 = nxomit+ixpt2(1) #consider outer flux-surface only
2895+
if (nxomit .ge. 0) then
2896+
ix2 = nxomit+ixpt2(1) #consider outer flux-surface only
2897+
else
2898+
ix2 = ixpt2(1)
2899+
endif
28962900

28972901
c... First fix iy=1 cell vertices above X-point (ixpt2)
28982902
theta = rxpt2msh/zxpt2msh #defines curvature of flux surface
@@ -2912,6 +2916,32 @@ real xn(0:nx+1,0:ny+1), xvn(0:nx+1,0:ny+1),
29122916
zm(ix+1,1,3) = zm(ix,1,4)
29132917
enddo
29142918

2919+
#.. Do the inner X-pt
2920+
#..
2921+
#..
2922+
if (nxomit .ge. 0) then
2923+
ix1 = nxomit+ixpt1(1)+1
2924+
else
2925+
ix1 = ixpt1(1)+1
2926+
endif
2927+
c... First fix iy=1 cell vertices above X-point (ixpt2)
2928+
theta = rxpt1msh/zxpt1msh #defines curvature of flux surface
2929+
do ix = ix1, ix1+nxpt1msh-1
2930+
rm(ix,1,4) = rm(ix,1,3)
2931+
zm(ix,1,4) = zm(ix,1,3) + zxpt1msh
2932+
rm(ix-1,1,3) = rm(ix,1,4)
2933+
zm(ix-1,1,3) = zm(ix,1,4)
2934+
enddo
2935+
2936+
c... Second, fix iy=1 cell vertices below X-point
2937+
theta = rxpt1psh/zxpt1psh #defines curvature of flux surface
2938+
do ix = ix1-1, ix1-nxpt1psh, -1
2939+
rm(ix,1,3) = rm(ix,1,4)
2940+
zm(ix,1,3) = zm(ix,1,4) - zxpt1psh
2941+
rm(ix+1,1,4) = rm(ix,1,3)
2942+
zm(ix+1,1,4) = zm(ix,1,3)
2943+
enddo
2944+
29152945
return
29162946
end
29172947
c*** End of subroutine reset1dmeshpt ****

Diff for: com/com.v

+6
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,12 @@ zxpt2msh real /0.01/ [m] # spacing iy=1 1D vertices reset above ixpt2
276276
rxpt2msh real /0.0/ [m] # spacing iy=1 1D vertices reset above ixpt2
277277
zxpt2psh real /0.01/ [m] # spacing iy=1 1D vertices reset below ixpt2
278278
rxpt2psh real /0.0/ [m] # spacing iy=1 1D vertices reset below ixpt2
279+
nxpt1msh integer /0/ # number of 1D cells above ixpt1 reset/no-cross
280+
nxpt1psh integer /0/ # number of 1D cells below ixpt1 reset/no-cross
281+
zxpt1msh real /0.01/ [m] # spacing iy=1 1D vertices reset above ixpt1
282+
rxpt1msh real /0.0/ [m] # spacing iy=1 1D vertices reset above ixpt1
283+
zxpt1psh real /0.01/ [m] # spacing iy=1 1D vertices reset below ixpt1
284+
rxpt1psh real /0.0/ [m] # spacing iy=1 1D vertices reset below ixpt1
279285
ismpsym integer /0/ +gridgen # =1 re-constructs "guard" cells at midplane
280286
# of "dnbot" via up/down symmetry
281287
isudsym integer /0/ +input #=1 up-down symmetric setup (only down part is modeled)

0 commit comments

Comments
 (0)