Skip to content
Snippets Groups Projects
Commit 7d20751f authored by Markus Holzer's avatar Markus Holzer
Browse files

FirstTry

parent 7ba31bd1
Branches
No related tags found
No related merge requests found
Pipeline #71882 failed
......@@ -36,6 +36,11 @@ void init_TPMS(const shared_ptr< StructuredBlockStorage >& blocks, const BlockDa
const FlagUID boundaryFlagUID,
const real_t kx, const real_t ky, const real_t kz)
{
const real_t parts = real_c(blocks->getDomainCellBB().xMax()) / real_c(10.0);
const real_t start = parts * real_c(2.0);
const real_t end1 = parts * real_c(5.0);
const real_t end2 = parts * real_c(8.0);
const real_t strut = real_c(0.0);
for (auto& block : *blocks)
......@@ -44,8 +49,33 @@ void init_TPMS(const shared_ptr< StructuredBlockStorage >& blocks, const BlockDa
const auto boundaryFlag = flagField->getOrRegisterFlag(boundaryFlagUID);
WALBERLA_FOR_ALL_CELLS_INCLUDING_GHOST_LAYER_XYZ(flagField, Cell globalCell;
blocks->transformBlockLocalToGlobalCell(globalCell, block, Cell(x, y, z));
const real_t dist = cos(kx * x) * sin(ky * y) + cos(ky * y) * sin(kz * z) + cos(kz * z) * sin(kx * x);
if (dist >= strut) addFlag(flagField->get(x, y, z), boundaryFlag);)
if (globalCell[0] > start && globalCell[0] <= end1)
{
const real_t kxi = kx;
const real_t kyi = ky;
const real_t kzi = kz;
const real_t dist = cos(kxi * x) * sin(kyi * y) + cos(kyi * y) * sin(kzi * z) + cos(kzi * z) * sin(kxi * x);
if (dist >= strut)
{
addFlag(flagField->get(x, y, z), boundaryFlag);
}
}
if (globalCell[0] > end1 && globalCell[0] <= end2)
{
const real_t kxi = kx / real_c(10.0);
const real_t kyi = ky / real_c(10.0);
const real_t kzi = kz / real_c(10.0);
const real_t dist = cos(kxi * x) * sin(kyi * y) + cos(kyi * y) * sin(kzi * z) + cos(kzi * z) * sin(kxi * x);
if (dist >= strut)
{
addFlag(flagField->get(x, y, z), boundaryFlag);
}
}
)
}
}
} // namespace walberla
......@@ -28,6 +28,7 @@
#include "core/debug/CheckFunctions.h"
#include "core/logging/Logging.h"
#include "core/math/Vector3.h"
#include "core/math/Constants.h"
#include "core/Environment.h"
#include "core/mpi/MPIManager.h"
#include "core/MemoryUsage.h"
......@@ -124,7 +125,7 @@ int main(int argc, char** argv)
const real_t machNumber = inflowVelocity / speedOfSound;
// TODO define RE
const real_t viscosity = real_c((inflowVelocity * 1.0) / reynoldsNumber);
const real_t omega = real_c(real_c(1.0) / (real_c(3.0) * viscosity + real_c(0.5)));
const real_t omega = 1.5; // real_c(real_c(1.0) / (real_c(3.0) * viscosity + real_c(0.5)));
IDs ids;
......@@ -162,7 +163,7 @@ int main(int argc, char** argv)
{
WALBERLA_LOG_INFO_ON_ROOT("Setting boundary conditions")
geometry::initBoundaryHandling< FlagField_T >(*blocks, ids.flagField, boundariesConfig);
const real_t test = 6;
const real_t test = 6.0; // 'math::pi * real_c(1.0);
init_TPMS(blocks, ids.flagField, wallFlagUID, test, test, test);
geometry::setNonBoundaryCellsToDomain< FlagField_T >(*blocks, ids.flagField, fluidFlagUID);
}
......
......@@ -6,7 +6,7 @@ Parameters
latticeVelocity 0.05;
initialiseWithInletVelocity true;
timesteps 2;
timesteps 5001;
processMemoryLimit 512; // MiB
innerOuterSplit <1, 1, 1>;
......@@ -40,7 +40,7 @@ StabilityChecker
VTKWriter
{
vtkWriteFrequency 1;
vtkWriteFrequency 1000;
vtkGhostLayers 0;
velocity true;
density true;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment