From 664da10edda672739516e1def7583310e357836e Mon Sep 17 00:00:00 2001 From: James McClure Date: Wed, 1 Sep 2021 12:19:47 -0400 Subject: [PATCH 1/3] extra protocol checks --- tests/lbpm_color_simulator.cpp | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/tests/lbpm_color_simulator.cpp b/tests/lbpm_color_simulator.cpp index a0b2859c..c2bdb801 100644 --- a/tests/lbpm_color_simulator.cpp +++ b/tests/lbpm_color_simulator.cpp @@ -92,6 +92,8 @@ int main( int argc, char **argv ) SKIP_TIMESTEPS = flow_db->getWithDefault( "skip_timesteps", 50000 ); ENDPOINT_THRESHOLD = flow_db->getWithDefault( "endpoint_threshold", 0.1); /* protocol specific key values */ + if (PROTOCOL == "image sequence" || PROTOCOL == "core flooding") + SKIP_TIMESTEPS = 0; if (PROTOCOL == "fractional flow") FRACTIONAL_FLOW_INCREMENT = flow_db->getWithDefault( "fractional_flow_increment", 0.05); if (PROTOCOL == "seed water") @@ -107,10 +109,14 @@ int main( int argc, char **argv ) runAnalysis analysis(ColorModel); while (ContinueSimulation){ /* 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); 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; } From b3457348bde9efc75a28860c17f0174be9ed1c29 Mon Sep 17 00:00:00 2001 From: James McClure Date: Wed, 1 Sep 2021 14:29:31 -0400 Subject: [PATCH 2/3] fix inlet / outlet porosity --- common/Domain.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/common/Domain.cpp b/common/Domain.cpp index 6a4c61fb..81f74e22 100644 --- a/common/Domain.cpp +++ b/common/Domain.cpp @@ -629,7 +629,8 @@ void Domain::ComputePorosity(){ double sum; double sum_local=0.0; 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 Date: Thu, 2 Sep 2021 08:19:54 -0400 Subject: [PATCH 3/3] remove random array functionality --- common/Array.h | 2 +- common/Array.hpp | 3 ++- common/FunctionTable.cpp | 4 ++-- common/FunctionTable.hpp | 7 +++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/common/Array.h b/common/Array.h index ccbcbdc8..0e163718 100644 --- a/common/Array.h +++ b/common/Array.h @@ -642,7 +642,7 @@ public: // Math operations void cat( const Array &x, int dim = 0 ); //! Initialize the array with random values (defined from the function table) - void rand(); + //void rand(); //! Return true if NaNs are present bool NaNs() const; diff --git a/common/Array.hpp b/common/Array.hpp index 1faaba71..1deaa463 100644 --- a/common/Array.hpp +++ b/common/Array.hpp @@ -1292,11 +1292,12 @@ TYPE Array::interp( const double *x ) const /******************************************************** * Math operations (should call the Math class) * ********************************************************/ -template +/*template void Array::rand() { FUN::rand( *this ); } +*/ template Array & Array::operator+=( const Array &rhs ) diff --git a/common/FunctionTable.cpp b/common/FunctionTable.cpp index 10577c0f..54dc5848 100644 --- a/common/FunctionTable.cpp +++ b/common/FunctionTable.cpp @@ -4,7 +4,7 @@ /******************************************************** * Random number generation * ********************************************************/ -template<> char genRand() +/*template<> char genRand() { static std::random_device rd; static std::mt19937 gen( rd() ); @@ -88,7 +88,7 @@ template<> long double genRand() static std::uniform_real_distribution dis; return dis( gen ); } - +*/ /******************************************************** * axpy * diff --git a/common/FunctionTable.hpp b/common/FunctionTable.hpp index 6a611f00..57e6b237 100644 --- a/common/FunctionTable.hpp +++ b/common/FunctionTable.hpp @@ -7,21 +7,20 @@ #include #include #include -#include - +//#include /******************************************************** * Random number initialization * ********************************************************/ -template TYPE genRand(); +/*template TYPE genRand(); template inline void FunctionTable::rand( Array &x ) { for ( size_t i = 0; i < x.length(); i++ ) x( i ) = genRand(); } - +*/ /******************************************************** * Reduction *