Skip to content

Commit

Permalink
Merge branch 'two_flap_case' of https://github.com/carme-hp/dealii-ad…
Browse files Browse the repository at this point in the history
…apter into carme-hp-two_flap_case
  • Loading branch information
davidscn committed Jan 7, 2021
2 parents 209c364 + 694d25b commit 3e960ca
Show file tree
Hide file tree
Showing 5 changed files with 64 additions and 33 deletions.
8 changes: 8 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -48,3 +48,11 @@ CMakeFiles/
*.includes

*.swp

# Compiled binaries
linear_elasticity/linear_elasticity
nonlinear_elasticity/nonlinear_elasticity




7 changes: 7 additions & 0 deletions linear_elasticity/include/parameter_handling.h
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,7 @@ namespace Linear_Elasticity
std::string mesh_name;
std::string read_data_name;
std::string write_data_name;
double flap_location;

static void
declare_parameters(ParameterHandler &prm);
Expand Down Expand Up @@ -265,6 +266,11 @@ namespace Linear_Elasticity
"calculated-data",
Patterns::Anything(),
"Name of the write data in the precice-config.xml file");
prm.declare_entry(
"Flap location",
"0.0",
Patterns::Double(-3, 3),
"PF x-location");
}
prm.leave_subsection();
}
Expand All @@ -280,6 +286,7 @@ namespace Linear_Elasticity
mesh_name = prm.get("Mesh name");
read_data_name = prm.get("Read data name");
write_data_name = prm.get("Write data name");
flap_location = prm.get_double("Flap x-location");
}
prm.leave_subsection();
}
Expand Down
24 changes: 14 additions & 10 deletions linear_elasticity/linear_elasticity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -204,22 +204,26 @@ namespace Linear_Elasticity
id_flap_short_bottom = 0; // y direction
id_flap_short_top = 1;
}
else
{
// Flap_perp case
n_x = 3;
n_y = 18;
n_z = 1;
point_bottom =
dim == 3 ? Point<dim>(-0.05, 0, 0) : Point<dim>(-0.05, 0);
point_tip = dim == 3 ? Point<dim>(0.05, 1, 0.3) : Point<dim>(0.05, 1);
// PF Case
else {

n_x = 3;
n_y = 18;
n_z = 1;

double flap_xlocation = parameters.flap_location;

point_bottom =
dim == 3 ? Point<dim>(flap_xlocation - 0.05, 0, 0) : Point<dim>(flap_xlocation - 0.05, 0);
point_tip = dim == 3 ? Point<dim>(flap_xlocation + 0.05, 1, 0.3) : Point<dim>(flap_xlocation + 0.05, 1); //flap has a 0.1 width

// IDs for PF
id_flap_long_bottom = 0; // x direction
id_flap_long_top = 1;
id_flap_short_bottom = 2; // y direction
id_flap_short_top = 3;
}

}

// Same for both scenarios, only relevant for quasi-2D
id_flap_out_of_plane_bottom = 4; // z direction
Expand Down
8 changes: 8 additions & 0 deletions nonlinear_elasticity/include/parameter_handling.h
Original file line number Diff line number Diff line change
Expand Up @@ -289,6 +289,7 @@ namespace Nonlinear_Elasticity
std::string mesh_name;
std::string read_data_name;
std::string write_data_name;
double flap_location;

static void
declare_parameters(ParameterHandler &prm);
Expand Down Expand Up @@ -331,6 +332,11 @@ namespace Nonlinear_Elasticity
"calculated-data",
Patterns::Anything(),
"Name of the write data in the precice-config.xml file");
prm.declare_entry(
"Flap location",
"0.0",
Patterns::Double(-3, 3),
"PF x-location");
}
prm.leave_subsection();
}
Expand All @@ -346,6 +352,8 @@ namespace Nonlinear_Elasticity
mesh_name = prm.get("Mesh name");
read_data_name = prm.get("Read data name");
write_data_name = prm.get("Write data name");
flap_location = prm.get_double("Flap x-location");

}
prm.leave_subsection();
}
Expand Down
50 changes: 27 additions & 23 deletions nonlinear_elasticity/nonlinear_elasticity.cc
Original file line number Diff line number Diff line change
Expand Up @@ -446,39 +446,43 @@ namespace Nonlinear_Elasticity
id_flap_short_top, n_x, n_y, n_z;

// Assertion is done via a input pattern in the parameter class
if (testcase == "PF")
{ // flap_perp
point_bottom =
dim == 3 ? Point<dim>(-0.05, 0, 0) : Point<dim>(-0.05, 0);
point_tip = dim == 3 ? Point<dim>(0.05, 1, 0.3) : Point<dim>(0.05, 1);

// IDs for PF
id_flap_long_bottom = 0; // x direction
id_flap_long_top = 1;
id_flap_short_bottom = 2; // y direction
id_flap_short_top = 3;

n_x = 3;
n_y = 18;
n_z = 1;
}
else // FSI3, don't use condition to avoid wmaybe unitialized warning
{
if (parameters.scenario == "FSI3")
{
// FSI 3
n_x = 18;
n_y = 3;
n_z = 1;
point_bottom = dim == 3 ? Point<dim>(0.24899, 0.19, -0.005) :
Point<dim>(0.24899, 0.19);
point_tip =
dim == 3 ? Point<dim>(0.6, 0.21, 0.005) : Point<dim>(0.6, 0.21);

// IDs for FSI3/CSM2
// IDs for FSI3
id_flap_long_bottom = 2; // x direction
id_flap_long_top = 3;
id_flap_short_bottom = 0; // y direction
id_flap_short_top = 1;

n_x = 25;
n_y = 2;
n_z = 1;
}
// PF Case
else {

n_x = 3;
n_y = 18;
n_z = 1;

double flap_xlocation = parameters.flap_location;

point_bottom =
dim == 3 ? Point<dim>(flap_xlocation - 0.05, 0, 0) : Point<dim>(flap_xlocation - 0.05, 0);
point_tip = dim == 3 ? Point<dim>(flap_xlocation + 0.05, 1, 0.3) : Point<dim>(flap_xlocation + 0.05, 1); //flap has a 0.1 width

// IDs for PF
id_flap_long_bottom = 0; // x direction
id_flap_long_top = 1;
id_flap_short_bottom = 2; // y direction
id_flap_short_top = 3;

}

// Same for both scenarios, only relevant for quasi-2D
const unsigned int id_flap_out_of_plane_bottom = 4; // z direction
Expand Down

0 comments on commit 3e960ca

Please sign in to comment.