Skip to content

Commit

Permalink
temp commit
Browse files Browse the repository at this point in the history
Former-commit-id: 747adf6
  • Loading branch information
PierreLaurentinCS committed Dec 18, 2023
1 parent b50832e commit e24dc4d
Show file tree
Hide file tree
Showing 7 changed files with 32 additions and 27 deletions.
27 changes: 15 additions & 12 deletions include/core/mobility_cahn_hilliard_model.h
Original file line number Diff line number Diff line change
Expand Up @@ -57,10 +57,10 @@ class MobilityCahnHilliardModel : public InterfacePropertyModel
virtual double
get_mobility_constant() = 0;

/**
* @brief Definition of a virtual destructor
*/
virtual ~MobilityCahnHilliardModel() = default;
// /**
// * @brief Definition of a virtual destructor
// */
// virtual ~MobilityCahnHilliardModel() = default;
};

/**
Expand All @@ -77,10 +77,10 @@ class MobilityCahnHilliardModelConstant : public MobilityCahnHilliardModel
: mobility_cahn_hilliard_constant(p_mobility_cahn_hilliard_constant)
{}

/**
* @brief Destructor of derived class
*/
~MobilityCahnHilliardModelConstant() = default;
// /**
// * @brief Destructor of derived class
// */
// ~MobilityCahnHilliardModelConstant() = default;


/**
Expand Down Expand Up @@ -182,10 +182,10 @@ class MobilityCahnHilliardModelQuartic : public MobilityCahnHilliardModel
this->model_depends_on[field::phase_order_cahn_hilliard_filtered] = true;
}

/**
* @brief Destructor of derived class
*/
~MobilityCahnHilliardModelQuartic() = default;
// /**
// * @brief Destructor of derived class
// */
// ~MobilityCahnHilliardModelQuartic() = default;

/**
* @brief Method to get the model used for the mobility
Expand Down Expand Up @@ -225,6 +225,7 @@ class MobilityCahnHilliardModelQuartic : public MobilityCahnHilliardModel
// return mobility_cahn_hilliard_constant *
// (1 - phase_order_cahn_hilliard * phase_order_cahn_hilliard) *
// (1 - phase_order_cahn_hilliard * phase_order_cahn_hilliard);
std::cout<<"phase order value in filter = "<<phase_order_cahn_hilliard_filtered<<std::endl;
if (std::abs(phase_order_cahn_hilliard_filtered) > 1)
return 0.0;
else
Expand Down Expand Up @@ -259,6 +260,7 @@ class MobilityCahnHilliardModelQuartic : public MobilityCahnHilliardModel
field_vectors.at(field::phase_order_cahn_hilliard_filtered);
for (unsigned int i = 0; i < property_vector.size(); ++i)
{
std::cout<<"phase order value in filter = "<<phase_order_cahn_hilliard_filtered[i]<<std::endl;
if (std::abs(phase_order_cahn_hilliard_filtered[i]) > 1)
property_vector[i] = 0.0;
else
Expand Down Expand Up @@ -290,6 +292,7 @@ class MobilityCahnHilliardModelQuartic : public MobilityCahnHilliardModel

const double &phase_order_cahn_hilliard_filtered =
fields_value.at(field::phase_order_cahn_hilliard_filtered);
std::cout<<"phase order value in filter = "<<phase_order_cahn_hilliard_filtered<<std::endl;
if (std::abs(phase_order_cahn_hilliard_filtered) > 1)
return 0.0;
else
Expand Down
2 changes: 1 addition & 1 deletion include/core/parameters.h
Original file line number Diff line number Diff line change
Expand Up @@ -380,7 +380,7 @@ namespace Parameters
// tracer diffusivity in L^2/s
double tracer_diffusivity;
// Cahn-Hilliard mobility in L^2/s
// double mobility_cahn_hilliard;
double mobility_cahn_hilliard;

// Phase change parameters
PhaseChange phase_change_parameters;
Expand Down
2 changes: 2 additions & 0 deletions source/core/parameters.cc
Original file line number Diff line number Diff line change
Expand Up @@ -1125,6 +1125,7 @@ namespace Parameters

// Surface tension
op = prm.get("surface tension model");
std::cout<<op<<std::endl;
if (op == "constant")
{
surface_tension_model = SurfaceTensionModel::constant;
Expand All @@ -1147,6 +1148,7 @@ namespace Parameters

// Cahn-Hilliard mobility
op = prm.get("cahn hilliard mobility model");
std::cout<<op<<std::endl;
if (op == "constant")
{
mobility_cahn_hilliard_model =
Expand Down
2 changes: 1 addition & 1 deletion source/core/parameters_multiphysics.cc
Original file line number Diff line number Diff line change
Expand Up @@ -652,7 +652,7 @@ Parameters::CahnHilliard::parse_parameters(ParameterHandler &prm)
else if (op_mobility == "quartic")
{
cahn_hilliard_mobility_model = CahnHilliardMobilityModel::quartic;
std::cout<<"mobility is constant(ch)"<<std::endl;
std::cout<<"mobility is quartic (ch)"<<std::endl;
}
else
throw(std::runtime_error("Invalid mobility model. "
Expand Down
2 changes: 1 addition & 1 deletion source/solvers/cahn_hilliard_assemblers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ CahnHilliardAssemblerCore<dim>::assemble_matrix(
this->cahn_hilliard_parameters.cahn_hilliard_mobility_constant;
const auto mobility_model =
this->cahn_hilliard_parameters.cahn_hilliard_mobility_model;
// std::cout<< "mobility via ch assembler = "<< mobility_constant<<std::endl;
std::cout<< "mobility via ch assembler = "<< mobility_constant<<std::endl;
const double epsilon = scratch_data.epsilon;
const double cell_size = scratch_data.cell_size;
const double xi =
Expand Down
16 changes: 8 additions & 8 deletions source/solvers/navier_stokes_cahn_hilliard_assemblers.cc
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ GLSNavierStokesCahnHilliardAssemblerCore<dim>::assemble_matrix(

const double potential_value =
scratch_data.chemical_potential_cahn_hilliard_values[q];
// const Tensor<1, dim> phase_order_gradient =
// scratch_data.phase_order_cahn_hilliard_gradients[q];
const Tensor<1, dim> phase_order_gradient =
scratch_data.filtered_phase_order_cahn_hilliard_gradients[q];
const Tensor<1, dim> phase_order_gradient =
scratch_data.phase_order_cahn_hilliard_gradients[q];
// const Tensor<1, dim> phase_order_gradient =
// scratch_data.filtered_phase_order_cahn_hilliard_gradients[q];

double mobility = scratch_data.mobility_cahn_hilliard[q];
// std::cout<<"mobility via chns assembler = "<<mobility<<std::endl;
Expand Down Expand Up @@ -249,10 +249,10 @@ GLSNavierStokesCahnHilliardAssemblerCore<dim>::assemble_rhs(
scratch_data.chemical_potential_cahn_hilliard_gradients[q];
const double potential_value =
scratch_data.chemical_potential_cahn_hilliard_values[q];
// const Tensor<1, dim> phase_order_gradient =
// scratch_data.phase_order_cahn_hilliard_gradients[q];
const Tensor<1, dim> phase_order_gradient =
scratch_data.filtered_phase_order_cahn_hilliard_gradients[q];
const Tensor<1, dim> phase_order_gradient =
scratch_data.phase_order_cahn_hilliard_gradients[q];
// const Tensor<1, dim> phase_order_gradient =
// scratch_data.filtered_phase_order_cahn_hilliard_gradients[q];

// Gather into local variables the relevant fields for velocity
const Tensor<1, dim> velocity = scratch_data.velocity_values[q];
Expand Down
8 changes: 4 additions & 4 deletions source/solvers/navier_stokes_scratch_data.cc
Original file line number Diff line number Diff line change
Expand Up @@ -556,10 +556,10 @@ NavierStokesScratchData<dim>::calculate_physical_properties()
/* std::cout << "density_diff = " << density_diff <<
std::endl;*/

//double phase_order_cahn_hilliard_value_old =
// this->phase_order_cahn_hilliard_values[q];
double phase_order_cahn_hilliard_value =
this->filtered_phase_order_cahn_hilliard_values[q];
double phase_order_cahn_hilliard_value=
this->phase_order_cahn_hilliard_values[q];
//double phase_order_cahn_hilliard_value =
// this->filtered_phase_order_cahn_hilliard_values[q];



Expand Down

0 comments on commit e24dc4d

Please sign in to comment.