lib/field/vfield.cc
/**
 ********************************************************************************************************************************************
 * \brief   Function to compute the convective derivative of the vector field
 *
 *          The function computes for the operator \f$ (\mathbf{u}.\nabla)\mathbf{v} \f$ for the vector field, \f$\mathbf{v}\f$.
 *          To do so, the function needs the vector field (vfield) of velocity, \f$\mathbf{u}\f$.
 *          This value is used in three separate calls to the \ref sfield#computeNLin "computeNLin" function of sfield
 *          to compute the derivatives for the three components of the vector field.
 *          It is assumed that the velocity is specified at face-centers, as required by the \ref sfield#computeNLin
 *          "computeNLin" function of sfield.
 *
 * \param   V is a const reference to a vector field (vfield) that specifies the convection velocity at each point
 * \param   H is a pointer to a vector field (vfield) to which the output of the function is to be written
 ********************************************************************************************************************************************
 */


\param   V is a const reference to a vector field (vfield) that specifies the convection velocity at each point
\param   H is a pointer to a vector field (vfield) to which the output of the function is to be written
\ param V is a const reference to a vector field ( vfield ) that specifies the convection velocity at each point \ param H is a pointer to a vector field ( vfield ) to which the output of the function is to be written
void vfield::computeNLin(const vfield &V, plainvf &H) {
    interTempX = 0.0;
    for (unsigned int i=0; i < Vx.VxIntSlices.size(); i++) {
        interTempX(Vx.fCore) += V.Vx.F(Vx.VxIntSlices(i));
    }
    derivTempX = 0.0;
    derVx.calcDerivative1_x(derivTempX);
    H.Vx(Vx.fCore) -= interTempX(Vx.fCore)*derivTempX(Vx.fCore)/Vx.VxIntSlices.size();
#ifndef PLANAR
    interTempX = 0.0;
    for (unsigned int i=0; i < Vx.VyIntSlices.size(); i++) {
        interTempX(Vx.fCore) += V.Vy.F(Vx.VyIntSlices(i));
    }
    derivTempX = 0.0;
    derVx.calcDerivative1_y(derivTempX);
    H.Vx(Vx.fCore) -= interTempX(Vx.fCore)*derivTempX(Vx.fCore)/Vx.VyIntSlices.size();
#endif
    interTempX = 0.0;
    for (unsigned int i=0; i < Vx.VzIntSlices.size(); i++) {
        interTempX(Vx.fCore) += V.Vz.F(Vx.VzIntSlices(i));
    }
    derivTempX = 0.0;    
    derVx.calcDerivative1_z(derivTempX);
    H.Vx(Vx.fCore) -= interTempX(Vx.fCore)*derivTempX(Vx.fCore)/Vx.VzIntSlices.size();
#ifndef PLANAR
    interTempY = 0.0;
    for (unsigned int i=0; i < Vy.VxIntSlices.size(); i++) {
        interTempY(Vy.fCore) += V.Vx.F(Vy.VxIntSlices(i));
    }
    derivTempY = 0.0;
    derVy.calcDerivative1_x(derivTempY);
    H.Vy(Vy.fCore) -= interTempY(Vy.fCore)*derivTempY(Vy.fCore)/Vy.VxIntSlices.size();
    interTempY = 0.0;
    for (unsigned int i=0; i < Vy.VyIntSlices.size(); i++) {
        interTempY(Vy.fCore) += V.Vy.F(Vy.VyIntSlices(i));
    }
    derivTempY = 0.0;
    derVy.calcDerivative1_y(derivTempY);
    H.Vy(Vy.fCore) -= interTempY(Vy.fCore)*derivTempY(Vy.fCore)/Vy.VyIntSlices.size();
    interTempY = 0.0;
    for (unsigned int i=0; i < Vy.VzIntSlices.size(); i++) {
        interTempY(Vy.fCore) += V.Vz.F(Vy.VzIntSlices(i));
    }
    derivTempY = 0.0;
    derVy.calcDerivative1_z(derivTempY);
    H.Vy(Vy.fCore) -= interTempY(Vy.fCore)*derivTempY(Vy.fCore)/Vy.VzIntSlices.size();
#endif
    interTempZ = 0.0;
    for (unsigned int i=0; i < Vz.VxIntSlices.size(); i++) {
        interTempZ(Vz.fCore) += V.Vx.F(Vz.VxIntSlices(i));
    }
    derivTempZ = 0.0;
    derVz.calcDerivative1_x(derivTempZ);
    H.Vz(Vz.fCore) -= interTempZ(Vz.fCore)*derivTempZ(Vz.fCore)/Vz.VxIntSlices.size();
#ifndef PLANAR
    interTempZ = 0.0;
    for (unsigned int i=0; i < Vz.VyIntSlices.size(); i++) {
        interTempZ(Vz.fCore) += V.Vy.F(Vz.VyIntSlices(i));
    }
    derivTempZ = 0.0;
    derVz.calcDerivative1_y(derivTempZ);
    H.Vz(Vz.fCore) -= interTempZ(Vz.fCore)*derivTempZ(Vz.fCore)/Vz.VyIntSlices.size();
#endif
    interTempZ = 0.0;
    for (unsigned int i=0; i < Vz.VzIntSlices.size(); i++) {
        interTempZ(Vz.fCore) += V.Vz.F(Vz.VzIntSlices(i));
    }
    derivTempZ = 0.0;
    derVz.calcDerivative1_z(derivTempZ);
    H.Vz(Vz.fCore) -= interTempZ(Vz.fCore)*derivTempZ(Vz.fCore)/Vz.VzIntSlices.size();
}
void vfield :: computeNLin ( const vfield & V , plainvf & H ) { interTempX = 0.0 ; for ( unsigned int i = 0 ; i < Vx . VxIntSlices . size ( ) ; i ++ ) { interTempX ( Vx . fCore ) += V . Vx . F ( Vx . VxIntSlices ( i ) ) ; } derivTempX = 0.0 ; derVx . calcDerivative1_x ( derivTempX ) ; H . Vx ( Vx . fCore ) -= interTempX ( Vx . fCore ) * derivTempX ( Vx . fCore ) / Vx . VxIntSlices . size ( ) ; #ifndef PLANAR interTempX = 0.0 ; for ( unsigned int i = 0 ; i < Vx . VyIntSlices . size ( ) ; i ++ ) { interTempX ( Vx . fCore ) += V . Vy . F ( Vx . VyIntSlices ( i ) ) ; } derivTempX = 0.0 ; derVx . calcDerivative1_y ( derivTempX ) ; H . Vx ( Vx . fCore ) -= interTempX ( Vx . fCore ) * derivTempX ( Vx . fCore ) / Vx . VyIntSlices . size ( ) ; #endif interTempX = 0.0 ; for ( unsigned int i = 0 ; i < Vx . VzIntSlices . size ( ) ; i ++ ) { interTempX ( Vx . fCore ) += V . Vz . F ( Vx . VzIntSlices ( i ) ) ; } derivTempX = 0.0 ; derVx . calcDerivative1_z ( derivTempX ) ; H . Vx ( Vx . fCore ) -= interTempX ( Vx . fCore ) * derivTempX ( Vx . fCore ) / Vx . VzIntSlices . size ( ) ; #ifndef PLANAR interTempY = 0.0 ; for ( unsigned int i = 0 ; i < Vy . VxIntSlices . size ( ) ; i ++ ) { interTempY ( Vy . fCore ) += V . Vx . F ( Vy . VxIntSlices ( i ) ) ; } derivTempY = 0.0 ; derVy . calcDerivative1_x ( derivTempY ) ; H . Vy ( Vy . fCore ) -= interTempY ( Vy . fCore ) * derivTempY ( Vy . fCore ) / Vy . VxIntSlices . size ( ) ; interTempY = 0.0 ; for ( unsigned int i = 0 ; i < Vy . VyIntSlices . size ( ) ; i ++ ) { interTempY ( Vy . fCore ) += V . Vy . F ( Vy . VyIntSlices ( i ) ) ; } derivTempY = 0.0 ; derVy . calcDerivative1_y ( derivTempY ) ; H . Vy ( Vy . fCore ) -= interTempY ( Vy . fCore ) * derivTempY ( Vy . fCore ) / Vy . VyIntSlices . size ( ) ; interTempY = 0.0 ; for ( unsigned int i = 0 ; i < Vy . VzIntSlices . size ( ) ; i ++ ) { interTempY ( Vy . fCore ) += V . Vz . F ( Vy . VzIntSlices ( i ) ) ; } derivTempY = 0.0 ; derVy . calcDerivative1_z ( derivTempY ) ; H . Vy ( Vy . fCore ) -= interTempY ( Vy . fCore ) * derivTempY ( Vy . fCore ) / Vy . VzIntSlices . size ( ) ; #endif interTempZ = 0.0 ; for ( unsigned int i = 0 ; i < Vz . VxIntSlices . size ( ) ; i ++ ) { interTempZ ( Vz . fCore ) += V . Vx . F ( Vz . VxIntSlices ( i ) ) ; } derivTempZ = 0.0 ; derVz . calcDerivative1_x ( derivTempZ ) ; H . Vz ( Vz . fCore ) -= interTempZ ( Vz . fCore ) * derivTempZ ( Vz . fCore ) / Vz . VxIntSlices . size ( ) ; #ifndef PLANAR interTempZ = 0.0 ; for ( unsigned int i = 0 ; i < Vz . VyIntSlices . size ( ) ; i ++ ) { interTempZ ( Vz . fCore ) += V . Vy . F ( Vz . VyIntSlices ( i ) ) ; } derivTempZ = 0.0 ; derVz . calcDerivative1_y ( derivTempZ ) ; H . Vz ( Vz . fCore ) -= interTempZ ( Vz . fCore ) * derivTempZ ( Vz . fCore ) / Vz . VyIntSlices . size ( ) ; #endif interTempZ = 0.0 ; for ( unsigned int i = 0 ; i < Vz . VzIntSlices . size ( ) ; i ++ ) { interTempZ ( Vz . fCore ) += V . Vz . F ( Vz . VzIntSlices ( i ) ) ; } derivTempZ = 0.0 ; derVz . calcDerivative1_z ( derivTempZ ) ; H . Vz ( Vz . fCore ) -= interTempZ ( Vz . fCore ) * derivTempZ ( Vz . fCore ) / Vz . VzIntSlices . size ( ) ; }
\brief   Function to compute the convective derivative of the vector field
          The function computes for the operator \f$ (\mathbf{u}.\nabla)\mathbf{v} \f$ for the vector field, \f$\mathbf{v}\f$.
\ brief Function to compute the convective derivative of the vector field The function computes for the operator \ f$ ( \ mathbf { u } . \ nabla ) \ mathbf { v } \ f$ for the vector field \ f$ \ mathbf { v } \ f$ .
// Compute non-linear term for the Vx component // Compute non-linear term for the Vy component // Compute non-linear term for the Vz component