Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[pull] master from Exawind:master #103

Merged
merged 1 commit into from
Sep 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions include/SolutionOptions.h
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,8 @@ class SolutionOptions

bool use_balanced_buoyancy_force_{false};
bool realm_has_vof_{false};
double vof_sharpening_scaling_factor_{5.0};
double vof_diffusion_scaling_factor_{0.6};

double hybridDefault_;
double alphaDefault_;
Expand Down
8 changes: 8 additions & 0 deletions src/SolutionOptions.C
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,14 @@ SolutionOptions::load(const YAML::Node& y_node)
y_solution_options, "use_balanced_buoyancy_force",
use_balanced_buoyancy_force_, use_balanced_buoyancy_force_);

get_if_present(
y_solution_options, "vof_sharpening_scaling_factor",
vof_sharpening_scaling_factor_, vof_sharpening_scaling_factor_);

get_if_present(
y_solution_options, "vof_diffusion_scaling_factor",
vof_diffusion_scaling_factor_, vof_diffusion_scaling_factor_);

// Solve for incompressible continuity
get_if_present(
y_solution_options, "solve_incompressible_continuity",
Expand Down
18 changes: 10 additions & 8 deletions src/edge_kernels/VOFAdvectionEdgeAlg.C
Original file line number Diff line number Diff line change
Expand Up @@ -87,6 +87,11 @@ VOFAdvectionEdgeAlg::execute()
const int ndim = realm_.meta_data().spatial_dimension();
const auto& meta = realm_.meta_data();

const DblType sharpening_scaling =
realm_.solutionOptions_->vof_sharpening_scaling_factor_;
const DblType diffusion_scaling =
realm_.solutionOptions_->vof_diffusion_scaling_factor_;

const DblType alphaUpw = realm_.get_alpha_upw_factor("volume_of_fluid");
const DblType hoUpwind = realm_.get_upw_factor("volume_of_fluid");
const DblType relaxFac =
Expand Down Expand Up @@ -214,16 +219,13 @@ VOFAdvectionEdgeAlg::execute()
axdx += av[d] * dxj;
}

// Hard-coded values comes from Jain, 2022 to enforce
// VOF function bounds of [0,1] while maintaining interface
// thickness that is ~2 cells

const DblType velocity_scale =
5.0 * stk::math::abs(
vdot /
stk::math::sqrt(av[0] * av[0] + av[1] * av[1] + av[2] * av[2]));
sharpening_scaling *
stk::math::abs(
vdot /
stk::math::sqrt(av[0] * av[0] + av[1] * av[1] + av[2] * av[2]));

diffusion_coef = stk::math::sqrt(diffusion_coef) * 0.3;
diffusion_coef = stk::math::sqrt(diffusion_coef) * diffusion_scaling;

const DblType inv_axdx = 1.0 / axdx;

Expand Down
Loading