Skip to content

Commit

Permalink
added dimensionality for surface tension, epsilon and mobility
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreLaurentinCS committed Sep 5, 2024
1 parent 7d8d642 commit 5fa855d
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 22 deletions.
9 changes: 6 additions & 3 deletions include/core/parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,8 @@ namespace Parameters
void
declare_parameters(ParameterHandler &prm);
void
parse_parameters(ParameterHandler &prm);
parse_parameters(ParameterHandler &prm,
const Parameters::Dimensionality dimensions);
};

/**
Expand All @@ -368,7 +369,8 @@ namespace Parameters
void
declare_parameters(ParameterHandler &prm);
void
parse_parameters(ParameterHandler &prm);
parse_parameters(ParameterHandler &prm,
const Parameters::Dimensionality dimensions);
};


Expand Down Expand Up @@ -502,7 +504,8 @@ namespace Parameters
declare_parameters(ParameterHandler &prm, unsigned int id);

void
parse_parameters(ParameterHandler &prm, const unsigned int id);
parse_parameters(ParameterHandler &prm, const unsigned int id,
const Parameters::Dimensionality dimensions);
};

/**
Expand Down
4 changes: 2 additions & 2 deletions include/core/parameters_multiphysics.h
Original file line number Diff line number Diff line change
Expand Up @@ -217,7 +217,7 @@ namespace Parameters
void
declare_parameters(ParameterHandler &prm);
void
parse_parameters(ParameterHandler &prm);
parse_parameters(ParameterHandler &prm, const Dimensionality dimensions);
};

/**
Expand All @@ -242,7 +242,7 @@ namespace Parameters
void
declare_parameters(ParameterHandler &prm);
void
parse_parameters(ParameterHandler &prm);
parse_parameters(ParameterHandler &prm, const Dimensionality dimensions);
};
} // namespace Parameters
#endif
4 changes: 2 additions & 2 deletions include/solvers/simulation_parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ class SimulationParameters
mesh_box_refinement->parse_parameters(prm);
nitsche->parse_parameters(prm);
physical_properties.parse_parameters(prm, dimensionality);
multiphysics.parse_parameters(prm);
multiphysics.parse_parameters(prm,dimensionality);
timer.parse_parameters(prm);
fem_parameters.parse_parameters(prm);
laser_parameters->parse_parameters(prm);
Expand All @@ -182,7 +182,7 @@ class SimulationParameters
simulation_control.parse_parameters(prm);
velocity_sources.parse_parameters(prm);
particlesParameters->parse_parameters(prm);
multiphysics.parse_parameters(prm);
//multiphysics.parse_parameters(prm);
constrain_solid_domain.parse_parameters(prm);
stabilization.parse_parameters(prm);
ale.parse_parameters(prm);
Expand Down
30 changes: 18 additions & 12 deletions source/core/parameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,11 @@ namespace Parameters
}

void
SurfaceTensionParameters::parse_parameters(ParameterHandler &prm)
SurfaceTensionParameters::parse_parameters(ParameterHandler &prm,
const Parameters::Dimensionality dimensions)
{
surface_tension_coefficient = prm.get_double("surface tension coefficient");
surface_tension_coefficient *= dimensions.surface_tension_scaling;
T_0 = prm.get_double("reference state temperature");
surface_tension_gradient =
prm.get_double("temperature-driven surface tension gradient");
Expand All @@ -539,10 +541,13 @@ namespace Parameters
}

void
MobilityCahnHilliardParameters::parse_parameters(ParameterHandler &prm)
MobilityCahnHilliardParameters::parse_parameters(ParameterHandler &prm,
const Parameters::Dimensionality dimensions)
{
mobility_cahn_hilliard_constant =
prm.get_double("cahn hilliard mobility constant");
mobility_cahn_hilliard_constant *=
dimensions.cahn_hilliard_mobility_scaling;
}

template <int dim>
Expand Down Expand Up @@ -954,7 +959,7 @@ namespace Parameters
++i_material_interaction)
{
material_interactions[i_material_interaction].parse_parameters(
prm, i_material_interaction);
prm, i_material_interaction,dimensions);
if (material_interactions[i_material_interaction]
.material_interaction_type ==
MaterialInteractions::MaterialInteractionsType::fluid_fluid)
Expand Down Expand Up @@ -1296,7 +1301,8 @@ namespace Parameters
}

void
MaterialInteractions::parse_parameters(ParameterHandler &prm, unsigned int id)
MaterialInteractions::parse_parameters(ParameterHandler &prm, unsigned int id,
const Parameters::Dimensionality dimensions)
{
prm.enter_subsection("material interaction " +
Utilities::int_to_string(id, 1));
Expand Down Expand Up @@ -1331,17 +1337,17 @@ namespace Parameters
if (op == "constant")
{
surface_tension_model = SurfaceTensionModel::constant;
surface_tension_parameters.parse_parameters(prm);
surface_tension_parameters.parse_parameters(prm,dimensions);
}
else if (op == "linear")
{
surface_tension_model = SurfaceTensionModel::linear;
surface_tension_parameters.parse_parameters(prm);
surface_tension_parameters.parse_parameters(prm,dimensions);
}
else if (op == "phase change")
{
surface_tension_model = SurfaceTensionModel::phase_change;
surface_tension_parameters.parse_parameters(prm);
surface_tension_parameters.parse_parameters(prm,dimensions);
}
else
throw(std::runtime_error(
Expand All @@ -1353,13 +1359,13 @@ namespace Parameters
{
mobility_cahn_hilliard_model =
MobilityCahnHilliardModel::constant;
mobility_cahn_hilliard_parameters.parse_parameters(prm);
mobility_cahn_hilliard_parameters.parse_parameters(prm,dimensions);
}
else if (op == "quartic")
{
mobility_cahn_hilliard_model =
MobilityCahnHilliardModel::quartic;
mobility_cahn_hilliard_parameters.parse_parameters(prm);
mobility_cahn_hilliard_parameters.parse_parameters(prm,dimensions);
}
else
throw(std::runtime_error(
Expand All @@ -1382,17 +1388,17 @@ namespace Parameters
if (op == "constant")
{
surface_tension_model = SurfaceTensionModel::constant;
surface_tension_parameters.parse_parameters(prm);
surface_tension_parameters.parse_parameters(prm,dimensions);
}
else if (op == "linear")
{
surface_tension_model = SurfaceTensionModel::linear;
surface_tension_parameters.parse_parameters(prm);
surface_tension_parameters.parse_parameters(prm,dimensions);
}
else if (op == "phase change")
{
surface_tension_model = SurfaceTensionModel::phase_change;
surface_tension_parameters.parse_parameters(prm);
surface_tension_parameters.parse_parameters(prm,dimensions);
}
else
throw(std::runtime_error(
Expand Down
9 changes: 6 additions & 3 deletions source/core/parameters_multiphysics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,8 @@ Parameters::Multiphysics::declare_parameters(ParameterHandler &prm)
}

void
Parameters::Multiphysics::parse_parameters(ParameterHandler &prm)
Parameters::Multiphysics::parse_parameters(ParameterHandler &prm,
const Dimensionality dimensions)
{
prm.enter_subsection("multiphysics");
{
Expand All @@ -89,7 +90,7 @@ Parameters::Multiphysics::parse_parameters(ParameterHandler &prm)
}
prm.leave_subsection();
vof_parameters.parse_parameters(prm);
cahn_hilliard_parameters.parse_parameters(prm);
cahn_hilliard_parameters.parse_parameters(prm, dimensions);
}

void
Expand Down Expand Up @@ -525,7 +526,8 @@ Parameters::CahnHilliard::declare_parameters(ParameterHandler &prm)
}

void
Parameters::CahnHilliard::parse_parameters(ParameterHandler &prm)
Parameters::CahnHilliard::parse_parameters(ParameterHandler &prm,
const Dimensionality dimensions)
{
prm.enter_subsection("cahn hilliard");
{
Expand All @@ -552,6 +554,7 @@ Parameters::CahnHilliard::parse_parameters(ParameterHandler &prm)
"Options are 'automatic' or 'manual'."));

epsilon = prm.get_double("value");
epsilon *= dimensions.cahn_hilliard_epsilon_scaling;
}
prm.leave_subsection();
}
Expand Down

0 comments on commit 5fa855d

Please sign in to comment.