Merge branch 'master' of github.com:JamesEMcClure/LBPM-WIA

This commit is contained in:
James E McClure 2021-09-02 08:32:57 -04:00
commit 7d71211f4e
6 changed files with 18 additions and 11 deletions

View File

@ -642,7 +642,7 @@ public: // Math operations
void cat( const Array &x, int dim = 0 ); void cat( const Array &x, int dim = 0 );
//! Initialize the array with random values (defined from the function table) //! Initialize the array with random values (defined from the function table)
void rand(); //void rand();
//! Return true if NaNs are present //! Return true if NaNs are present
bool NaNs() const; bool NaNs() const;

View File

@ -1292,11 +1292,12 @@ TYPE Array<TYPE, FUN, Allocator>::interp( const double *x ) const
/******************************************************** /********************************************************
* Math operations (should call the Math class) * * Math operations (should call the Math class) *
********************************************************/ ********************************************************/
template<class TYPE, class FUN, class Allocator> /*template<class TYPE, class FUN, class Allocator>
void Array<TYPE, FUN, Allocator>::rand() void Array<TYPE, FUN, Allocator>::rand()
{ {
FUN::rand( *this ); FUN::rand( *this );
} }
*/
template<class TYPE, class FUN, class Allocator> template<class TYPE, class FUN, class Allocator>
Array<TYPE, FUN, Allocator> & Array<TYPE, FUN, Allocator> &
Array<TYPE, FUN, Allocator>::operator+=( const Array<TYPE, FUN, Allocator> &rhs ) Array<TYPE, FUN, Allocator>::operator+=( const Array<TYPE, FUN, Allocator> &rhs )

View File

@ -629,7 +629,8 @@ void Domain::ComputePorosity(){
double sum; double sum;
double sum_local=0.0; double sum_local=0.0;
double iVol_global = 1.0/(1.0*(Nx-2)*(Ny-2)*(Nz-2)*nprocx()*nprocy()*nprocz()); double iVol_global = 1.0/(1.0*(Nx-2)*(Ny-2)*(Nz-2)*nprocx()*nprocy()*nprocz());
if (BoundaryCondition > 0 && BoundaryCondition !=5) iVol_global = 1.0/(1.0*(Nx-2)*nprocx()*(Ny-2)*nprocy()*((Nz-2)*nprocz()-6)); if (BoundaryCondition > 0 && BoundaryCondition !=5)
iVol_global = 1.0/(1.0*(Nx-2)*nprocx()*(Ny-2)*nprocy()*((Nz-2)*nprocz()-inlet_layers_z - outlet_layers_z));
//......................................................... //.........................................................
for (int k=inlet_layers_z+1; k<Nz-outlet_layers_z-1;k++){ for (int k=inlet_layers_z+1; k<Nz-outlet_layers_z-1;k++){
for (int j=1;j<Ny-1;j++){ for (int j=1;j<Ny-1;j++){

View File

@ -4,7 +4,7 @@
/******************************************************** /********************************************************
* Random number generation * * Random number generation *
********************************************************/ ********************************************************/
template<> char genRand<char>() /*template<> char genRand<char>()
{ {
static std::random_device rd; static std::random_device rd;
static std::mt19937 gen( rd() ); static std::mt19937 gen( rd() );
@ -88,7 +88,7 @@ template<> long double genRand<long double>()
static std::uniform_real_distribution<double> dis; static std::uniform_real_distribution<double> dis;
return dis( gen ); return dis( gen );
} }
*/
/******************************************************** /********************************************************
* axpy * * axpy *

View File

@ -7,21 +7,20 @@
#include <algorithm> #include <algorithm>
#include <cstring> #include <cstring>
#include <limits> #include <limits>
#include <random> //#include <random>
/******************************************************** /********************************************************
* Random number initialization * * Random number initialization *
********************************************************/ ********************************************************/
template<class TYPE> TYPE genRand(); /*template<class TYPE> TYPE genRand();
template<class TYPE, class FUN> template<class TYPE, class FUN>
inline void FunctionTable::rand( Array<TYPE, FUN> &x ) inline void FunctionTable::rand( Array<TYPE, FUN> &x )
{ {
for ( size_t i = 0; i < x.length(); i++ ) for ( size_t i = 0; i < x.length(); i++ )
x( i ) = genRand<TYPE>(); x( i ) = genRand<TYPE>();
} }
*/
/******************************************************** /********************************************************
* Reduction * * Reduction *

View File

@ -92,6 +92,8 @@ int main( int argc, char **argv )
SKIP_TIMESTEPS = flow_db->getWithDefault<int>( "skip_timesteps", 50000 ); SKIP_TIMESTEPS = flow_db->getWithDefault<int>( "skip_timesteps", 50000 );
ENDPOINT_THRESHOLD = flow_db->getWithDefault<double>( "endpoint_threshold", 0.1); ENDPOINT_THRESHOLD = flow_db->getWithDefault<double>( "endpoint_threshold", 0.1);
/* protocol specific key values */ /* protocol specific key values */
if (PROTOCOL == "image sequence" || PROTOCOL == "core flooding")
SKIP_TIMESTEPS = 0;
if (PROTOCOL == "fractional flow") if (PROTOCOL == "fractional flow")
FRACTIONAL_FLOW_INCREMENT = flow_db->getWithDefault<double>( "fractional_flow_increment", 0.05); FRACTIONAL_FLOW_INCREMENT = flow_db->getWithDefault<double>( "fractional_flow_increment", 0.05);
if (PROTOCOL == "seed water") if (PROTOCOL == "seed water")
@ -107,10 +109,14 @@ int main( int argc, char **argv )
runAnalysis analysis(ColorModel); runAnalysis analysis(ColorModel);
while (ContinueSimulation){ while (ContinueSimulation){
/* this will run steady points */ /* this will run steady points */
timestep += MAX_STEADY_TIME; if (PROTOCOL == "fractional flow" || PROTOCOL == "seed water" || PROTOCOL == "shell aggregation" || PROTOCOL == "image sequence" )
timestep += MAX_STEADY_TIME;
else
timestep += ColorModel.timestepMax;
/* Run the simulation timesteps*/
MLUPS = ColorModel.Run(timestep); MLUPS = ColorModel.Run(timestep);
if (rank==0) printf("Lattice update rate (per MPI process)= %f MLUPS \n", MLUPS); if (rank==0) printf("Lattice update rate (per MPI process)= %f MLUPS \n", MLUPS);
if (ColorModel.timestep > ColorModel.timestepMax){ if (ColorModel.timestep >= ColorModel.timestepMax){
ContinueSimulation = false; ContinueSimulation = false;
} }