Commit cb1c1a31 authored by Tomáš Oberhuber's avatar Tomáš Oberhuber
Browse files

Adding tnlLinearDiffusion.

parent 1f5a2fb1
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -10,8 +10,8 @@ CXX = g++
CUDA_CXX = nvcc
OMP_FLAGS = -DHAVE_OPENMP -fopenmp 
#CXX_FLAGS = -std=gnu++0x -I$(TNL_INCLUDE_DIR) -O0 -g -DDEBUG $(OMP_FLAGS)
#CXX_FLAGS = -std=gnu++0x -I$(TNL_INCLUDE_DIR) -O3 $(OMP_FLAGS)
CXX_FLAGS = -DHAVE_NOT_CXX11 -I$(TNL_INCLUDE_DIR) -O3 $(OMP_FLAGS)
CXX_FLAGS = -std=gnu++0x -I$(TNL_INCLUDE_DIR) -O3 $(OMP_FLAGS)
#CXX_FLAGS = -DHAVE_NOT_CXX11 -I$(TNL_INCLUDE_DIR) -O3 $(OMP_FLAGS)
LD_FLAGS = -L$(TNL_INSTALL_DIR) -ltnl-0.1 -lgomp

SOURCES = main.cpp
+1 −4
Original line number Diff line number Diff line
@@ -42,10 +42,7 @@ bool navierStokesSetter< SolverStarter > :: run( const tnlParameterContainer& pa
      if( schemeName == "lax-fridrichs" )
         return solverStarter. run< navierStokesSolver< MeshType,
                                                        tnlLaxFridrichs< MeshType,
                                                                        tnlCentralFDMGradient< MeshType :: Dimensions,
                                                                                               typename MeshType :: RealType,
                                                                                               typename MeshType :: DeviceType,
                                                                                               typename MeshType :: IndexType > > > >
                                                                        tnlCentralFDMGradient< MeshType > > > >
                                                        ( parameters );
   }
}
+2 −0
Original line number Diff line number Diff line
@@ -97,6 +97,8 @@ class navierStokesSolver

   EulerScheme eulerScheme;

   tnlCentralFDMGradient< MeshType > pressureGradient;

   navierStokesSolverMonitor< RealType, IndexType > solverMonitor;
};

+15 −9
Original line number Diff line number Diff line
@@ -144,7 +144,10 @@ bool navierStokesSolver< Mesh, EulerScheme > :: init( const tnlParameterContaine
   /****
    * Set-up numerical scheme
    */
   pressureGradient. setFunction( p );
   pressureGradient. bindMesh( this -> mesh );
   this -> eulerScheme. bindMesh( this -> mesh );
   this -> eulerScheme. setPressureGradient( this -> pressureGradient );

   return true;
}
@@ -429,18 +432,18 @@ void navierStokesSolver< Mesh, EulerScheme > :: GetExplicitRHS( const RealType&
            IndexType n = mesh. getElementIndex( j + 1, i );
            IndexType s = mesh. getElementIndex( j - 1, i );

            const RealType& u = this -> u1[ c ];
            const RealType& v = this -> u2[ c ];
            const RealType u_sqr = u * u;
            const RealType v_sqr = v * v;
            //const RealType& u = this -> u1[ c ];
            //const RealType& v = this -> u2[ c ];
            //const RealType u_sqr = u * u;
            //const RealType v_sqr = v * v;
            eulerScheme. getExplicitRhs( c,
                                         rho_t[ c ],
                                         rho_u1_t[ c ],
                                         rho_u2_t[ c ] );
            
            //rho_u1_t[ c ] += -( p[ e ] - p[ w ] ) / ( 2.0 * hx );
            rho_u2_t[ c ] += //-( p[ n ] - p[ s ] ) / ( 2.0 * hy );
                             - startUpCoefficient * this -> gravity * this -> rho[ c ];
            //rho_u2_t[ c ] += -( p[ n ] - p[ s ] ) / ( 2.0 * hy );
                             //- startUpCoefficient * this -> gravity * this -> rho[ c ];

            /***
             * Add the viscosity term
@@ -491,6 +494,9 @@ void navierStokesSolver< Mesh, EulerScheme > :: GetExplicitRHS( const RealType&
   }

   rhsDofVector = fu;
   //makeSnapshot( 0.0, 1 );
   //getchar();

}

#ifdef HAVE_CUDA
+8 −5
Original line number Diff line number Diff line
ADD_SUBDIRECTORY( euler )
ADD_SUBDIRECTORY( gradient )
ADD_SUBDIRECTORY( diffusion )
ADD_SUBDIRECTORY( euler )

SET( CURRENT_DIR ${CMAKE_SOURCE_DIR}/src/implementation/schemes )

if( BUILD_CUDA)
      set( tnl_implementation_schemes_CUDA__SOURCES        
        ${tnl_implementation_schemes_euler_CUDA__SOURCES}
        ${tnl_implementation_schemes_diffusion_CUDA__SOURCES}
        ${tnl_implementation_schemes_gradient_CUDA__SOURCES}
        ${tnl_implementation_schemes_euler_CUDA__SOURCES}
        ${common_SOURCES}
        PARENT_SCOPE )
endif()

set( tnl_implementation_schemes_SOURCES     
     ${tnl_implementation_schemes_euler_SOURCES}
     ${tnl_implementation_schemes_diffusion_SOURCES}
     ${tnl_implementation_schemes_gradient_SOURCES}
     ${tnl_implementation_schemes_euler_SOURCES}
     ${common_SOURCES}
     PARENT_SCOPE )
   
Loading