Skip to content
Snippets Groups Projects
Commit 5dc68b38 authored by Anna Wellmann's avatar Anna Wellmann
Browse files

Merge branch 'develop' into parameterRefactoring

parents 7c9e69b6 e3cfb269
No related branches found
No related tags found
1 merge request!228Add some tests to IndexRearrangementForStreams
Showing
with 267 additions and 357 deletions
BootStrap: docker
From: ubuntu:20.04
%files
3rdParty 3rdParty
apps apps
CMake CMake
Python Python
src src
CMakeLists.txt CMakeLists.txt
cpu.cmake cpu.cmake
gpu.cmake gpu.cmake
setup.py setup.py
pyproject.toml pyproject.toml
%post
export DEBIAN_FRONTEND=noninteractive
apt-get update && \
apt-get install -y \
build-essential \
cmake=3.16.3-1ubuntu1 \
python3 \
python3-dev \
python3-pip \
mpich \
libomp-dev
pip3 install setuptools wheel
export PYTHONPATH=Python
python3 /setup.py install
%environment
export PYTHONPATH=/Python
%runscript
python3 /Python/liddrivencavity/simulation.py
%appenv poiseuille
export PYTHONPATH=Python
%apprun poisueille
python3 /Python/poiseuille/poiseuille_hpc.py
BootStrap: docker
From: irmb/virtualfluids-python-deps
%files
3rdParty 3rdParty
apps apps
CMake CMake
Python Python
src src
CMakeLists.txt CMakeLists.txt
cpu.cmake cpu.cmake
gpu.cmake gpu.cmake
setup.py setup.py
pyproject.toml pyproject.toml
%post
export PYTHONPATH=Python
python3 /setup.py install
%environment
export PYTHONPATH=/Python
%runscript
python3 /Python/liddrivencavity/simulation.py
BootStrap: docker
From: ubuntu:20.04
%files
Python Python
dist dist
%post
export DEBIAN_FRONTEND=noninteractive
apt-get update && \
apt-get install -y \
build-essential \
cmake=3.16.3-1ubuntu1 \
python3 \
python3-dev \
python3-pip \
mpich \
libomp-dev
pip3 install setuptools wheel $(find dist/*.whl)
%environment
export PYTHONPATH=/Python
%runscript
python3 /Python/liddrivencavity/simulation.py
%appenv poiseuille
export PYTHONPATH=Python
%apprun poisueille
python3 /Python/poiseuille/poiseuille_hpc.py
......@@ -30,10 +30,11 @@ Stage: build
libomp-dev \
libgl1
pip3 install setuptools wheel cmake numpy scipy pyvista
pip3 install setuptools wheel cmake numpy scipy pyvista scikit-build
export PYTHONPATH=Python
python3 /setup.py bdist_wheel build_ext --build-temp=build
python3 /setup.py bdist_wheel build_ext --build-temp=_skbuild -- -DBUILD_VF_CPU=ON -DBUILD_VF_DOUBLE_ACCURACY=ON
pip3 install $(find dist/*.whl)
......
......@@ -16,8 +16,8 @@ collect:
to: POISEUILLE_TEST.out
overwrite: true
clean:
- poiseuille_test/*
#clean:
# - poiseuille_test/PoiseuilleTestContainer.sif
sbatch: poiseuille_test/slurm.job
continue_if_job_fails: true
......@@ -46,10 +46,7 @@ output_path.mkdir(exist_ok=True)
#%%
logger.Logger.initialize_logger()
basics.logger.Logger.add_stdout()
basics.logger.Logger.set_debug_level(basics.logger.Level.INFO_LOW)
basics.logger.Logger.time_stamp(basics.logger.TimeStamp.ENABLE)
basics.logger.Logger.enable_printed_rank_numbers(True)
#%%
grid_factory = gpu.grid_generator.GridFactory.make()
grid_builder = gpu.grid_generator.MultipleGridBuilder.make_shared(grid_factory)
......@@ -147,7 +144,7 @@ grid_scaling_factory.set_scaling_factory(gpu.GridScaling.ScaleCompressible)
grid_builder.add_coarse_grid(0.0, 0.0, 0.0, *length, dx)
grid_builder.set_periodic_boundary_condition(not read_precursor, True, False)
grid_builder.build_grids(basics.LbmOrGks.LBM, False)
grid_builder.build_grids(False)
sampling_offset = 2
if read_precursor:
......
......@@ -46,10 +46,7 @@ output_path.mkdir(exist_ok=True)
#%%
logger.Logger.initialize_logger()
basics.logger.Logger.add_stdout()
basics.logger.Logger.set_debug_level(basics.logger.Level.INFO_LOW)
basics.logger.Logger.time_stamp(basics.logger.TimeStamp.ENABLE)
basics.logger.Logger.enable_printed_rank_numbers(True)
#%%
grid_factory = gpu.grid_generator.GridFactory.make()
grid_builder = gpu.grid_generator.MultipleGridBuilder.make_shared(grid_factory)
......@@ -145,7 +142,7 @@ tm_factory.read_config_file(config)
#%%
grid_builder.add_coarse_grid(0.0, 0.0, 0.0, *length, dx)
grid_builder.set_periodic_boundary_condition(not read_precursor, True, False)
grid_builder.build_grids(basics.LbmOrGks.LBM, False)
grid_builder.build_grids(False)
sampling_offset = 2
if read_precursor:
......
......@@ -23,7 +23,6 @@ with usage of the GPU:
- CUDA [developer.nvidia.com/cuda-zone](https://developer.nvidia.com/cuda-zone):
* Minimum CUDA Version 9.0
* Minimum Compute Capability 3.0, because of maximal number of Blocks in x direction
* Recommended Compute Capability 6.0, because of atomics for double precision floating point data (GKS only)
### Build VirtualFluids
......
......@@ -83,4 +83,6 @@ ENDIF()
#add_subdirectory(Applications/OrganPipe)
#add_subdirectory(Applications/LidDrivenCavity)
if(BUILD_USE_BOOST)
add_subdirectory(${APPS_ROOT_CPU}/TPMSRow)
endif()
......@@ -8,13 +8,15 @@ using namespace std;
void run()
{
using namespace vf::lbm::dir;
try
{
SPtr<vf::mpi::Communicator> comm = vf::mpi::MPICommunicator::getInstance();
int myid = comm->getProcessID();
int numOfThreads = 4;
double availMem = 5e9;
real availMem = 5e9;
......@@ -24,11 +26,11 @@ void run()
string pathname = "d:/temp/ConvectionOfVortex_0.003_4th";
int endTime = 10000;
double outTime = 10;
LBMReal dx = 0.003;
LBMReal rhoLB = 0.0;
LBMReal nuLB = 8.66025e-6;
double yFactor = 1.0;
real outTime = 10;
real dx = 0.003;
real rhoLB = 0.0;
real nuLB = 8.66025e-6;
real yFactor = 1.0;
//string pathname = "d:/temp/ConvectionOfVortex_0.003_square";
//int endTime = 20;
......@@ -79,13 +81,13 @@ void run()
int refineLevel = 1;
//bounding box
double g_minX1 = -0.045;
double g_minX2 = -0.015/yFactor;
double g_minX3 = -0.06;
real g_minX1 = -0.045;
real g_minX2 = -0.015/yFactor;
real g_minX3 = -0.06;
double g_maxX1 = 0.045;
double g_maxX2 = 0.015/yFactor;
double g_maxX3 = 0.06;
real g_maxX1 = 0.045;
real g_maxX2 = 0.015/yFactor;
real g_maxX3 = 0.06;
vector<int> blocknx(3);
blocknx[0] = 10;
......@@ -97,7 +99,7 @@ void run()
if (myid == 0) GbSystem3D::writeGeoObject(gridCube.get(), pathname + "/geo/gridCube", WbWriterVtkXmlBinary::getInstance());
double blockLength = blocknx[0] * dx;
real blockLength = blocknx[0] * dx;
SPtr<Grid3D> grid(new Grid3D(comm));
grid->setDeltaX(dx);
......@@ -150,7 +152,7 @@ void run()
if (myid==0) GbSystem3D::writeGeoObject(geoOutflow4.get(), pathname+"/geo/geoOutflow4", WbWriterVtkXmlASCII::getInstance());
SPtr<D3Q27Interactor> outflowIntr4 = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoOutflow4, grid, outflowBCAdapter, Interactor3D::SOLID));
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_00M));
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, DIR_00M));
InteractorsHelper intHelper(grid, metisVisitor);
//intHelper.addInteractor(outflowIntr1);
//intHelper.addInteractor(outflowIntr2);
......@@ -183,8 +185,8 @@ void run()
unsigned long long numberOfNodesPerBlock = (unsigned long long)(blocknx[0])* (unsigned long long)(blocknx[1])* (unsigned long long)(blocknx[2]);
unsigned long long numberOfNodes = numberOfBlocks * numberOfNodesPerBlock;
unsigned long long numberOfNodesPerBlockWithGhostLayer = numberOfBlocks * (blocknx[0] + ghostLayer) * (blocknx[1] + ghostLayer) * (blocknx[2] + ghostLayer);
double needMemAll = double(numberOfNodesPerBlockWithGhostLayer*(27 * sizeof(double) + sizeof(int) + sizeof(float) * 4));
double needMem = needMemAll / double(comm->getNumberOfProcesses());
real needMemAll = real(numberOfNodesPerBlockWithGhostLayer*(27 * sizeof(real) + sizeof(int) + sizeof(float) * 4));
real needMem = needMemAll / real(comm->getNumberOfProcesses());
if (myid == 0)
{
......@@ -224,7 +226,7 @@ void run()
intHelper.setBC();
double Ma = 0.005;
real Ma = 0.005;
mu::Parser initRho, initVx1, initVx2;
initRho.SetExpr("rhoLB + (-(rho0*epsilon^2)/2) * exp(1-(scaleFactor*(x1^2+x3^2))/R^2) + (1/(2*gamma*rho0)) * ((-(rho0*epsilon^2)/2) * exp(1-(scaleFactor*(x1^2+x3^2))/R^2))^2");
......
......@@ -8,6 +8,8 @@ using namespace std;
void bflow(string configname)
{
using namespace vf::lbm::dir;
try
{
vf::basics::ConfigurationFile config;
......@@ -16,24 +18,24 @@ void bflow(string configname)
string pathname = config.getValue<string>("pathname");
int numOfThreads = config.getValue<int>("numOfThreads");
vector<int> blocknx = config.getVector<int>("blocknx");
vector<double> boundingBox = config.getVector<double>("boundingBox");
vector<real> boundingBox = config.getVector<real>("boundingBox");
//double nuLB = config.getValue<double>("nuLB");
double endTime = config.getValue<double>("endTime");
double outTime = config.getValue<double>("outTime");
double availMem = config.getValue<double>("availMem");
real endTime = config.getValue<real>("endTime");
real outTime = config.getValue<real>("outTime");
real availMem = config.getValue<real>("availMem");
//int refineLevel = config.getValue<int>("refineLevel");
bool logToFile = config.getValue<bool>("logToFile");
//double restartStep = config.getValue<double>("restartStep");
double deltax = config.getValue<double>("deltax");
real deltax = config.getValue<real>("deltax");
//double cpStep = config.getValue<double>("cpStep");
//double cpStepStart = config.getValue<double>("cpStepStart");
//bool newStart = config.getValue<bool>("newStart");
double forcing = config.getValue<double>("forcing");
real forcing = config.getValue<real>("forcing");
//double n = config.getValue<double>("n");
//double k = config.getValue<double>("k");
//double tau0 = config.getValue<double>("tau0");
double velocity = config.getValue<double>("velocity");
double n = config.getValue<double>("n");
real velocity = config.getValue<real>("velocity");
real n = config.getValue<real>("n");
// double Re = config.getValue<double>("Re");
// double Bn = config.getValue<double>("Bn");
......@@ -58,7 +60,7 @@ void bflow(string configname)
}
}
LBMReal rhoLB = 0.0;
real rhoLB = 0.0;
SPtr<LBMUnitConverter> conv = SPtr<LBMUnitConverter>(new LBMUnitConverter());
......@@ -71,15 +73,15 @@ void bflow(string configname)
//double g_maxX2 = boundingBox[1];
//double g_maxX3 = boundingBox[2];
double g_minX1 = 0.0;
double g_minX2 = -boundingBox[1]/2.0;
double g_minX3 = -boundingBox[2]/2.0;
real g_minX1 = 0.0;
real g_minX2 = -boundingBox[1]/2.0;
real g_minX3 = -boundingBox[2]/2.0;
double g_maxX1 = boundingBox[0];
double g_maxX2 = boundingBox[1]/2.0;
double g_maxX3 = boundingBox[2]/2.0;
real g_maxX1 = boundingBox[0];
real g_maxX2 = boundingBox[1]/2.0;
real g_maxX3 = boundingBox[2]/2.0;
double blockLength = 3.0 * deltax;
real blockLength = 3.0 * deltax;
// double h = (g_maxX2) / 2.0;
// double dex = g_maxX1;
......@@ -89,16 +91,16 @@ void bflow(string configname)
//LBMReal n = 0.4;
double d = boundingBox[1];
double U = velocity;
double Gamma = U / d;
real d = boundingBox[1];
real U = velocity;
real Gamma = U / d;
double k = 0.05; // (U * d) / (Re * std::pow(Gamma, n - 1));
double tau0 = 1e-6;// Bn* k* std::pow(Gamma, n);
real k = 0.05; // (U * d) / (Re * std::pow(Gamma, n - 1));
real tau0 = 1e-6;// Bn* k* std::pow(Gamma, n);
double beta = 14;
double c = 10; // 1.0 / 6.0;
double mu0 = 1e-4;
real beta = 14;
real c = 10; // 1.0 / 6.0;
real mu0 = 1e-4;
SPtr<Rheology> thix = Rheology::getInstance();
//Herschel-Bulkley
......@@ -184,7 +186,7 @@ void bflow(string configname)
////////////////////////////////////////////
//METIS
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_MMM, MetisPartitioner::KWAY));
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, DIR_MMM, MetisPartitioner::KWAY));
////////////////////////////////////////////
/////delete solid blocks
if (myid == 0) UBLOG(logINFO, "deleteSolidBlocks - start");
......@@ -205,8 +207,8 @@ void bflow(string configname)
unsigned long nodb = (blocknx[0]) * (blocknx[1]) * (blocknx[2]);
unsigned long nod = nob * (blocknx[0]) * (blocknx[1]) * (blocknx[2]);
unsigned long nodg = nob * (blocknx[0] + gl) * (blocknx[1] + gl) * (blocknx[1] + gl);
double needMemAll = double(nodg * (27 * sizeof(double) + sizeof(int) + sizeof(float) * 4));
double needMem = needMemAll / double(comm->getNumberOfProcesses());
real needMemAll = real(nodg * (27 * sizeof(real) + sizeof(int) + sizeof(float) * 4));
real needMem = needMemAll / real(comm->getNumberOfProcesses());
if (myid == 0)
{
......
......@@ -9,6 +9,8 @@ using namespace std;
//////////////////////////////////////////////////////////////////////////
void run(string configname)
{
using namespace vf::lbm::dir;
try
{
//DEBUG///////////////////////////////////////
......@@ -18,20 +20,20 @@ void run(string configname)
config.load(configname);
string pathOut = config.getValue<string>("pathOut");
double uLB = config.getValue<double>("uLB");
double restartStep = config.getValue<double>("restartStep");
double cpStart = config.getValue<double>("cpStart");
double cpStep = config.getValue<double>("cpStep");
double endTime = config.getValue<double>("endTime");
double outTime = config.getValue<double>("outTime");
double availMem = config.getValue<double>("availMem");
real uLB = config.getValue<real>("uLB");
real restartStep = config.getValue<real>("restartStep");
real cpStart = config.getValue<real>("cpStart");
real cpStep = config.getValue<real>("cpStep");
real endTime = config.getValue<real>("endTime");
real outTime = config.getValue<real>("outTime");
real availMem = config.getValue<real>("availMem");
int refineLevel = config.getValue<int>("refineLevel");
bool logToFile = config.getValue<bool>("logToFile");
vector<double> nupsStep = config.getVector<double>("nupsStep");
vector<real> nupsStep = config.getVector<real>("nupsStep");
bool newStart = config.getValue<bool>("newStart");
int numOfThreads = config.getValue<int>("numOfThreads");
vector<int> blockNx = config.getVector<int>("blockNx");
double dx = config.getValue<double>("dx");
real dx = config.getValue<real>("dx");
SPtr<vf::mpi::Communicator> comm = vf::mpi::MPICommunicator::getInstance();
int myid = comm->getProcessID();
......@@ -58,18 +60,18 @@ void run(string configname)
double L1 = 2.5;
double L2, L3, H;
real L1 = 2.5;
real L2, L3, H;
L2 = L3 = H = 0.41;
LBMReal Re = 20.0;
LBMReal radius = 0.05;
LBMReal rhoReal = 1.0; //kg/m^3
LBMReal uReal = 0.45;//m/s
LBMReal nueReal = (uReal*radius*2.0)/Re;
real Re = 20.0;
real radius = 0.05;
real rhoReal = 1.0; //kg/m^3
real uReal = 0.45;//m/s
real nueReal = (uReal*radius*2.0)/Re;
LBMReal rhoLB = 0.0;
LBMReal nueLB = (((4.0/9.0)*uLB)*2.0*(radius/dx))/Re;
real rhoLB = 0.0;
real nueLB = (((4.0/9.0)*uLB)*2.0*(radius/dx))/Re;
SPtr<LBMUnitConverter> conv = SPtr<LBMUnitConverter>(new LBMUnitConverter());
......@@ -135,13 +137,13 @@ void run(string configname)
GbSystem3D::writeGeoObject(refCylinder.get(), pathOut+"/geo/refCylinder", WbWriterVtkXmlBinary::getInstance());
//bounding box
double g_minX1 = 0.0;
double g_minX2 = 0.0;
double g_minX3 = 0.0;
real g_minX1 = 0.0;
real g_minX2 = 0.0;
real g_minX3 = 0.0;
double g_maxX1 = L1;
double g_maxX2 = L2;
double g_maxX3 = L3;
real g_maxX1 = L1;
real g_maxX2 = L2;
real g_maxX3 = L3;
SPtr<GbObject3D> gridCube(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_maxX2, g_maxX3));
if (myid==0) GbSystem3D::writeGeoObject(gridCube.get(), pathOut+"/geo/gridCube", WbWriterVtkXmlBinary::getInstance());
......@@ -150,7 +152,7 @@ void run(string configname)
const int blocknx2 = blockNx[1];
const int blocknx3 = blockNx[2];
double blockLength = blocknx1*dx;
real blockLength = blocknx1*dx;
grid->setDeltaX(dx);
grid->setBlockNX(blocknx1, blocknx2, blocknx3);
......@@ -203,7 +205,7 @@ void run(string configname)
SPtr<D3Q27Interactor> outflowInt = SPtr<D3Q27Interactor>(new D3Q27Interactor(geoOutflow, grid, denBCAdapter, Interactor3D::SOLID));
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_00M));
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, DIR_00M));
InteractorsHelper intHelper(grid, metisVisitor);
intHelper.addInteractor(cylinderInt);
intHelper.addInteractor(addWallYminInt);
......@@ -223,8 +225,8 @@ void run(string configname)
unsigned long long numberOfNodesPerBlock = (unsigned long long)(blockNx[0])* (unsigned long long)(blockNx[1])* (unsigned long long)(blockNx[2]);
unsigned long long numberOfNodes = numberOfBlocks * numberOfNodesPerBlock;
unsigned long long numberOfNodesPerBlockWithGhostLayer = numberOfBlocks * (blockNx[0]+ghostLayer) * (blockNx[1]+ghostLayer) * (blockNx[2]+ghostLayer);
double needMemAll = double(numberOfNodesPerBlockWithGhostLayer*(27*sizeof(double)+sizeof(int)+sizeof(float)*4));
double needMem = needMemAll/double(comm->getNumberOfProcesses());
real needMemAll = real(numberOfNodesPerBlockWithGhostLayer*(27*sizeof(real)+sizeof(int)+sizeof(float)*4));
real needMem = needMemAll/real(comm->getNumberOfProcesses());
if (myid==0)
{
......@@ -302,8 +304,8 @@ void run(string configname)
SPtr<CoProcessor> writeMQCoProcessor(new WriteMacroscopicQuantitiesCoProcessor(grid, stepSch, pathOut, WbWriterVtkXmlBinary::getInstance(), conv, comm));
double area = (2.0*radius*H)/(dx*dx);
double v = 4.0*uLB/9.0;
real area = (2.0*radius*H)/(dx*dx);
real v = 4.0*uLB/9.0;
SPtr<UbScheduler> forceSch(new UbScheduler(100));
SPtr<CalculateForcesCoProcessor> fp = make_shared<CalculateForcesCoProcessor>(grid, forceSch, pathOut + "/results/forces.txt", comm, v, area);
fp->addInteractor(cylinderInt);
......
......@@ -248,7 +248,7 @@ void run(const char *cstr)
unsigned long nod = nob * (blocknx1+gl) * (blocknx2+gl) * (blocknx3+gl);
double needMemAll = double(nod*(27*sizeof(double) + sizeof(int) + sizeof(float)*4));
double needMem = needMemAll / double(comm->getNummberOfProcesses());
double needMem = needMemAll / double(comm->getNumberOfProcesses());
if(myid == 0)
{
......
......@@ -262,7 +262,7 @@ void run(const char *cstr)
unsigned long nod = nob * (blocknx1+gl) * (blocknx2+gl) * (blocknx3+gl);
double needMemAll = double(nod*(27*sizeof(double) + sizeof(int) + sizeof(float)*4));
double needMem = needMemAll / double(comm->getNummberOfProcesses());
double needMem = needMemAll / double(comm->getNumberOfProcesses());
if(myid == 0)
{
......
......@@ -8,6 +8,8 @@ using namespace std;
void bflow(string configname)
{
using namespace vf::lbm::dir;
try
{
vf::basics::ConfigurationFile config;
......@@ -16,27 +18,27 @@ void bflow(string configname)
string pathname = config.getValue<string>("pathname");
int numOfThreads = config.getValue<int>("numOfThreads");
vector<int> blocknx = config.getVector<int>("blocknx");
vector<double> boundingBox = config.getVector<double>("boundingBox");
double nuLB = config.getValue<double>("nuLB");
double endTime = config.getValue<double>("endTime");
double outTime = config.getValue<double>("outTime");
double availMem = config.getValue<double>("availMem");
vector<real> boundingBox = config.getVector<real>("boundingBox");
real nuLB = config.getValue<real>("nuLB");
real endTime = config.getValue<real>("endTime");
real outTime = config.getValue<real>("outTime");
real availMem = config.getValue<real>("availMem");
//int refineLevel = config.getValue<int>("refineLevel");
bool logToFile = config.getValue<bool>("logToFile");
//double restartStep = config.getValue<double>("restartStep");
double deltax = config.getValue<double>("deltax");
real deltax = config.getValue<real>("deltax");
//double cpStep = config.getValue<double>("cpStep");
//double cpStepStart = config.getValue<double>("cpStepStart");
//bool newStart = config.getValue<bool>("newStart");
double forcing = config.getValue<double>("forcing");
real forcing = config.getValue<real>("forcing");
//double n = config.getValue<double>("n");
//double k = config.getValue<double>("k");
double tau0 = config.getValue<double>("tau0");
double velocity = config.getValue<double>("velocity");
double n = config.getValue<double>("n");
real tau0 = config.getValue<real>("tau0");
real velocity = config.getValue<real>("velocity");
real n = config.getValue<real>("n");
// double Re = config.getValue<double>("Re");
// double Bn = config.getValue<double>("Bn");
double scaleFactor = config.getValue<double>("scaleFactor");
real scaleFactor = config.getValue<real>("scaleFactor");
SPtr<vf::mpi::Communicator> comm = vf::mpi::MPICommunicator::getInstance();
int myid = comm->getProcessID();
......@@ -59,7 +61,7 @@ void bflow(string configname)
}
}
LBMReal rhoLB = 0.0;
real rhoLB = 0.0;
SPtr<LBMUnitConverter> conv = SPtr<LBMUnitConverter>(new LBMUnitConverter());
......@@ -72,17 +74,17 @@ void bflow(string configname)
//double g_maxX2 = boundingBox[1];
//double g_maxX3 = boundingBox[2]+1.0;
double g_minX1 = 0.0;
double g_minX2 = -boundingBox[1]/2.0;
double g_minX3 = -boundingBox[2]/2.0;
real g_minX1 = 0.0;
real g_minX2 = -boundingBox[1]/2.0;
real g_minX3 = -boundingBox[2]/2.0;
double g_maxX1 = boundingBox[0];
double g_maxX2 = boundingBox[1]/2.0;
double g_maxX3 = boundingBox[2]/2.0;
real g_maxX1 = boundingBox[0];
real g_maxX2 = boundingBox[1]/2.0;
real g_maxX3 = boundingBox[2]/2.0;
double blockLength = 3.0 * deltax;
real blockLength = 3.0 * deltax;
// double h = (g_maxX2) / 2.0;
// double dex = g_maxX1;
......@@ -92,9 +94,9 @@ void bflow(string configname)
//LBMReal n = 0.4;
double d = boundingBox[1];
double U = velocity;
double Gamma = U / d;
real d = boundingBox[1];
real U = velocity;
real Gamma = U / d;
//double scaleFactor = 2.0;
......@@ -108,7 +110,7 @@ void bflow(string configname)
// Acoustic Scaling
double k = nuLB * scaleFactor;
real k = nuLB * scaleFactor;
//double tau0 = 3e-5;
forcing /= scaleFactor;
endTime *= scaleFactor;
......@@ -116,9 +118,9 @@ void bflow(string configname)
//outTime = endTime;
double beta = 14;
double c = 10; // 1.0 / 6.0;
double mu0 = 1e-4;
real beta = 14;
real c = 10; // 1.0 / 6.0;
real mu0 = 1e-4;
SPtr<Rheology> thix = Rheology::getInstance();
//Herschel-Bulkley
......@@ -218,7 +220,7 @@ void bflow(string configname)
////////////////////////////////////////////
//METIS
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_MMM, MetisPartitioner::RECURSIVE));
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, DIR_MMM, MetisPartitioner::RECURSIVE));
////////////////////////////////////////////
/////delete solid blocks
if (myid == 0) UBLOG(logINFO, "deleteSolidBlocks - start");
......@@ -240,8 +242,8 @@ void bflow(string configname)
unsigned long nodb = (blocknx[0]) * (blocknx[1]) * (blocknx[2]);
unsigned long nod = nob * (blocknx[0]) * (blocknx[1]) * (blocknx[2]);
unsigned long nodg = nob * (blocknx[0] + gl) * (blocknx[1] + gl) * (blocknx[1] + gl);
double needMemAll = double(nodg * (27 * sizeof(double) + sizeof(int) + sizeof(float) * 4));
double needMem = needMemAll / double(comm->getNumberOfProcesses());
real needMemAll = real(nodg * (27 * sizeof(real) + sizeof(int) + sizeof(float) * 4));
real needMem = needMemAll / real(comm->getNumberOfProcesses());
if (myid == 0)
{
......
......@@ -8,6 +8,8 @@ using namespace std;
void bflow(string configname)
{
using namespace vf::lbm::dir;
try
{
vf::basics::ConfigurationFile config;
......@@ -16,24 +18,24 @@ void bflow(string configname)
string outputPath = config.getValue<string>("outputPath");
int numOfThreads = config.getValue<int>("numOfThreads");
vector<int> blocknx = config.getVector<int>("blocknx");
vector<double> boundingBox = config.getVector<double>("boundingBox");
vector<real> boundingBox = config.getVector<real>("boundingBox");
//double nuLB = config.getValue<double>("nuLB");
double endTime = config.getValue<double>("endTime");
double outTime = config.getValue<double>("outTime");
double availMem = config.getValue<double>("availMem");
real endTime = config.getValue<real>("endTime");
real outTime = config.getValue<real>("outTime");
real availMem = config.getValue<real>("availMem");
int refineLevel = config.getValue<int>("refineLevel");
bool logToFile = config.getValue<bool>("logToFile");
double restartStep = config.getValue<double>("restartStep");
double deltax = config.getValue<double>("deltax");
double radius = config.getValue<double>("radius");
double cpStep = config.getValue<double>("cpStep");
double cpStart = config.getValue<double>("cpStart");
real restartStep = config.getValue<real>("restartStep");
real deltax = config.getValue<real>("deltax");
real radius = config.getValue<real>("radius");
real cpStep = config.getValue<real>("cpStep");
real cpStart = config.getValue<real>("cpStart");
bool newStart = config.getValue<bool>("newStart");
double velocity = config.getValue<double>("velocity");
double n = config.getValue<double>("n");
double Re = config.getValue<double>("Re");
double Bn = config.getValue<double>("Bn");
vector<double> sphereCenter = config.getVector<double>("sphereCenter");
real velocity = config.getValue<real>("velocity");
real n = config.getValue<real>("n");
real Re = config.getValue<real>("Re");
real Bn = config.getValue<real>("Bn");
vector<real> sphereCenter = config.getVector<real>("sphereCenter");
SPtr<vf::mpi::Communicator> comm = vf::mpi::MPICommunicator::getInstance();
int myid = comm->getProcessID();
......@@ -56,19 +58,19 @@ void bflow(string configname)
}
}
LBMReal rhoLB = 0.0;
real rhoLB = 0.0;
SPtr<LBMUnitConverter> conv = SPtr<LBMUnitConverter>(new LBMUnitConverter());
//bounding box
double g_minX1 = 0;
double g_minX2 = 0;
double g_minX3 = 0;
real g_minX1 = 0;
real g_minX2 = 0;
real g_minX3 = 0;
double g_maxX1 = boundingBox[0];
double g_maxX2 = boundingBox[1];
double g_maxX3 = boundingBox[2];
real g_maxX1 = boundingBox[0];
real g_maxX2 = boundingBox[1];
real g_maxX3 = boundingBox[2];
//double g_minX1 = -boundingBox[0]/2.0;
//double g_minX2 = -boundingBox[1] / 2.0;
......@@ -78,21 +80,21 @@ void bflow(string configname)
//double g_maxX2 = boundingBox[1]/2.0;
//double g_maxX3 = boundingBox[2]/2.0;
double blockLength = 3.0 * deltax;
real blockLength = 3.0 * deltax;
double d = 2.0 * radius;
double U = velocity;
double Gamma = U / d;
real d = 2.0 * radius;
real U = velocity;
real Gamma = U / d;
double k = (U * d) / (Re * std::pow(Gamma, n - 1));
double tau0 = Bn * k * std::pow(Gamma, n);
real k = (U * d) / (Re * std::pow(Gamma, n - 1));
real tau0 = Bn * k * std::pow(Gamma, n);
//double k = 0.05; // (U * d) / (Re * std::pow(Gamma, n - 1));
//double tau0 = 3e-6; //Bn * k * std::pow(Gamma, n);
//double forcing = 8e-7;
double omegaMin = 1.0e-8;
real omegaMin = 1.0e-8;
SPtr<Rheology> thix = Rheology::getInstance();
thix->setPowerIndex(n);
......@@ -161,7 +163,7 @@ void bflow(string configname)
////////////////////////////////////////////
//METIS
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_MMM, MetisPartitioner::KWAY));
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, DIR_MMM, MetisPartitioner::KWAY));
////////////////////////////////////////////
//////////////////////////////////////////////////////////////////////////
//restart
......@@ -243,7 +245,7 @@ void bflow(string configname)
////////////////////////////////////////////
//METIS
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_MMM, MetisPartitioner::KWAY));
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, DIR_MMM, MetisPartitioner::KWAY));
////////////////////////////////////////////
/////delete solid blocks
if (myid == 0) UBLOG(logINFO, "deleteSolidBlocks - start");
......@@ -267,8 +269,8 @@ void bflow(string configname)
unsigned long nodb = (blocknx[0]) * (blocknx[1]) * (blocknx[2]);
unsigned long nod = nob * (blocknx[0]) * (blocknx[1]) * (blocknx[2]);
unsigned long nodg = nob * (blocknx[0] + gl) * (blocknx[1] + gl) * (blocknx[1] + gl);
double needMemAll = double(nodg * (27 * sizeof(double) + sizeof(int) + sizeof(float) * 4));
double needMem = needMemAll / double(comm->getNumberOfProcesses());
real needMemAll = real(nodg * (27 * sizeof(real) + sizeof(int) + sizeof(float) * 4));
real needMem = needMemAll / real(comm->getNumberOfProcesses());
if (myid == 0)
{
......@@ -341,7 +343,7 @@ void bflow(string configname)
SPtr<WriteMacroscopicQuantitiesCoProcessor> writeMQCoProcessor(new WriteMacroscopicQuantitiesCoProcessor(grid, visSch, outputPath, WbWriterVtkXmlBinary::getInstance(), SPtr<LBMUnitConverter>(new LBMUnitConverter()), comm));
//writeMQCoProcessor->process(0);
double area = UbMath::PI*radius*radius;
real area = UbMath::PI*radius*radius;
SPtr<UbScheduler> forceSch(new UbScheduler(100));
SPtr<CalculateForcesCoProcessor> fp = make_shared<CalculateForcesCoProcessor>(grid, forceSch, outputPath + "/forces/forces.txt", comm, velocity, area);
fp->addInteractor(sphereInt);
......
......@@ -6,13 +6,15 @@
using namespace std;
void setInflowBC(double x1, double x2, double x3, double radius, int dir)
void setInflowBC(real x1, real x2, real x3, real radius, int dir)
{
}
void run(string configname)
{
using namespace vf::lbm::dir;
try {
// Sleep(30000);
......@@ -27,7 +29,7 @@ void run(string configname)
vector<int> blocknx = config.getVector<int>("blocknx");
//vector<double> boundingBox = config.getVector<double>("boundingBox");
// vector<double> length = config.getVector<double>("length");
double U_LB = config.getValue<double>("U_LB");
real U_LB = config.getValue<real>("U_LB");
// double uF2 = config.getValue<double>("uF2");
//double nuL = config.getValue<double>("nuL");
//double nuG = config.getValue<double>("nuG");
......@@ -35,23 +37,23 @@ void run(string configname)
//double sigma = config.getValue<double>("sigma");
int interfaceWidth = config.getValue<int>("interfaceWidth");
//double D = config.getValue<double>("D");
double theta = config.getValue<double>("contactAngle");
double D_LB = config.getValue<double>("D_LB");
double phiL = config.getValue<double>("phi_L");
double phiH = config.getValue<double>("phi_H");
double tauH = config.getValue<double>("Phase-field Relaxation");
double mob = config.getValue<double>("Mobility");
double endTime = config.getValue<double>("endTime");
double outTime = config.getValue<double>("outTime");
double availMem = config.getValue<double>("availMem");
real theta = config.getValue<real>("contactAngle");
real D_LB = config.getValue<real>("D_LB");
real phiL = config.getValue<real>("phi_L");
real phiH = config.getValue<real>("phi_H");
real tauH = config.getValue<real>("Phase-field Relaxation");
real mob = config.getValue<real>("Mobility");
real endTime = config.getValue<real>("endTime");
real outTime = config.getValue<real>("outTime");
real availMem = config.getValue<real>("availMem");
//int refineLevel = config.getValue<int>("refineLevel");
//double Re = config.getValue<double>("Re");
bool logToFile = config.getValue<bool>("logToFile");
double restartStep = config.getValue<double>("restartStep");
double cpStart = config.getValue<double>("cpStart");
double cpStep = config.getValue<double>("cpStep");
real restartStep = config.getValue<real>("restartStep");
real cpStart = config.getValue<real>("cpStart");
real cpStep = config.getValue<real>("cpStep");
bool newStart = config.getValue<bool>("newStart");
......@@ -81,7 +83,7 @@ void run(string configname)
// Sleep(30000);
double rho_h=0, rho_l=0, r_rho=0, mu_h=0, /*mu_l,*/ Uo=0, D=0, sigma=0;
real rho_h=0, rho_l=0, r_rho=0, mu_h=0, /*mu_l,*/ Uo=0, D=0, sigma=0;
switch (caseN) {
case 1:
......@@ -140,23 +142,23 @@ void run(string configname)
break;
}
double Re = rho_h * Uo * D / mu_h;
double We = rho_h * Uo * Uo * D / sigma;
real Re = rho_h * Uo * D / mu_h;
real We = rho_h * Uo * Uo * D / sigma;
double dx = D / D_LB;
double nu_h = U_LB * D_LB / Re;
double nu_l = nu_h;
real dx = D / D_LB;
real nu_h = U_LB * D_LB / Re;
real nu_l = nu_h;
double rho_h_LB = 1;
real rho_h_LB = 1;
//surface tension
double sigma_LB = rho_h_LB * U_LB * U_LB * D_LB / We;
real sigma_LB = rho_h_LB * U_LB * U_LB * D_LB / We;
// LBMReal dLB = 0; // = length[1] / dx;
LBMReal rhoLB = 0.0;
real rhoLB = 0.0;
//LBMReal nuLB = nu_l; //(uLB*dLB) / Re;
double beta = 12.0 * sigma_LB / interfaceWidth;
double kappa = 1.5 * interfaceWidth * sigma_LB;
real beta = 12.0 * sigma_LB / interfaceWidth;
real kappa = 1.5 * interfaceWidth * sigma_LB;
if (myid == 0) {
UBLOG(logINFO, "Parameters:");
......@@ -219,7 +221,7 @@ void run(string configname)
grid->setGhostLayerWidth(2);
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(
comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_MMM, MetisPartitioner::RECURSIVE));
comm, MetisPartitioningGridVisitor::LevelBased, DIR_MMM, MetisPartitioner::RECURSIVE));
//////////////////////////////////////////////////////////////////////////
// restart
......@@ -251,7 +253,7 @@ void run(string configname)
fctF2.SetExpr("vy1");
fctF2.DefineConst("vy1", U_LB);
double startTime = 1;
real startTime = 1;
SPtr<BCAdapter> velBCAdapterF1(
new MultiphaseVelocityBCAdapter(true, false, false, fctF1, phiH, 0.0, startTime));
SPtr<BCAdapter> velBCAdapterF2(
......@@ -293,17 +295,17 @@ void run(string configname)
// if (newStart) {
// bounding box
double g_minX1 = 0;
double g_minX2 = 0;
double g_minX3 = 0;
real g_minX1 = 0;
real g_minX2 = 0;
real g_minX3 = 0;
//double g_maxX1 = 8.0*D;
//double g_maxX2 = 2.5*D;
//double g_maxX3 = 2.5*D;
double g_maxX1 = 1.0 * D; // 8.0 * D;
double g_maxX2 = 2.0 * D;
double g_maxX3 = 2.0 * D;
real g_maxX1 = 1.0 * D; // 8.0 * D;
real g_maxX2 = 2.0 * D;
real g_maxX3 = 2.0 * D;
// geometry
SPtr<GbObject3D> gridCube(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_maxX2, g_maxX3));
......@@ -452,9 +454,9 @@ void run(string configname)
unsigned long long numberOfNodes = numberOfBlocks * numberOfNodesPerBlock;
unsigned long long numberOfNodesPerBlockWithGhostLayer =
numberOfBlocks * (blocknx[0] + ghostLayer) * (blocknx[1] + ghostLayer) * (blocknx[2] + ghostLayer);
double needMemAll =
double(numberOfNodesPerBlockWithGhostLayer * (27 * sizeof(double) + sizeof(int) + sizeof(float) * 4));
double needMem = needMemAll / double(comm->getNumberOfProcesses());
real needMemAll =
real(numberOfNodesPerBlockWithGhostLayer * (27 * sizeof(real) + sizeof(int) + sizeof(float) * 4));
real needMem = needMemAll / real(comm->getNumberOfProcesses());
if (myid == 0) {
UBLOG(logINFO, "Number of blocks = " << numberOfBlocks);
......@@ -486,9 +488,9 @@ void run(string configname)
//mu::Parser fct1;
//fct1.SetExpr("phiL");
//fct1.DefineConst("phiL", phiL);
LBMReal x1c = 0; // (g_maxX1 - g_minX1-1)/2; //
LBMReal x2c = (g_maxX2 - g_minX2)/2;
LBMReal x3c = (g_maxX3 - g_minX3)/2;
real x1c = 0; // (g_maxX1 - g_minX1-1)/2; //
real x2c = (g_maxX2 - g_minX2)/2;
real x3c = (g_maxX3 - g_minX3)/2;
mu::Parser fct1;
fct1.SetExpr("0.5-0.5*tanh(2*(sqrt((x1-x1c)^2+(x2-x2c)^2+(x3-x3c)^2)-radius)/interfaceThickness)");
......@@ -574,7 +576,7 @@ void run(string configname)
grid->accept(setConnsVisitor);
SPtr<UbScheduler> visSch(new UbScheduler(outTime));
double t_ast, t;
real t_ast, t;
t_ast = 7.19;
t = (int)(t_ast/(U_LB/(D_LB)));
visSch->addSchedule(t,t,t); //t=7.19
......
......@@ -9,6 +9,8 @@ using namespace std;
void run(string configname)
{
using namespace vf::lbm::dir;
try
{
vf::basics::ConfigurationFile config;
......@@ -17,18 +19,18 @@ void run(string configname)
string pathname = config.getValue<string>("pathname");
int numOfThreads = config.getValue<int>("numOfThreads");
vector<int> blocknx = config.getVector<int>("blocknx");
double uLB = config.getValue<double>("uLB");
double endTime = config.getValue<double>("endTime");
double outTime = config.getValue<double>("outTime");
double availMem = config.getValue<double>("availMem");
real uLB = config.getValue<real>("uLB");
real endTime = config.getValue<real>("endTime");
real outTime = config.getValue<real>("outTime");
real availMem = config.getValue<real>("availMem");
int refineLevel = config.getValue<int>("refineLevel");
double Re = config.getValue<double>("Re");
double dx = config.getValue<double>("dx");
vector<double> length = config.getVector<double>("length");
real Re = config.getValue<real>("Re");
real dx = config.getValue<real>("dx");
vector<real> length = config.getVector<real>("length");
bool logToFile = config.getValue<bool>("logToFile");
double restartStep = config.getValue<double>("restartStep");
double cpStart = config.getValue<double>("cpStart");
double cpStep = config.getValue<double>("cpStep");
real restartStep = config.getValue<real>("restartStep");
real cpStart = config.getValue<real>("cpStart");
real cpStep = config.getValue<real>("cpStep");
bool newStart = config.getValue<bool>("newStart");
SPtr<vf::mpi::Communicator> comm = vf::mpi::MPICommunicator::getInstance();
......@@ -56,9 +58,9 @@ void run(string configname)
//Sleep(30000);
LBMReal dLB = length[1] / dx;
LBMReal rhoLB = 0.0;
LBMReal nuLB = (uLB*dLB) / Re;
real dLB = length[1] / dx;
real rhoLB = 0.0;
real nuLB = (uLB*dLB) / Re;
SPtr<LBMUnitConverter> conv = SPtr<LBMUnitConverter>(new LBMUnitConverter());
......@@ -108,7 +110,7 @@ void run(string configname)
kernel->setBCProcessor(bcProc);
//////////////////////////////////////////////////////////////////////////
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_00M));
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, DIR_00M));
//restart
SPtr<UbScheduler> mSch(new UbScheduler(cpStep, cpStart));
//SPtr<MPIIOMigrationCoProcessor> migCoProcessor(new MPIIOMigrationCoProcessor(grid, mSch, metisVisitor, pathname + "/mig", comm));
......@@ -126,13 +128,13 @@ void run(string configname)
{
//bounding box
double g_minX1 = 0.0;
double g_minX2 = -length[1] / 2.0;
double g_minX3 = -length[2] / 2.0;
real g_minX1 = 0.0;
real g_minX2 = -length[1] / 2.0;
real g_minX3 = -length[2] / 2.0;
double g_maxX1 = length[0];
double g_maxX2 = length[1] / 2.0;
double g_maxX3 = length[2] / 2.0;
real g_maxX1 = length[0];
real g_maxX2 = length[1] / 2.0;
real g_maxX3 = length[2] / 2.0;
//geometry
//x
......@@ -145,7 +147,7 @@ void run(string configname)
if (myid == 0) GbSystem3D::writeGeoObject(gridCube.get(), pathname + "/geo/gridCube", WbWriterVtkXmlBinary::getInstance());
double blockLength = blocknx[0] * dx;
real blockLength = blocknx[0] * dx;
......@@ -235,8 +237,8 @@ void run(string configname)
unsigned long long numberOfNodesPerBlock = (unsigned long long)(blocknx[0])* (unsigned long long)(blocknx[1])* (unsigned long long)(blocknx[2]);
unsigned long long numberOfNodes = numberOfBlocks * numberOfNodesPerBlock;
unsigned long long numberOfNodesPerBlockWithGhostLayer = numberOfBlocks * (blocknx[0] + ghostLayer) * (blocknx[1] + ghostLayer) * (blocknx[2] + ghostLayer);
double needMemAll = double(numberOfNodesPerBlockWithGhostLayer*(27 * sizeof(double) + sizeof(int) + sizeof(float) * 4));
double needMem = needMemAll / double(comm->getNumberOfProcesses());
real needMemAll = real(numberOfNodesPerBlockWithGhostLayer*(27 * sizeof(real) + sizeof(int) + sizeof(float) * 4));
real needMem = needMemAll / real(comm->getNumberOfProcesses());
if (myid == 0)
{
......@@ -355,7 +357,7 @@ void run(string configname)
int main(int argc, char *argv[])
{
try {
vf::logging::Logger::initalizeLogger();
vf::logging::Logger::initializeLogger();
VF_LOG_INFO("Starting VirtualFluids...");
......
......@@ -8,6 +8,8 @@ using namespace std;
void run(string configname)
{
using namespace vf::lbm::dir;
try {
//Sleep(30000);
......@@ -20,37 +22,37 @@ void run(string configname)
string geoFile = config.getValue<string>("geoFile");
int numOfThreads = config.getValue<int>("numOfThreads");
vector<int> blocknx = config.getVector<int>("blocknx");
vector<double> boundingBox = config.getVector<double>("boundingBox");
vector<real> boundingBox = config.getVector<real>("boundingBox");
// vector<double> length = config.getVector<double>("length");
double uLB = config.getValue<double>("uLB");
real uLB = config.getValue<real>("uLB");
// double uF2 = config.getValue<double>("uF2");
double nuL = config.getValue<double>("nuL");
double nuG = config.getValue<double>("nuG");
double densityRatio = config.getValue<double>("densityRatio");
double sigma = config.getValue<double>("sigma");
real nuL = config.getValue<real>("nuL");
real nuG = config.getValue<real>("nuG");
real densityRatio = config.getValue<real>("densityRatio");
real sigma = config.getValue<real>("sigma");
int interfaceWidth = config.getValue<int>("interfaceWidth");
//double radius = config.getValue<double>("radius");
double theta = config.getValue<double>("contactAngle");
double gr = config.getValue<double>("gravity");
double phiL = config.getValue<double>("phi_L");
double phiH = config.getValue<double>("phi_H");
double tauH = config.getValue<double>("Phase-field Relaxation");
double mob = config.getValue<double>("Mobility");
double endTime = config.getValue<double>("endTime");
double outTime = config.getValue<double>("outTime");
double availMem = config.getValue<double>("availMem");
real theta = config.getValue<real>("contactAngle");
real gr = config.getValue<real>("gravity");
real phiL = config.getValue<real>("phi_L");
real phiH = config.getValue<real>("phi_H");
real tauH = config.getValue<real>("Phase-field Relaxation");
real mob = config.getValue<real>("Mobility");
real endTime = config.getValue<real>("endTime");
real outTime = config.getValue<real>("outTime");
real availMem = config.getValue<real>("availMem");
int refineLevel = config.getValue<int>("refineLevel");
double Re = config.getValue<double>("Re");
double dx = config.getValue<double>("dx");
real Re = config.getValue<real>("Re");
real dx = config.getValue<real>("dx");
bool logToFile = config.getValue<bool>("logToFile");
double restartStep = config.getValue<double>("restartStep");
double cpStart = config.getValue<double>("cpStart");
double cpStep = config.getValue<double>("cpStep");
real restartStep = config.getValue<real>("restartStep");
real cpStart = config.getValue<real>("cpStart");
real cpStep = config.getValue<real>("cpStep");
bool newStart = config.getValue<bool>("newStart");
double beta = 12 * sigma / interfaceWidth;
double kappa = 1.5 * interfaceWidth * sigma;
real beta = 12 * sigma / interfaceWidth;
real kappa = 1.5 * interfaceWidth * sigma;
SPtr<vf::mpi::Communicator> comm = vf::mpi::MPICommunicator::getInstance();
int myid = comm->getProcessID();
......@@ -76,8 +78,8 @@ void run(string configname)
// Sleep(30000);
// LBMReal dLB = 0; // = length[1] / dx;
LBMReal rhoLB = 0.0;
LBMReal nuLB = nuL; //(uLB*dLB) / Re;
real rhoLB = 0.0;
real nuLB = nuL; //(uLB*dLB) / Re;
SPtr<LBMUnitConverter> conv(new LBMUnitConverter());
......@@ -122,7 +124,7 @@ void run(string configname)
grid->setGhostLayerWidth(2);
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, D3Q27System::DIR_MMM, MetisPartitioner::RECURSIVE));
SPtr<Grid3DVisitor> metisVisitor(new MetisPartitioningGridVisitor(comm, MetisPartitioningGridVisitor::LevelBased, DIR_MMM, MetisPartitioner::RECURSIVE));
//////////////////////////////////////////////////////////////////////////
// restart
......@@ -154,7 +156,7 @@ void run(string configname)
fctF2.SetExpr("vy1");
fctF2.DefineConst("vy1", uLB);
double startTime = 30;
real startTime = 30;
SPtr<BCAdapter> velBCAdapterF1(new MultiphaseVelocityBCAdapter(true, false, false, fctF1, phiH, 0.0, startTime));
SPtr<BCAdapter> velBCAdapterF2(new MultiphaseVelocityBCAdapter(true, false, false, fctF2, phiH, startTime, endTime));
......@@ -199,13 +201,13 @@ void run(string configname)
double g_maxX2 = length[1] / 2.0;
double g_maxX3 = length[2] / 2.0;*/
double g_minX1 = boundingBox[0];
double g_minX2 = boundingBox[2];
double g_minX3 = boundingBox[4];
real g_minX1 = boundingBox[0];
real g_minX2 = boundingBox[2];
real g_minX3 = boundingBox[4];
double g_maxX1 = boundingBox[1];
double g_maxX2 = boundingBox[3];
double g_maxX3 = boundingBox[5];
real g_maxX1 = boundingBox[1];
real g_maxX2 = boundingBox[3];
real g_maxX3 = boundingBox[5];
// geometry
SPtr<GbObject3D> gridCube(new GbCuboid3D(g_minX1, g_minX2, g_minX3, g_maxX1, g_maxX2, g_maxX3));
......@@ -330,9 +332,9 @@ void run(string configname)
unsigned long long numberOfNodes = numberOfBlocks * numberOfNodesPerBlock;
unsigned long long numberOfNodesPerBlockWithGhostLayer =
numberOfBlocks * (blocknx[0] + ghostLayer) * (blocknx[1] + ghostLayer) * (blocknx[2] + ghostLayer);
double needMemAll =
double(numberOfNodesPerBlockWithGhostLayer * (27 * sizeof(double) + sizeof(int) + sizeof(float) * 4));
double needMem = needMemAll / double(comm->getNumberOfProcesses());
real needMemAll =
real(numberOfNodesPerBlockWithGhostLayer * (27 * sizeof(real) + sizeof(int) + sizeof(float) * 4));
real needMem = needMemAll / real(comm->getNumberOfProcesses());
if (myid == 0) {
UBLOG(logINFO, "Number of blocks = " << numberOfBlocks);
......
File deleted
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment