Skip to content
Snippets Groups Projects
Commit 3f25e5e4 authored by Christoph Schwarzmeier's avatar Christoph Schwarzmeier
Browse files

Fix bug in hydrostatic pressure [ci skip]

parent 002a0f56
Branches TaylorBubble
No related tags found
No related merge requests found
Pipeline #38132 skipped
......@@ -13,7 +13,7 @@ waLBerla_generate_target_from_python(NAME PhaseFieldCodeGenGPU
PackInfo_phase_field_distributions.cu PackInfo_phase_field_distributions.h
PackInfo_phase_field.cu PackInfo_phase_field.h
PackInfo_velocity_based_distributions.cu PackInfo_velocity_based_distributions.h
# ContactAngle.cu ContactAngle.h
ContactAngle.cu ContactAngle.h
GenDefines.h)
waLBerla_add_executable(NAME multiphaseGPU
......
......@@ -39,12 +39,12 @@ void init_hydrostatic_pressure(const shared_ptr< StructuredBlockStorage >& block
for (auto& block : *blocks)
{
auto densityField = block.getData< PhaseField_T >(densityFieldID);
// clang-format off
WALBERLA_FOR_ALL_CELLS_INCLUDING_GHOST_LAYER_XYZ(densityField, Cell globalCell;
blocks->transformBlockLocalToGlobalCell(globalCell, block, Cell(x, y, z));
real_t pressure = 3.0 * GravitationalAcceleration * (globalCell[1] - poolDepth);
densityField->get(x, y, z) += pressure;)
// clang-format on
WALBERLA_FOR_ALL_CELLS_XYZ(densityField, {
Cell globalCell;
blocks->transformBlockLocalToGlobalCell(globalCell, block, Cell(x, y, z));
real_t pressure = real_c(3.0) * GravitationalAcceleration * (globalCell[1] - poolDepth);
densityField->get(x, y, z) += pressure;
}) // WALBERLA_FOR_ALL_CELLS_XYZ
}
}
......
......@@ -171,7 +171,7 @@ int main(int argc, char** argv)
initTaylorBubbleCylindric(blocks, phase_field, BubbleRadius, InitialHeight, Length,
real_c(interface_thickness));
init_hydrostatic_pressure(blocks, density_field, gravitational_acceleration, real_c(domainSize[1]) * real_c(0.5));
cuda::fieldCpy< GPUField, PhaseField_T >(blocks, phase_field_gpu, density_field);
cuda::fieldCpy< GPUField, PhaseField_T >(blocks, density_field_gpu, density_field);
}
WALBERLA_LOG_INFO_ON_ROOT("initialization of the phase field done")
......
......@@ -204,8 +204,8 @@ with CodeGeneration() as ctx:
generate_pack_info_for_field(ctx, 'PackInfo_phase_field', C, target=Target.GPU)
# pystencils_walberla.boundary.generate_boundary(ctx, 'ContactAngle', contact_angle,
# C.name, stencil_hydro, index_shape=[], target=Target.GPU)
pystencils_walberla.boundary.generate_boundary(ctx, 'ContactAngle', contact_angle,
C.name, stencil_hydro, index_shape=[], target=Target.GPU)
generate_info_header(ctx, 'GenDefines', stencil_typedefs=stencil_typedefs, field_typedefs=field_typedefs,
additional_code=additional_code)
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment