Skip to content

Commit

Permalink
Metal Advection Problem (#704)
Browse files Browse the repository at this point in the history
### Description
This is the version of the Metal Advection problem that compiles on
Setonix. It add four new files to the problem folder- test_sne.hpp/cpp,
an input file, and data set file containing parameters for various
Galactic environments.

### Related issues
N/A

### Checklist
_Before this pull request can be reviewed, all of these tasks should be
completed. Denote completed tasks with an `x` inside the square brackets
`[ ]` in the Markdown source below:_
- [ ] I have added a description (see above).
- [ ] I have added a link to any related issues see (see above).
- [ ] I have read the [Contributing
Guide](https://github.com/quokka-astro/quokka/blob/development/CONTRIBUTING.md).
- [ ] I have added tests for any new physics that this PR adds to the
code.
- [ ] I have tested this PR on my local computer and all tests pass.
- [ ] I have manually triggered the GPU tests with the magic comment
`/azp run`.
- [ ] I have requested a reviewer for this PR.

---------

Co-authored-by: Aditi Vijayan <[email protected]>
Co-authored-by: Aditi Vijayan <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ben Wibking <[email protected]>
Co-authored-by: Ben Wibking <[email protected]>
  • Loading branch information
6 people authored Aug 8, 2024
1 parent b2f3e2f commit 2c7f17d
Show file tree
Hide file tree
Showing 7 changed files with 853 additions and 0 deletions.
16 changes: 16 additions & 0 deletions regression/quokka-tests.ini
Original file line number Diff line number Diff line change
Expand Up @@ -123,3 +123,19 @@ doVis = 1
visVar = temperature
testSrcTree = .
ignore_return_code = 0

[MetalAdvectionProblem-GPU]
buildDir = .
target = test_sne
inputFile = tests/metal_problem_regression.in
link1File = extern/grackle_data_files/input/CloudyData_UVB=HM2012.h5
dim = 3
cmakeSetupOpts = -DAMReX_GPU_BACKEND=CUDA
restartTest = 0
useMPI = 1
numprocs = 1
compileTest = 0
doVis = 1
visVar = temperature
testSrcTree = .
ignore_return_code = 0
2 changes: 2 additions & 0 deletions src/problems/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -58,3 +58,5 @@ add_subdirectory(PopIII)
add_subdirectory(ShockCloud)
add_subdirectory(StarCluster)
add_subdirectory(SphericalCollapse)

add_subdirectory(MetalAdvectionProblem)
7 changes: 7 additions & 0 deletions src/problems/MetalAdvectionProblem/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
if (AMReX_SPACEDIM EQUAL 3)
add_executable(test_sne test_sne.cpp ${QuokkaObjSources})
if(AMReX_GPU_BACKEND MATCHES "CUDA")
setup_target_for_cuda_compilation(test_sne)
endif()

endif()
206 changes: 206 additions & 0 deletions src/problems/MetalAdvectionProblem/data_sets.dat
Original file line number Diff line number Diff line change
@@ -0,0 +1,206 @@
##----Values for R8 Model-------################

AMREX_GPU_MANAGED amrex::GpuArray<amrex::Real, 100> logphi_data{5.23749982, 5.83925514, 6.19098487, 6.44028658, 6.63341552,
6.79097415, 6.92395454, 7.03892608, 7.1401333 , 7.23047697,
7.31202697, 7.38631194, 7.45449324, 7.5174744 , 7.57597231,
7.63056519, 7.68172614, 7.72984716, 7.77525663, 7.81823237,
7.85901159, 7.89779849, 7.93477008, 7.9700808 , 8.00386622,
8.03624594, 8.06732603, 8.09720099, 8.12595536, 8.1536651 ,
8.18039866, 8.206218 , 8.23117933, 8.25533386, 8.2787285 ,
8.30140621, 8.32340645, 8.34476546, 8.36551667, 8.38569095,
8.40531688, 8.42442095, 8.44302778, 8.46116029, 8.47883984,
8.49608638, 8.51291857, 8.52935389, 8.54540873, 8.5610985 ,
8.57643767, 8.59143987, 8.60611797, 8.62048409, 8.6345497 ,
8.64832568, 8.66182248, 8.6750501 , 8.68801804, 8.70073526,
8.71321029, 8.72545119, 8.73746565, 8.74926096, 8.76084405,
8.77222155, 8.78339974, 8.79438465, 8.80518201, 8.81579732,
8.8262358 , 8.83650248, 8.84660217, 8.85653946, 8.86631876,
8.87594432, 8.88542019, 8.89475028, 8.90393833, 8.91298796,
8.92190263, 8.93068568, 8.93934034, 8.94786969, 8.95627673,
8.96456434, 8.97273531, 8.98079244, 8.98873851, 8.99657621,
9.00430812, 9.01193675, 9.01946449, 9.02689367, 9.03422652,
9.0414652 , 9.04861178, 9.0556683 , 9.06263668, 9.06951882};
AMREX_GPU_MANAGED amrex::GpuArray<amrex::Real, 100> logg_data{-9.85457856, -9.39107618, -9.19504351, -9.08451673, -9.01789453,
-8.9773358 , -8.95292764, -8.93860797, -8.93051793, -8.92611324,
-8.92379746, -8.92261559, -8.92202532, -8.92173815, -8.92160118,
-8.92153673, -8.92150669, -8.9214927 , -8.92148604, -8.92148266,
-8.92148075, -8.92147948, -8.92147848, -8.92147761, -8.9214768 ,
-8.92147602, -8.92147525, -8.9214745 , -8.92147377, -8.92147304,
-8.92147233, -8.92147163, -8.92147094, -8.92147026, -8.92146959,
-8.92146894, -8.92146829, -8.92146765, -8.92146703, -8.92146641,
-8.92146581, -8.92146521, -8.92146462, -8.92146405, -8.92146348,
-8.92146293, -8.92146238, -8.92146185, -8.92146132, -8.9214608 ,
-8.92146029, -8.92145979, -8.9214593 , -8.92145882, -8.92145835,
-8.92145789, -8.92145744, -8.92145699, -8.92145655, -8.92145612,
-8.92145569, -8.92145528, -8.92145487, -8.92145447, -8.92145407,
-8.92145369, -8.92145331, -8.92145294, -8.92145257, -8.92145221,
-8.92145186, -8.92145152, -8.92145118, -8.92145085, -8.92145052,
-8.9214502 , -8.92144989, -8.92144959, -8.92144929, -8.921449 ,
-8.92144871, -8.92144844, -8.92144816, -8.9214479 , -8.92144764,
-8.92144738, -8.92144713, -8.92144689, -8.92144665, -8.92144642,
-8.92144619, -8.92144596, -8.92144574, -8.92144553, -8.92144531,
-8.92144511, -8.9214449 , -8.9214447 , -8.92144451, -8.92144431
};
AMREX_GPU_MANAGED amrex::GpuArray<amrex::Real, 100> z_data{6.08467742e+19, 1.82540323e+20, 3.04233871e+20, 4.25927419e+20,
5.47620968e+20, 6.69314516e+20, 7.91008065e+20, 9.12701613e+20,
1.03439516e+21, 1.15608871e+21, 1.27778226e+21, 1.39947581e+21,
1.52116935e+21, 1.64286290e+21, 1.76455645e+21, 1.88625000e+21,
2.00794355e+21, 2.12963710e+21, 2.25133065e+21, 2.37302419e+21,
2.49471774e+21, 2.61641129e+21, 2.73810484e+21, 2.85979839e+21,
2.98149194e+21, 3.10318548e+21, 3.22487903e+21, 3.34657258e+21,
3.46826613e+21, 3.58995968e+21, 3.71165323e+21, 3.83334677e+21,
3.95504032e+21, 4.07673387e+21, 4.19842742e+21, 4.32012097e+21,
4.44181452e+21, 4.56350806e+21, 4.68520161e+21, 4.80689516e+21,
4.92858871e+21, 5.05028226e+21, 5.17197581e+21, 5.29366935e+21,
5.41536290e+21, 5.53705645e+21, 5.65875000e+21, 5.78044355e+21,
5.90213710e+21, 6.02383065e+21, 6.14552419e+21, 6.26721774e+21,
6.38891129e+21, 6.51060484e+21, 6.63229839e+21, 6.75399194e+21,
6.87568548e+21, 6.99737903e+21, 7.11907258e+21, 7.24076613e+21,
7.36245968e+21, 7.48415323e+21, 7.60584677e+21, 7.72754032e+21,
7.84923387e+21, 7.97092742e+21, 8.09262097e+21, 8.21431452e+21,
8.33600806e+21, 8.45770161e+21, 8.57939516e+21, 8.70108871e+21,
8.82278226e+21, 8.94447581e+21, 9.06616935e+21, 9.18786290e+21,
9.30955645e+21, 9.43125000e+21, 9.55294355e+21, 9.67463710e+21,
9.79633065e+21, 9.91802419e+21, 1.00397177e+22, 1.01614113e+22,
1.02831048e+22, 1.04047984e+22, 1.05264919e+22, 1.06481855e+22,
1.07698790e+22, 1.08915726e+22, 1.10132661e+22, 1.11349597e+22,
1.12566532e+22, 1.13783468e+22, 1.15000403e+22, 1.16217339e+22,
1.17434274e+22, 1.18651210e+22, 1.19868145e+22, 1.21085081e+22
};


AMREX_GPU_MANAGED Real z_star = 245.0 * pc;
AMREX_GPU_MANAGED Real Sigma_star = 42.0 * Msun/pc/pc;
AMREX_GPU_MANAGED Real rho_dm = 0.0064 * Msun/pc/pc/pc;
AMREX_GPU_MANAGED Real R0 = 8.e3 * pc;
AMREX_GPU_MANAGED Real ks_sigma_sfr = 2.088579882548443e-55;
AMREX_GPU_MANAGED Real hscale= 150. * pc;
AMREX_GPU_MANAGED Real sigma1 = 700000.0;
AMREX_GPU_MANAGED Real sigma2 = 7000000.0;
AMREX_GPU_MANAGED Real rho01 = 2.78556e-24;
AMREX_GPU_MANAGED Real rho02 = 2.7855600000000006e-29;;


################----------------------##################################

################-----------Values for R16-----------##################################

AMREX_GPU_MANAGED amrex::GpuArray<amrex::Real, 64> logphi_data{0.83638381, 4.50705067, 5.10271383, 5.45268878, 5.70140736,
5.89447928, 6.05229308, 6.1857468 , 6.30135334, 6.40331919,
6.49451684, 6.57699822, 6.65227803, 6.72150811, 6.78558362,
6.84521466, 6.90097381, 6.95332936, 7.00266958, 7.04931937,
7.09355406, 7.1356083 , 7.17568429, 7.21395706, 7.25057937,
7.28568514, 7.31939257, 7.35180662, 7.38302073, 7.41311872,
7.44217572, 7.47025967, 7.49743193, 7.52374829, 7.54925951,
7.57401195, 7.5980481 , 7.62140688, 7.64412421, 7.66623309,
7.68776413, 7.70874559, 7.72920373, 7.74916295, 7.76864596,
7.78767394, 7.80626666, 7.82444266, 7.84221924, 7.85961268,
7.87663823, 7.89331028, 7.90964238, 7.92564731, 7.94133718,
7.95672339, 7.9718168 , 7.98662762, 8.00116561, 8.01543998,
8.02945951, 8.04323254, 8.056767 , 8.07007045};
AMREX_GPU_MANAGED amrex::GpuArray<amrex::Real, 64> logg_data{-11.24587667, -10.68390187, -10.45405356, -10.31158848,
-10.21082455, -10.13474898, -10.0750678 , -10.02714739,
-9.98806155, -9.95589857, -9.92931504, -9.90722171,
-9.88888792, -9.87375864, -9.86122421, -9.85088355,
-9.84247276, -9.83565399, -9.83007266, -9.8256095 ,
-9.82214665, -9.81939435, -9.81722964, -9.81559821,
-9.81433642, -9.8133616 , -9.81265555, -9.81214602,
-9.81177066, -9.81149643, -9.81129813, -9.81115635,
-9.8110556 , -9.81098525, -9.81093618, -9.81090247,
-9.81087945, -9.81086374, -9.81085319, -9.81084604,
-9.8108412 , -9.81083792, -9.81083566, -9.81083407,
-9.81083293, -9.81083206, -9.81083139, -9.81083083,
-9.81083035, -9.81082991, -9.81082951, -9.81082913,
-9.81082876, -9.8108284 , -9.81082804, -9.81082769,
-9.81082735, -9.810827 , -9.81082666, -9.81082632,
-9.81082599, -9.81082565, -9.81082532, -9.81082499
};
AMREX_GPU_MANAGED amrex::GpuArray<amrex::Real, 64> z_data{1.50900000e+20, 5.55695238e+20, 9.60490476e+20, 1.36528571e+21,
1.77008095e+21, 2.17487619e+21, 2.57967143e+21, 2.98446667e+21,
3.38926190e+21, 3.79405714e+21, 4.19885238e+21, 4.60364762e+21,
5.00844286e+21, 5.41323810e+21, 5.81803333e+21, 6.22282857e+21,
6.62762381e+21, 7.03241905e+21, 7.43721429e+21, 7.84200952e+21,
8.24680476e+21, 8.65160000e+21, 9.05639524e+21, 9.46119048e+21,
9.86598571e+21, 1.02707810e+22, 1.06755762e+22, 1.10803714e+22,
1.14851667e+22, 1.18899619e+22, 1.22947571e+22, 1.26995524e+22,
1.31043476e+22, 1.35091429e+22, 1.39139381e+22, 1.43187333e+22,
1.47235286e+22, 1.51283238e+22, 1.55331190e+22, 1.59379143e+22,
1.63427095e+22, 1.67475048e+22, 1.71523000e+22, 1.75570952e+22,
1.79618905e+22, 1.83666857e+22, 1.87714810e+22, 1.91762762e+22,
1.95810714e+22, 1.99858667e+22, 2.03906619e+22, 2.07954571e+22,
2.12002524e+22, 2.16050476e+22, 2.20098429e+22, 2.24146381e+22,
2.28194333e+22, 2.32242286e+22, 2.36290238e+22, 2.40338190e+22,
2.44386143e+22, 2.48434095e+22, 2.52482048e+22, 2.56530000e+22
};


AMREX_GPU_MANAGED Real z_star = 245.0 * pc;
AMREX_GPU_MANAGED Real Sigma_star = 1.71 * Msun/pc/pc;
AMREX_GPU_MANAGED Real rho_dm = 1.4e-3 * Msun/pc/pc/pc;
AMREX_GPU_MANAGED Real R0 = 16.e3 * pc;
AMREX_GPU_MANAGED Real ks_sigma_sfr = 5.499927024044233e-57;
AMREX_GPU_MANAGED Real hscale= 150. * pc;
AMREX_GPU_MANAGED Real sigma1 = 11.* kmps;
AMREX_GPU_MANAGED Real sigma2 = 10. * 11.* kmps;
AMREX_GPU_MANAGED Real rho01 = 0.0268988*Const_mH;
AMREX_GPU_MANAGED Real rho02 = 1.e-5 * 0.0268988*Const_mH;;


#############----Values for R4 Model-------################

AMREX_GPU_MANAGED amrex::GpuArray<amrex::Real, 64> logphi_data{3.24975864, 6.27954616, 6.8675804 , 7.2142687 , 7.46059677,
7.65149496, 7.80718072, 7.93849124, 8.05191629, 8.15165531,
8.24058664, 8.32076511, 8.3937092 , 8.46057409, 8.52225965,
8.57947934, 8.63280826, 8.682718 , 8.72959937, 8.77377954,
8.81553494, 8.85510245, 8.89268623, 8.92846337, 8.96258787,
8.99519552, 9.02640573, 9.05632431, 9.0850453 , 9.1126533 ,
9.13922402, 9.16482567, 9.18951991, 9.21336297, 9.23640588,
9.25869529, 9.28027478, 9.30118469, 9.32146184, 9.34113998,
9.36025027, 9.37882149, 9.39688021, 9.41445096, 9.43155666,
9.44821863, 9.46445669, 9.48028925, 9.49573374, 9.51080637,
9.52552235, 9.53989592, 9.55394059, 9.56766904, 9.58109321,
9.59422433, 9.60707313, 9.61964974, 9.63196405, 9.64402569,
9.6558438 , 9.66742698, 9.67878337, 9.6899207};
AMREX_GPU_MANAGED amrex::GpuArray<amrex::Real, 64> logg_data{-8.84486253, -8.53977369, -8.41945731, -8.36855149, -8.34812648,
-8.34077673, -8.33835551, -8.33764733, -8.33744008, -8.33738188,
-8.3373655 , -8.33736028, -8.33735794, -8.33735633, -8.33735492,
-8.33735358, -8.33735228, -8.33735101, -8.33734977, -8.33734856,
-8.33734737, -8.33734622, -8.33734509, -8.33734399, -8.33734291,
-8.33734186, -8.33734084, -8.33733984, -8.33733887, -8.33733792,
-8.337337 , -8.33733609, -8.33733522, -8.33733436, -8.33733353,
-8.33733272, -8.33733193, -8.33733115, -8.3373304 , -8.33732966,
-8.33732894, -8.33732824, -8.33732756, -8.33732689, -8.33732625,
-8.33732561, -8.337325 , -8.3373244 , -8.33732382, -8.33732326,
-8.33732271, -8.33732217, -8.33732165, -8.33732115, -8.33732066,
-8.33732019, -8.33731973, -8.33731928, -8.33731885, -8.33731843,
-8.33731801, -8.33731761, -8.33731722, -8.33731684
};
AMREX_GPU_MANAGED amrex::GpuArray<amrex::Real, 64> z_data{1.50900000e+20, 3.40123810e+20, 5.29347619e+20, 7.18571429e+20,
9.07795238e+20, 1.09701905e+21, 1.28624286e+21, 1.47546667e+21,
1.66469048e+21, 1.85391429e+21, 2.04313810e+21, 2.23236190e+21,
2.42158571e+21, 2.61080952e+21, 2.80003333e+21, 2.98925714e+21,
3.17848095e+21, 3.36770476e+21, 3.55692857e+21, 3.74615238e+21,
3.93537619e+21, 4.12460000e+21, 4.31382381e+21, 4.50304762e+21,
4.69227143e+21, 4.88149524e+21, 5.07071905e+21, 5.25994286e+21,
5.44916667e+21, 5.63839048e+21, 5.82761429e+21, 6.01683810e+21,
6.20606190e+21, 6.39528571e+21, 6.58450952e+21, 6.77373333e+21,
6.96295714e+21, 7.15218095e+21, 7.34140476e+21, 7.53062857e+21,
7.71985238e+21, 7.90907619e+21, 8.09830000e+21, 8.28752381e+21,
8.47674762e+21, 8.66597143e+21, 8.85519524e+21, 9.04441905e+21,
9.23364286e+21, 9.42286667e+21, 9.61209048e+21, 9.80131429e+21,
9.99053810e+21, 1.01797619e+22, 1.03689857e+22, 1.05582095e+22,
1.07474333e+22, 1.09366571e+22, 1.11258810e+22, 1.13151048e+22,
1.15043286e+22, 1.16935524e+22, 1.18827762e+22, 1.20720000e+22
};


AMREX_GPU_MANAGED Real z_star = 245.0 * pc;
AMREX_GPU_MANAGED Real Sigma_star = 208 * Msun/pc/pc;
AMREX_GPU_MANAGED Real rho_dm = 2.4e-2 * Msun/pc/pc/pc;
AMREX_GPU_MANAGED Real R0 = 4.e3 * pc;
AMREX_GPU_MANAGED Real ks_sigma_sfr = 1.3857971188361884e-54;
AMREX_GPU_MANAGED Real hscale= 150. * pc;
AMREX_GPU_MANAGED Real sigma1 = 7.* kmps;
AMREX_GPU_MANAGED Real sigma2 = 10. * 7.* kmps;
AMREX_GPU_MANAGED Real rho01 =1.668*Const_mH;
AMREX_GPU_MANAGED Real rho02 = 1.e-5 * 1.668*Const_mH;;
Loading

0 comments on commit 2c7f17d

Please sign in to comment.