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

Use force density in antidunes showcase

parent 584c4217
No related merge requests found
This diff is collapsed.
...@@ -11,10 +11,10 @@ BlockForestParameters ...@@ -11,10 +11,10 @@ BlockForestParameters
DomainParameters DomainParameters
{ {
domainSize <3200, 60, 160>; domainSize <3200, 60, 160>;
wavePeriods 1; // never set to 0 -> division by zero, even if you initialize a flat particle bed wavePeriods 1; // never set to 0 -> division by zero, even if you initialize a flat particle bed
liquidHeightFactor 2.9655; // h_0 / d (water height / avg particle diameter) -> from experiment [E1 = 2.9655, E4 = 3.5862] liquidHeightFactor 2.862; // h_0 / d (water height / avg particle diameter) -> from experiment [E1=2.862, E2=3.1724, E3=3.27586, E4=3.5862]
floorHeightFactor 4.1393; // from domain bottom to sine's average floorHeightFactor 4.1393; // from domain bottom to sine's average
initialAmplitude 0; // defined from minimum peak to maximum peak as by Pascal et al. (2021) initialAmplitude 0; // defined from minimum peak to maximum peak as by Pascal et al. (2021)
} }
PIDParameters PIDParameters
...@@ -32,9 +32,9 @@ PhysicsParameters ...@@ -32,9 +32,9 @@ PhysicsParameters
{ {
enableWetting false; enableWetting false;
timesteps 2000000; timesteps 2000000;
Re 3100; // [E1=3100, E4=4800] Re 3100; // [E1=3100, E2=3772, E3=4180, E4=4800]
Fr 1.31; // [E1=1.31, E4=1.45] Fr 1.31; // [E1=1.31, E2=1.38, E3=1.44, E4=1.45]
We 15.6188; // [E1=15.6188 , E4=30.2493] We 15.6188; // [E1=15.6188, E2=21.48, E3=25.54, E4=30.2493]
} }
ParticleParameters ParticleParameters
...@@ -55,9 +55,8 @@ ModelParameters ...@@ -55,9 +55,8 @@ ModelParameters
{ {
pdfReconstructionModel OnlyMissing; pdfReconstructionModel OnlyMissing;
pdfRefillingModel EquilibriumRefilling; pdfRefillingModel EquilibriumRefilling;
excessMassDistributionModel EvenlyAllInterface; excessMassDistributionModel EvenlyNewInterfaceFallbackLiquid;
curvatureModel FiniteDifferenceMethod; curvatureModel FiniteDifferenceMethod;
enableForceWeighting false;
useSimpleMassExchange false; useSimpleMassExchange false;
cellConversionThreshold 1e-2; cellConversionThreshold 1e-2;
cellConversionForceThreshold 1e-1; cellConversionForceThreshold 1e-1;
......
import sympy as sp import sympy as sp
import pystencils as ps
from lbmpy.creationfunctions import LBMConfig, LBMOptimisation, create_lb_collision_rule from lbmpy.creationfunctions import LBMConfig, LBMOptimisation, create_lb_collision_rule
from lbmpy.enums import ForceModel, Method, Stencil from lbmpy.enums import ForceModel, Method, Stencil
from lbmpy.stencils import LBStencil from lbmpy.stencils import LBStencil
...@@ -7,64 +7,30 @@ from lbmpy.stencils import LBStencil ...@@ -7,64 +7,30 @@ from lbmpy.stencils import LBStencil
from pystencils_walberla import CodeGeneration from pystencils_walberla import CodeGeneration
from lbmpy_walberla import generate_lattice_model from lbmpy_walberla import generate_lattice_model
# general parameters with CodeGeneration() as ctx:
generatedMethod = "Cumulants" # "TRT", "SRT" # general parameters
stencilStr = "D3Q27" layout = 'fzyx'
stencil = LBStencil(Stencil.D3Q19 if stencilStr == "D3Q19" else Stencil.D3Q27) data_type = "float64" if ctx.double_accuracy else "float32"
force = sp.symbols("force_:3")
layout = "fzyx" stencil = LBStencil(Stencil.D3Q27)
omega = sp.Symbol('omega')
force_field = ps.fields(f"force(3): {data_type}[3D]", layout=layout)
if generatedMethod == "Cumulants":
omega = sp.Symbol("omega")
# method definition
lbm_config = LBMConfig(
stencil=stencil,
method=Method.CUMULANT,
relaxation_rate=omega,
compressible=True,
force=force,
zero_centered=False,
streaming_pattern="pull",
galilean_correction=True if stencil == LBStencil(Stencil.D3Q27) else False,
) # free surface implementation only works with pull pattern
elif generatedMethod == "TRT":
omega_e = sp.Symbol("omega_e")
omega_o = sp.Symbol("omega_o")
# method definition
lbm_config = LBMConfig(
stencil=stencil,
method=Method.TRT,
smagorinsky=False,
relaxation_rates=[omega_e, omega_o],
compressible=True,
force=force,
force_model=ForceModel.GUO,
zero_centered=False,
streaming_pattern="pull",
) # free surface implementation only works with pull pattern
elif generatedMethod == "SRT":
omega = sp.Symbol("omega")
# method definition # method definition
lbm_config = LBMConfig( lbm_config = LBMConfig(stencil=stencil,
stencil=stencil, method=Method.CUMULANT,
method=Method.SRT, relaxation_rate=omega,
smagorinsky=True, compressible=True,
relaxation_rate=omega, force=force_field,
compressible=True, zero_centered=False,
force=force, streaming_pattern='pull', # free surface implementation only works with pull pattern
force_model=ForceModel.GUO, galilean_correction=True)
zero_centered=False,
streaming_pattern="pull",
) # free surface implementation only works with pull pattern
# optimizations to be used by the code generator # optimizations to be used by the code generator
lbm_opt = LBMOptimisation(cse_global=True, field_layout=layout) lbm_opt = LBMOptimisation(cse_global=True,
field_layout=layout)
collision_rule = create_lb_collision_rule( collision_rule = create_lb_collision_rule(lbm_config=lbm_config,
lbm_config=lbm_config, lbm_optimisation=lbm_opt lbm_optimisation=lbm_opt)
)
with CodeGeneration() as ctx: generate_lattice_model(ctx, "AntidunesLatticeModel", collision_rule, field_layout=layout)
generate_lattice_model(
ctx, "AntidunesLatticeModel", collision_rule, field_layout=layout
)
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment