Skip to content

Commit

Permalink
Merge pull request #56 from ORNL-Fusion/AORSA_test
Browse files Browse the repository at this point in the history
Aorsa test
  • Loading branch information
mbeidler3 authored Nov 1, 2024
2 parents 4acbc34 + 2be6c3a commit a530576
Show file tree
Hide file tree
Showing 69 changed files with 1,442 additions and 1,041 deletions.
827 changes: 827 additions & 0 deletions Matlab_Analysis/KORC_postproc/plot_GC.m

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion ci_stub/onyx_job_test_cpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,5 +4,5 @@ env | grep JOB_COUNT

JOB_COUNT=1

cd ./KORC/build_cpu && ctest -j --output-on-failure
cd ./KORC/build_cpu && ctest --output-on-failure

11 changes: 9 additions & 2 deletions ci_stub/onyx_job_test_gpu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,8 @@ JOB_COUNT=1

pushd ./KORC/build_gpu >/dev/null

ctest -j --output-on-failure
ctest --output-on-failure
testexit=$?

pushd ./bin >/dev/null

Expand All @@ -19,6 +20,12 @@ for j in "mars_test" "egyro_test"; do
done
done


popd >/dev/null
popd >/dev/null

if [ $testexit -eq 0 ]
then
exit 0
else
exit 1
fi
1 change: 0 additions & 1 deletion src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@ target_sources(korc
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/korc_ppusher.f90>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/korc_HDF5.f90>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/korc_coords.f90>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/korc_hammersley_generator.f90>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/korc_profiles.f90>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/korc_types.f90>
$<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}/korc_avalanche.f90>
Expand Down
7 changes: 7 additions & 0 deletions src/korc_collisions.f90
Original file line number Diff line number Diff line change
Expand Up @@ -2443,6 +2443,13 @@ subroutine include_CoulombCollisions_GC_p(tt,params,random,Y_R,Y_PHI,Y_Z, &
CB_ei_SD(params,v(cc),ne(cc),Te(cc),Zeff(cc),P,Y_R(cc),Y_Z(cc)))
endif

!write(6,*) 'v,xi,Te,ne',v*C_C,xi,Te*params%cpp%temperature/C_E, &
! ne*params%cpp%density
!write(6,*) 'CAL',CAL/(params%cpp%time/(C_C*C_ME)**2)
!write(6,*) 'dCAL',dCAL/(sqrt(params%cpp%time)/(C_C*C_ME))
!write(6,*) 'CFL',CFL/(params%cpp%time/(C_C*C_ME))
!write(6,*) 'CBL',CBL/(params%cpp%time/(C_C*C_ME)**2)

if (.not.cparams_ss%slowing_down) CFL(cc)=0._rp
if (.not.cparams_ss%pitch_diffusion) CBL(cc)=0._rp
if (.not.cparams_ss%energy_diffusion) THEN
Expand Down
45 changes: 44 additions & 1 deletion src/korc_fields.f90
Original file line number Diff line number Diff line change
Expand Up @@ -911,6 +911,48 @@ subroutine uniform_fields_p(pchunk,F,B_X,B_Y,B_Z,E_X,E_Y,E_Z)

end subroutine uniform_fields_p

subroutine uniform_fields_GC_p(pchunk,F,B_X,B_Y,B_Z,E_X,E_Y,E_Z, &
curlb_R,curlb_PHI,curlb_Z,gradB_R,gradB_PHI,gradB_Z,PSIp)
INTEGER, INTENT(IN) :: pchunk
!! @note Subroutine that returns the value of a uniform magnetic
!! field. @endnote
!! This subroutine is used only when the simulation is ran for a
!! 'UNIFORM' plasma. As a convention, in a uniform plasma we
!! set \(\mathbf{B} = B_0 \hat{x}\).
TYPE(FIELDS), INTENT(IN) :: F
!! An instance of the KORC derived type FIELDS.
REAL(rp),DIMENSION(pchunk), INTENT(OUT) :: B_X,B_Y,B_Z
REAL(rp),DIMENSION(pchunk), INTENT(OUT) :: E_X,E_Y,E_Z
REAL(rp),DIMENSION(pchunk), INTENT(OUT) :: curlb_R,curlb_PHI,curlb_Z
REAL(rp),DIMENSION(pchunk), INTENT(OUT) :: gradB_R,gradB_PHI,gradB_Z,PSIp
!! Magnetic field components in Cartesian coordinates;
!! B(1,:) = \(B_x\), B(2,:) = \(B_y\), B(3,:) = \(B_z\)
integer(ip) :: cc

!$OMP SIMD
do cc=1_idef,pchunk
B_X(cc) = F%Bo
B_Y(cc) = 0._rp
B_Z(cc) = 0._rp

E_X(cc) = F%Eo
E_Y(cc) = 0._rp
E_Z(cc) = 0._rp

curlb_R(cc) = 0._rp
curlb_PHI(cc) = 0._rp
curlb_Z(cc) = 0._rp

gradB_R(cc) = 0._rp
gradB_PHI(cc) = 0._rp
gradB_Z(cc) = 0._rp

PSIp(cc) = 0._rp
end do
!$OMP END SIMD

end subroutine uniform_fields_GC_p

subroutine uniform_electric_field(F,E)
!! @note Subroutine that returns the value of a uniform electric
!! field. @endnote
Expand Down Expand Up @@ -1130,7 +1172,8 @@ subroutine unitVectors(params,Xo,F,b1,b2,b3,flag,cart,hint,Bo)
b2(ii,:)=b2tmp
b3(ii,:)=b3tmp

!write(6,*) 'unitvectors',ii,'B',vars%B(ii,:),'psi',vars%PSI_P(ii)
!write(6,*) 'unitvectors',ii,'B',vars%B(ii,:)*params%cpp%Bo,'psi',vars%PSI_P(ii)* &
! params%cpp%Bo*params%cpp%length**2

end do

Expand Down
5 changes: 5 additions & 0 deletions src/korc_finalize.f90
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,11 @@ subroutine deallocate_variables(params,F,P,spp)
DEALLOCATE(spp(ii)%vars%k3)
DEALLOCATE(spp(ii)%vars%k4)
DEALLOCATE(spp(ii)%vars%RHS)
DEALLOCATE(spp(ii)%vars%gradB)
DEALLOCATE(spp(ii)%vars%curlb)
DEALLOCATE(spp(ii)%vars%BR)
DEALLOCATE(spp(ii)%vars%BPHI)
DEALLOCATE(spp(ii)%vars%BZ)
end if

if (ALLOCATED(spp(ii)%BMC_ra)) DEALLOCATE(spp(ii)%BMC_ra)
Expand Down
Loading

0 comments on commit a530576

Please sign in to comment.