src/solvers/scalar/scalar.cc
/**
 ********************************************************************************************************************************************
 * \brief   Constructor of the base scalar class
 *
 *          The short base constructor of the scalar class merely assigns the const references to the grid and parser
 *          class instances being used in the solver.
 *          Also, the maximum allowable number of iterations for the Jacobi iterative solver being used to solve for the
 *          velocities implicitly is set as \f$ N_{max} = N_x \times N_y \times N_z \f$, where \f$N_x\f$, \f$N_y\f$ and \f$N_z\f$
 *          are the number of grid points in the collocated grid at the local sub-domains along x, y and z directions
 *          respectively.
 *
 * \param   mesh is a const reference to the global data contained in the grid class
 * \param   solParam is a const reference to the user-set parameters contained in the parser class
 * \param   mpiParam is a reference to the object of parallel class containing the necessary rank data
 ********************************************************************************************************************************************
 */
\brief   Constructor of the base scalar class
The short base constructor of the scalar class merely assigns the const references to the grid and parser
class instances being used in the solver.

\param   mesh is a const reference to the global data contained in the grid class
\param   solParam is a const reference to the user-set parameters contained in the parser class
\param   mpiParam is a reference to the object of parallel class containing the necessary rank data
\ brief Constructor of the base scalar class The short base constructor of the scalar class merely assigns the const references to the grid and parser class instances being used in the solver . \ param mesh is a const reference to the global data contained in the grid class \ param solParam is a const reference to the user - set parameters contained in the parser class \ param mpiParam is a reference to the object of parallel class containing the necessary rank data
scalar::scalar(const grid &mesh, const parser &solParam, parallel &mpiParam):
            hydro(mesh, solParam, mpiParam),
            T(mesh, "T"),
            tmpRHS(mesh, T),
            guessedScalar(mesh, T),
            scalarLaplacian(mesh, T)
{
    bool viscSwitch = false;
    bool diffSwitch = false;
    if (inputParams.rbcType == 1) {
        nu = inputParams.Pr;
        kappa = 1.0;
    } else if (inputParams.rbcType == 2) {
        nu = sqrt(inputParams.Pr/inputParams.Ra);
        kappa = 1.0/sqrt(inputParams.Pr*inputParams.Ra);
    } else if (inputParams.rbcType == 3) {
        nu = 1.0;
        kappa = 1.0/inputParams.Pr;
    } else if (inputParams.rbcType == 4) {
        nu = sqrt(inputParams.Pr/inputParams.Ra);
        kappa = 1.0/sqrt(inputParams.Pr*inputParams.Ra);
    } else {
        if (mpiData.rank == 0) {
            std::cout << "ERROR: Invalid RBC non-dimensionalization type. Aborting" << std::endl;
        }
        exit(0);
    }
    if (viscSwitch) {
        nu = 0.0;
    }
    if (diffSwitch) {
        kappa = 0.0;
    }
}
scalar :: scalar ( const grid & mesh , const parser & solParam , parallel & mpiParam ) : hydro ( mesh , solParam , mpiParam ) , T ( mesh , " " ) , tmpRHS ( mesh , T ) , guessedScalar ( mesh , T ) , scalarLaplacian ( mesh , T ) { bool viscSwitch = false ; bool diffSwitch = false ; if ( inputParams . rbcType == 1 ) { nu = inputParams . Pr ; kappa = 1.0 ; } else if ( inputParams . rbcType == 2 ) { nu = sqrt ( inputParams . Pr / inputParams . Ra ) ; kappa = 1.0 / sqrt ( inputParams . Pr * inputParams . Ra ) ; } else if ( inputParams . rbcType == 3 ) { nu = 1.0 ; kappa = 1.0 / inputParams . Pr ; } else if ( inputParams . rbcType == 4 ) { nu = sqrt ( inputParams . Pr / inputParams . Ra ) ; kappa = 1.0 / sqrt ( inputParams . Pr * inputParams . Ra ) ; } else { if ( mpiData . rank == 0 ) { std :: cout << " " << std :: endl ; } exit ( 0 ) ; } if ( viscSwitch ) { nu = 0.0 ; } if ( diffSwitch ) { kappa = 0.0 ; } }
\brief   Constructor of the base scalar class
          The short base constructor of the scalar class merely assigns the const references to the grid and parser
          class instances being used in the solver.
\ brief Constructor of the base scalar class The short base constructor of the scalar class merely assigns the const references to the grid and parser class instances being used in the solver .
// Below flags may be turned on for debugging/dignostic runs only // Additional option of turning off diffusion for debugging/diagnostics only