Skip to content

Commit

Permalink
added briefs and T_0 dimension scaling
Browse files Browse the repository at this point in the history
  • Loading branch information
PierreLaurentinCS committed Sep 19, 2024
1 parent 30aa4ce commit b54445e
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 8 deletions.
44 changes: 44 additions & 0 deletions include/core/parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -350,9 +350,22 @@ namespace Parameters
// Liquidus temperature - Units in K
double T_liquidus;

/**
* @brief Declare the parameters.
*
* @param[in,out] prm The ParameterHandler.
*/
void
declare_parameters(ParameterHandler &prm);
void
/**
* @brief Parse the parameters.
*
* @param[in,out] prm The ParameterHandler.
*
* @param[in] dimensions The Dimensionality object controling the
* fundamental dimensions (length, time, mass, temperature) of the problem.
*/
parse_parameters(ParameterHandler &prm,
const Parameters::Dimensionality dimensions);
};
Expand All @@ -366,8 +379,22 @@ namespace Parameters
// Mobility constant (M) in m^2/s
double mobility_cahn_hilliard_constant;

/**
* @brief Declare the parameters.
*
* @param[in,out] prm The ParameterHandler.
*/
void
declare_parameters(ParameterHandler &prm);

/**
* @brief Parse the parameters.
*
* @param[in,out] prm The ParameterHandler.
*
* @param[in] dimensions The Dimensionality object controling the
* fundamental dimensions (length, time, mass, temperature) of the problem.
*/
void
parse_parameters(ParameterHandler &prm,
const Parameters::Dimensionality dimensions);
Expand Down Expand Up @@ -500,9 +527,26 @@ namespace Parameters
std::pair<std::pair<unsigned int, unsigned int>, unsigned int>
fluid_solid_interaction_with_material_interaction_id;

/**
* @brief Declare the parameters.
*
* @param[in,out] prm The ParameterHandler.
*
* @param[in] id The material id.
*/
void
declare_parameters(ParameterHandler &prm, unsigned int id);

/**
* @brief Parse the parameters.
*
* @param[in,out] prm The ParameterHandler.
*
* @param[in] id The material id.
*
* @param[in] dimensions The Dimensionality object controling the
* fundamental dimensions (length, time, mass, temperature) of the problem.
*/
void
parse_parameters(ParameterHandler &prm,
const unsigned int id,
Expand Down
14 changes: 6 additions & 8 deletions source/core/parameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -521,6 +521,7 @@ namespace Parameters
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 *= 1. / dimensions.temperature;
surface_tension_gradient =
prm.get_double("temperature-driven surface tension gradient");
surface_tension_gradient *= dimensions.surface_tension_gradient_scaling;
Expand Down Expand Up @@ -1351,41 +1352,38 @@ namespace Parameters
if (op == "constant")
{
surface_tension_model = SurfaceTensionModel::constant;
surface_tension_parameters.parse_parameters(prm, dimensions);
}
else if (op == "linear")
{
surface_tension_model = SurfaceTensionModel::linear;
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);
}
else
throw(std::runtime_error(
"Invalid surface tension model. The choices are <constant|linear|phase change>."));

surface_tension_parameters.parse_parameters(prm, dimensions);
// Cahn-Hilliard mobility
op = prm.get("cahn hilliard mobility model");
if (op == "constant")
{
mobility_cahn_hilliard_model =
MobilityCahnHilliardModel::constant;
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);
}
else
throw(std::runtime_error(
"Invalid mobility model. The choices are <constant|quartic>."));

mobility_cahn_hilliard_parameters.parse_parameters(prm,
dimensions);
}
prm.leave_subsection();
}
Expand Down

0 comments on commit b54445e

Please sign in to comment.