rice-solar-physics / HYDRAD

HYDrodynamics and RADiation Code for computing solutions to field-aligned hydrodynamic equations in coronal loops
MIT License
9 stars 5 forks source link

Kinetic model option causes compilation error when compiling HYDRAD #72

Open wtbarnes opened 4 years ago

wtbarnes commented 4 years ago

Using the USE_KINETIC_MODEL preprocessor directive yields the following error when compiling HYDRAD.exe,

../source/eqns.cpp:2943:10: error: use of undeclared identifier 'iNumCells'
iIndex = iNumCells-2;
         ^
../source/eqns.cpp:2951:10: error: use of undeclared identifier 'iNumCells'
iIndex = iNumCells-1;
         ^
../source/eqns.cpp:2970:23: error: use of undeclared identifier 'iNumCells'
for( iIndex=2; iIndex<iNumCells; iIndex++ )
                      ^
../source/eqns.cpp:2998:10: error: use of undeclared identifier 'iNumCells'
iIndex = iNumCells-2;
         ^
../source/eqns.cpp:3003:13: error: use of undeclared identifier 'iNumCells'
for( iIndex=iNumCells-3; iIndex>=0; iIndex-- )
            ^
../source/eqns.cpp:3033:23: error: use of undeclared identifier 'iNumCells'
for( iIndex=2; iIndex<iNumCells-2; iIndex++ )
                      ^
6 errors generated.

For reference, this is what the HYDRAD/source/config.h file looks like,

// ****
// *
// * #defines for configuring the hydrodynamic model
// *
// * (c) Dr. Stephen J. Bradshaw
// *
// * Source code generated by pydrad on 2020-06-03_18.15.50 UTC
// *
// ****

// **** Output ****
#define WRITE_FILE_PHYSICAL
#define WRITE_FILE_ION_POPULATIONS
#define WRITE_FILE_HSTATE
#define WRITE_FILE_SCALES
#define WRITE_FILE_TERMS
#define OUTPUT_EVERY_N_TIME_STEPS 1000
// **** End of Output ****

// **** Physics ****
#include "../../Heating_Model/source/config.h"
#include "../../Radiation_Model/source/config.h"
#define HEAT_FLUX_LIMITING_COEFFICIENT 0.167
#define TIME_STEP_LIMIT 1e-10
#define USE_KINETIC_MODEL
#include "collisions.h"

// **** End of Physics ****

// **** Solver ****

#define SAFETY_RADIATION 0.1
#define SAFETY_CONDUCTION 1.0
#define SAFETY_ADVECTION 1.0
#define SAFETY_VISCOSITY 1.0
#define TIME_STEP_INCREASE_LIMIT 1.05

#define MINIMUM_RADIATION_TEMPERATURE 20000.0
#define ZERO_OVER_TEMPERATURE_INTERVAL 500.0
#define MINIMUM_TEMPERATURE 10000.0

// **** End of Solver ****

// **** Grid ****
#define MAX_REFINEMENT_LEVEL 12
#define ADAPT
#define ADAPT_EVERY_N_TIME_STEPS 1000
#define REFINE_ON_DENSITY
#define REFINE_ON_ELECTRON_ENERGY
#define REFINE_ON_HYDROGEN_ENERGY
#define MIN_FRAC_DIFF 0.05
#define MAX_FRAC_DIFF 0.1
#define LINEAR_RESTRICTION
#define ENFORCE_CONSERVATION
// **** End of Grid ****
wtbarnes commented 4 years ago

I don't need the kinetic model for anything. I just figured that this bug should be documented in some way as it has popped up a few times and I get confused by it each time.