diff --git a/include/AssembleMomentumEdgeABLTopBC.h b/include/AssembleMomentumEdgeABLTopBC.h index b34baa308..cfa4240d6 100644 --- a/include/AssembleMomentumEdgeABLTopBC.h +++ b/include/AssembleMomentumEdgeABLTopBC.h @@ -64,7 +64,7 @@ class AssembleMomentumEdgeABLTopBC : public SolverAlgorithm stk::mesh::Part *part, EquationSystem *eqSystem, std::vector& grid_dims_, std::vector& horiz_bcs_, double z_sample_); - virtual ~AssembleMomentumEdgeABLTopBC() {} + virtual ~AssembleMomentumEdgeABLTopBC(); virtual void initialize_connectivity(); /** Main function to compute and set the boundary values. diff --git a/src/AssembleMomentumEdgeABLTopBC.C b/src/AssembleMomentumEdgeABLTopBC.C index 7465ee8f8..f00894499 100644 --- a/src/AssembleMomentumEdgeABLTopBC.C +++ b/src/AssembleMomentumEdgeABLTopBC.C @@ -63,6 +63,32 @@ AssembleMomentumEdgeABLTopBC::AssembleMomentumEdgeABLTopBC( bcVelocity_ = meta_data.get_field(stk::topology::NODE_RANK, "cont_velocity_bc"); } +AssembleMomentumEdgeABLTopBC::~AssembleMomentumEdgeABLTopBC() +{ + switch (horizBCType_) { + case 0: + fftw_destroy_plan(planFourier2dF_); + fftw_destroy_plan(planFourier2dB_); + break; + + case 1: + fftw_destroy_plan(planSinx_); + fftw_destroy_plan(planCosx_); + fftw_destroy_plan(planFourieryF_); + fftw_destroy_plan(planFourieryB_); + break; + + case 3: + fftw_destroy_plan(planSinx_); + fftw_destroy_plan(planCosx_); + fftw_destroy_plan(planSiny_); + fftw_destroy_plan(planCosy_); + break; + } + + fftw_cleanup(); +} + //-------------------------------------------------------------------------- //-------- initialize_connectivity ----------------------------------------- //-------------------------------------------------------------------------- @@ -269,9 +295,10 @@ AssembleMomentumEdgeABLTopBC::initialize() fftw_plan_r2r_1d(ny+1, work.data(), work.data(), FFTW_REDFT00, flags); break; default: - printf("%s\n","BC not yet implemented"); - exit(0); - } + throw std::runtime_error( + "AssembleMomentumEdgeABLTopBC::initialize(): Invalid value for " + "horizBCType_. Must be 0, 1, or 3."); + } // Determine the vertical mesh distribution by sampling at the middle // of the ix=0 face. diff --git a/src/LowMachEquationSystem.C b/src/LowMachEquationSystem.C index eaf87d5fd..690fa79bf 100644 --- a/src/LowMachEquationSystem.C +++ b/src/LowMachEquationSystem.C @@ -2156,7 +2156,7 @@ MomentumEquationSystem::register_abltop_bc( // faceElemSolverAlg->elemDataNeeded_); // } throw std::runtime_error("MomentumEqSys: Consolidated algorithm not " - "supported at this time for ABL Top BC.") + "supported at this time for ABL Top BC."); } #else throw std::runtime_error(