Skip to content

Commit

Permalink
Absorb athena updates (#117)
Browse files Browse the repository at this point in the history
- Athena upstream adds chemistry, lots of changes involved
- Fully absorbed the changes
- Mac does not pass because of the firewall. Will Fix later.
  • Loading branch information
chengcli authored Jan 18, 2024
1 parent 980d56b commit 10e81c6
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 21 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -347,7 +347,7 @@ jobs:

- name: combile outputs
working-directory: ${{github.workspace}}/build/bin
run: ./combine.py -o test
run: python3 combine.py -o test

- name: compare result
run: >
Expand Down Expand Up @@ -400,7 +400,7 @@ jobs:

- name: combile outputs
working-directory: ${{github.workspace}}/build/bin
run: ./combine.py -o test
run: python3 combine.py -o test

- name: compare result
run: >
Expand Down Expand Up @@ -453,7 +453,7 @@ jobs:

- name: combile outputs
working-directory: ${{github.workspace}}/build/bin
run: ./combine.py -o test
run: python3 combine.py -o test

- name: compare result
run: >
Expand Down Expand Up @@ -504,7 +504,7 @@ jobs:

- name: combile outputs
working-directory: ${{github.workspace}}/build/bin
run: ./combine.py -o test
run: python3 combine.py -o test

- name: compare result
run: >
Expand Down Expand Up @@ -555,7 +555,7 @@ jobs:

- name: combile outputs
working-directory: ${{github.workspace}}/build/bin
run: ./combine.py -o test
run: python3 combine.py -o test

- name: compare result
run: >
Expand Down Expand Up @@ -608,7 +608,7 @@ jobs:

- name: combile outputs
working-directory: ${{github.workspace}}/build/bin
run: ./combine.py -o test
run: python3 combine.py -o test

- name: compare result
run: >
Expand Down Expand Up @@ -654,7 +654,7 @@ jobs:

- name: combile outputs
working-directory: ${{github.workspace}}/build/bin
run: ./combine.py -o test
run: python3 combine.py -o test

- name: Test
working-directory: ${{github.workspace}}/examples/2023-jupiter-mwr-eq
Expand Down
1 change: 0 additions & 1 deletion Brewfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
tap "homebrew/bundle"
tap "homebrew/core"
brew "cfitsio"
brew "ctags"
brew "hdf5"
Expand Down
2 changes: 1 addition & 1 deletion examples/2024-XZhang-cloud-rt/hywater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ void MeshBlock::ProblemGenerator(ParameterInput *pin) {
int i = is;
for (; i <= ie; ++i) {
if (air.w[IDN] < Tmin) break;
air.w[IVX] = 1. * sin(2. * M_PI * rand() / RAND_MAX);
air.w[IVX] = 0.1 * sin(2. * M_PI * rand() / RAND_MAX);
AirParcelHelper::distribute_to_conserved(this, k, j, i, air);
pthermo->Extrapolate(&air, pcoord->dx1f(i),
Thermodynamics::Method::PseudoAdiabat, grav,
Expand Down
10 changes: 5 additions & 5 deletions external/install_cantera.sh
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
#! /usr/bin/bash
#! /bin/bash

CXX=g++
CC=gcc
cxx_flags=-std=c++14
cxx_flags=-std=c++17
prefix=${HOME}/opt/
python_package=n
f90_interface=n
system_eigen=y
extra_inc_dirs=${HOME}/opt/include/eigen3
extra_inc_dirs=/opt/homebrew/Cellar/eigen/3.4.0_1/include
system_blas_lapack=n
boost_inc_dir=`pwd`/cliboost/
boost_inc_dir=`pwd`/ext/cliboost/

cd cantera
scons build CXX=${CXX} CC=${CC} cxx_flags=${cxx_flags} prefix=${prefix} \
python_package=${python_package} f90_interface=${f90_interface} \
system_eigen=${system_eigen} extra_inc_dirs=${extra_inc_dirs} \
system_blas_lapack=${system_blas_lapack} \
boost_inc_dir=${boost_inc_dir}
boost_inc_dir=${boost_inc_dir} -j8
scons install
cd ..
2 changes: 1 addition & 1 deletion external/install_pnetcdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ tar -xvzf "$TARFILE"
cd pnetcdf-1.12.3

# Configure, make and install
./configure --prefix="$DESTDIR"
FFLAGS="-fPIC -g -O2" FCFLAGS="-fPIC -g -O2" CFLAGS="-fPIC -g -O3" CXXFLAGS="-fPIC -g -O2" ./configure --prefix="$DESTDIR"
make
make install

Expand Down
12 changes: 6 additions & 6 deletions src/opacity/Giants/microwave/attenuation_electron.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
#include <harp/radiation.hpp>

// cli, 190801
inline double SQUARE(double x) { return x * x; }
inline double CUBE(double x) { return x * x * x; }
inline double _SQUARE(double x) { return x * x; }
inline double _CUBE(double x) { return x * x * x; }
// end

// From F. Oyafuso
Expand All @@ -26,17 +26,17 @@ double attenuation_freefree_Reference(double freq, double P, double T)
double hbar_omega =
4.13566733e-15 * freq * 1e9; // eV (.6GHz) -- check that freq is in GHz

double debroglie_thermal = sqrt(2.0 * M_PI * SQUARE(hbarc) / (mc2 * kT));
double debroglie_thermal = sqrt(2.0 * M_PI * _SQUARE(hbarc) / (mc2 * kT));
double E_ionization = 5.986; // eV
double n_Al = 1.6e-6 * (P * 1e5) / (kT * 1.609e-19) * 1e-6;

double ni =
sqrt(2 * n_Al / pow(debroglie_thermal, 3) * exp(-E_ionization / kT));

double kludge = 0.5;
double alpha_ff = kludge * sqrt(32 * CUBE(M_PI) / 3.0) *
(SQUARE(Z) * fine_struct) * sqrt(mc2 / kT) *
(ni * CUBE(hbarc / hbar_omega)) * ni * sigma_T *
double alpha_ff = kludge * sqrt(32 * _CUBE(M_PI) / 3.0) *
(_SQUARE(Z) * fine_struct) * sqrt(mc2 / kT) *
(ni * _CUBE(hbarc / hbar_omega)) * ni * sigma_T *
(1.0 - exp(-hbar_omega / kT));
return alpha_ff;
}
Expand Down

0 comments on commit 10e81c6

Please sign in to comment.