Skip to content

Commit

Permalink
added surface tensin gradient scaling and fixed thermal expansion sca…
Browse files Browse the repository at this point in the history
…ling
  • Loading branch information
PierreLaurentinCS committed Sep 5, 2024
1 parent 5fa855d commit 25e2271
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 37 deletions.
1 change: 1 addition & 0 deletions include/core/dimensionality.h
Original file line number Diff line number Diff line change
Expand Up @@ -103,6 +103,7 @@ namespace Parameters
double diffusivity_scaling;
double thermal_expansion_scaling;
double surface_tension_scaling;
double surface_tension_gradient_scaling;
double cahn_hilliard_mobility_scaling;
double cahn_hilliard_epsilon_scaling;
};
Expand Down
7 changes: 4 additions & 3 deletions include/core/parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -353,7 +353,7 @@ namespace Parameters
void
declare_parameters(ParameterHandler &prm);
void
parse_parameters(ParameterHandler &prm,
parse_parameters(ParameterHandler &prm,
const Parameters::Dimensionality dimensions);
};

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

Expand Down Expand Up @@ -504,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
3 changes: 1 addition & 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,dimensionality);
multiphysics.parse_parameters(prm, dimensionality);
timer.parse_parameters(prm);
fem_parameters.parse_parameters(prm);
laser_parameters->parse_parameters(prm);
Expand All @@ -182,7 +182,6 @@ class SimulationParameters
simulation_control.parse_parameters(prm);
velocity_sources.parse_parameters(prm);
particlesParameters->parse_parameters(prm);
//multiphysics.parse_parameters(prm);
constrain_solid_domain.parse_parameters(prm);
stabilization.parse_parameters(prm);
ale.parse_parameters(prm);
Expand Down
23 changes: 12 additions & 11 deletions source/core/dimensionality.cc
Original file line number Diff line number Diff line change
Expand Up @@ -13,17 +13,18 @@ namespace Parameters
const double theta = temperature;
const double T = time;

density_scaling = 1. * L * L * L / M;
specific_gas_constant_scaling = 1. / L / L * T * T * theta;
viscosity_scaling = 1. / L / L * T;
specific_heat_scaling = 1. / L / L * T * T * theta;
thermal_conductivity_scaling = 1. / M / L * T * T * T * theta;
enthalpy_scaling = 1. / M / L / L * T * T;
diffusivity_scaling = 1. / L / L * T;
thermal_expansion_scaling = T;
surface_tension_scaling = 1. * T * T / M;
cahn_hilliard_mobility_scaling = 1. * M / L / L / L / T;
cahn_hilliard_epsilon_scaling = 1. / L;
density_scaling = 1. * L * L * L / M;
specific_gas_constant_scaling = 1. / L / L * T * T * theta;
viscosity_scaling = 1. / L / L * T;
specific_heat_scaling = 1. / L / L * T * T * theta;
thermal_conductivity_scaling = 1. / M / L * T * T * T * theta;
enthalpy_scaling = 1. / M / L / L * T * T;
diffusivity_scaling = 1. / L / L * T;
thermal_expansion_scaling = 1. * theta;
surface_tension_scaling = 1. * T * T / M;
surface_tension_gradient_scaling = 1. * theta * T * T / M;
cahn_hilliard_mobility_scaling = 1. * M / L / L / L / T;
cahn_hilliard_epsilon_scaling = 1. / L;
}

void
Expand Down
46 changes: 27 additions & 19 deletions source/core/parameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -514,17 +514,20 @@ namespace Parameters
}

void
SurfaceTensionParameters::parse_parameters(ParameterHandler &prm,
const Parameters::Dimensionality dimensions)
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");
T_0 = prm.get_double("reference state temperature");
surface_tension_gradient =
prm.get_double("temperature-driven surface tension gradient");
T_solidus = prm.get_double("solidus temperature");
surface_tension_gradient *= dimensions.surface_tension_gradient_scaling;
T_solidus = prm.get_double("solidus temperature");
T_solidus *= 1. / dimensions.temperature;
T_liquidus = prm.get_double("liquidus temperature");

T_liquidus *= 1. / dimensions.temperature;
Assert(T_liquidus > T_solidus,
PhaseChangeIntervalError(T_liquidus, T_solidus));
}
Expand All @@ -541,13 +544,14 @@ namespace Parameters
}

void
MobilityCahnHilliardParameters::parse_parameters(ParameterHandler &prm,
const Parameters::Dimensionality dimensions)
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;
dimensions.cahn_hilliard_mobility_scaling;
}

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

void
MaterialInteractions::parse_parameters(ParameterHandler &prm, unsigned int id,
const Parameters::Dimensionality dimensions)
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 @@ -1337,17 +1343,17 @@ namespace Parameters
if (op == "constant")
{
surface_tension_model = SurfaceTensionModel::constant;
surface_tension_parameters.parse_parameters(prm,dimensions);
surface_tension_parameters.parse_parameters(prm, dimensions);
}
else if (op == "linear")
{
surface_tension_model = SurfaceTensionModel::linear;
surface_tension_parameters.parse_parameters(prm,dimensions);
surface_tension_parameters.parse_parameters(prm, dimensions);
}
else if (op == "phase change")
{
surface_tension_model = SurfaceTensionModel::phase_change;
surface_tension_parameters.parse_parameters(prm,dimensions);
surface_tension_parameters.parse_parameters(prm, dimensions);
}
else
throw(std::runtime_error(
Expand All @@ -1359,13 +1365,15 @@ namespace Parameters
{
mobility_cahn_hilliard_model =
MobilityCahnHilliardModel::constant;
mobility_cahn_hilliard_parameters.parse_parameters(prm,dimensions);
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,dimensions);
mobility_cahn_hilliard_parameters.parse_parameters(prm,
dimensions);
}
else
throw(std::runtime_error(
Expand All @@ -1388,17 +1396,17 @@ namespace Parameters
if (op == "constant")
{
surface_tension_model = SurfaceTensionModel::constant;
surface_tension_parameters.parse_parameters(prm,dimensions);
surface_tension_parameters.parse_parameters(prm, dimensions);
}
else if (op == "linear")
{
surface_tension_model = SurfaceTensionModel::linear;
surface_tension_parameters.parse_parameters(prm,dimensions);
surface_tension_parameters.parse_parameters(prm, dimensions);
}
else if (op == "phase change")
{
surface_tension_model = SurfaceTensionModel::phase_change;
surface_tension_parameters.parse_parameters(prm,dimensions);
surface_tension_parameters.parse_parameters(prm, dimensions);
}
else
throw(std::runtime_error(
Expand Down
4 changes: 2 additions & 2 deletions source/core/parameters_multiphysics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ 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 Down Expand Up @@ -526,7 +526,7 @@ 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 Down

0 comments on commit 25e2271

Please sign in to comment.