Commit 212c0bcc authored by GILLES Sebastien's avatar GILLES Sebastien
Browse files

#820 Poromechanics: [WIP] Introducing interpolator to correctly estimate solid...

#820 Poromechanics: [WIP] Introducing interpolator to correctly estimate solid displacement on fluid mesh.
parent 2298dbc3
......@@ -1038,6 +1038,36 @@ bulk_solid = {
} -- bulk_solid
-- Solid displacement on fluid
InitVertexMatchingInterpolator10 = {
-- Finite element space for which the dofs index will be associated to each vertex.
-- Expected format: VALUE
finite_element_space = 10,
-- Numbering subsetfor which the dofs index will be associated to each vertex.
-- Expected format: "VALUE"
numbering_subset = 14
} -- InitVertexMatchingInterpolator10
-- Solid displacement
InitVertexMatchingInterpolator20 = {
-- Finite element space for which the dofs index will be associated to each vertex.
-- Expected format: VALUE
finite_element_space = 20,
-- Numbering subsetfor which the dofs index will be associated to each vertex.
-- Expected format: "VALUE"
numbering_subset = 20
} -- InitVertexMatchingInterpolator20
-- Initial value of porosity at each dof.
-- Expected format: VALUE
porosity = 0.1
......
......@@ -11,6 +11,7 @@
#include "Parameters/Instances/Private/Configuration.hpp"
#include "ModelInstances/UnderDevelopment/Poromechanics/ExplicitStepVariationalFormulation.hpp"
#include "ModelInstances/UnderDevelopment/Poromechanics/Private/SolidOnFluidMesh.hpp"
namespace HappyHeart
......@@ -141,16 +142,20 @@ namespace HappyHeart
GlobalMatrixWithCoefficient with_coeff_matrix(system_matrix, 1.);
decltype(auto) velocity_previous_time_iteration = GetFluidVelocityPreviousTimeIteration();
const auto& time_manager = GetTimeManager();
//
// Wrappers::Petsc::AXPY(-1. / time_manager.GetTimeStep(),
// GetAleDisplacement(),
// modified_velocity_previous_iteration,
// __FILE__, __LINE__);
//
// GetAleOperator().Assemble(std::make_tuple(std::ref(matrix)),
// modified_velocity_previous_iteration);
decltype(auto) solid_on_fluid_mesh = GetSolidOnFluidMesh();
auto& modified_velocity_previous_iteration = GetNonCstModifiedFluidVelocityPreviousTimeIteration();
modified_velocity_previous_iteration.Copy(velocity_previous_time_iteration, __FILE__, __LINE__);
// \todo #820 Should be an interpolation here!!!
Wrappers::Petsc::AXPY(-1.,
solid_on_fluid_mesh.GetHalfSumVelocity(),
modified_velocity_previous_iteration,
__FILE__, __LINE__);
GetAleOperator().Assemble(std::make_tuple(std::ref(with_coeff_matrix)),
modified_velocity_previous_iteration);
}
......@@ -213,6 +218,10 @@ namespace HappyHeart
mass_matrix_ = std::make_unique<GlobalMatrix>(system_matrix);
mass_matrix_previous_iteration_ = std::make_unique<GlobalMatrix>(system_matrix);
decltype(auto) system_rhs = parent::GetSystemRhs(numbering_subset);
modified_fluid_velocity_previous_time_iteration_ = std::make_unique<GlobalVector>(system_rhs);
}
......
......@@ -239,6 +239,20 @@ namespace HappyHeart
//! Constant accessor to the velocity of the fluid in the previous time iteration.
const GlobalVector& GetFluidVelocityPreviousTimeIteration() const noexcept;
/*!
* \brief Constant accessor to the velocity of the fluid in the previous time iteration minus half sum
* of solid velocity of previous and current iteration.
*/
const GlobalVector& GetModifiedFluidVelocityPreviousTimeIteration() const noexcept;
/*!
* \brief Non constant accessor to the velocity of the fluid in the previous time iteration minus half
* sum of solid velocity of previous and current iteration.
*/
GlobalVector& GetNonCstModifiedFluidVelocityPreviousTimeIteration() noexcept;
///@}
......@@ -289,13 +303,13 @@ namespace HappyHeart
ScalarParameter::unique_ptr pseudo_young_modulus_ = nullptr;
//! Parameter that acts as a Poisson ratio in fluid viscosity operator.
ScalarParameter::unique_ptr pseudo_poisson_ratio_ = nullptr;
ScalarParameter::unique_ptr pseudo_poisson_ratio_ = nullptr;
/// \name Numbering subsets used in the formulation.
///@{
const NumberingSubset& numbering_subset_;
///@}
//! Velocity of the fluid in the previous time iteration.
......@@ -304,6 +318,14 @@ namespace HappyHeart
//! Object which keeps track on solid displacement and velocity on fluid mesh.
const Private::SolidOnFluidMesh& solid_on_fluid_mesh_;
private:
/*!
* \brief Velocity of the fluid in the previous time iteration minus half sum of solid velocity of
* previous and current iteration.
*/
GlobalVector::unique_ptr modified_fluid_velocity_previous_time_iteration_ = nullptr;
};
......
......@@ -139,6 +139,19 @@ namespace HappyHeart
{
return fluid_velocity_previous_time_iteration_;
}
inline const GlobalVector& ExplicitStepVariationalFormulation::GetModifiedFluidVelocityPreviousTimeIteration() const noexcept
{
assert(!(!modified_fluid_velocity_previous_time_iteration_));
return *modified_fluid_velocity_previous_time_iteration_;
}
inline GlobalVector& ExplicitStepVariationalFormulation::GetNonCstModifiedFluidVelocityPreviousTimeIteration() noexcept
{
return const_cast<GlobalVector&>(GetModifiedFluidVelocityPreviousTimeIteration());
}
......
......@@ -21,6 +21,7 @@
# include "Core/InputParameter/DirichletBoundaryCondition/DirichletBoundaryCondition.hpp"
# include "Core/InputParameter/Parameter/Fluid/Fluid.hpp"
# include "Core/InputParameter/Parameter/Solid/Solid.hpp"
# include "Core/InputParameter/Interpolator/InitVertexMatching.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/InputParameter/Porosity.hpp"
# include "ModelInstances/UnderDevelopment/Poromechanics/InputParameter/BulkSolid.hpp"
......@@ -97,8 +98,14 @@ namespace HappyHeart
solid_velocity = 21
};
enum class InitVertexMatchingInterpolator
{
fluid = 10,
solid = 20
};
using InputParameterTuple = std::tuple
<
InputParameter::TimeManager,
......@@ -141,6 +148,8 @@ namespace HappyHeart
InputParameter::Fluid::Density,
InputParameter::Fluid::Viscosity,
InputParameter::InitVertexMatchingInterpolator<EnumUnderlyingType(InitVertexMatchingInterpolator::solid)>,
InputParameter::InitVertexMatchingInterpolator<EnumUnderlyingType(InitVertexMatchingInterpolator::fluid)>,
// \todo #820 This parameter probably won't remain; keep it at the moment until it's completely sure...
InputParameter::PoromechanicsNS::Porosity,
......
......@@ -27,6 +27,12 @@ namespace HappyHeart
namespace Private
{
namespace // anonymous
{
} // namespace anonymous
SolidOnFluidMesh::SolidOnFluidMesh(const GodOfDof& god_of_dof,
const NumberingSubset& numbering_subset,
......@@ -66,6 +72,24 @@ namespace HappyHeart
}
namespace // anonymous
{
//
// {
// auto& init_vertex_matching_manager = Private::DofProgramWiseIndexListPerVertexCoordIndexManager::GetInstance();
//
// solid_to_fluid_velocity_on_fsi_interpolator_ =
// std::make_unique<NonConformInterpolatorNS::FromVertexMatching>(input_parameter_data,
// init_vertex_matching_manager.GetDofProgramWiseIndexListPerVertexCoordIndex(EnumUnderlyingType(InitVertexMatchingInterpolator::solid)),
// init_vertex_matching_manager.GetDofProgramWiseIndexListPerVertexCoordIndex(EnumUnderlyingType(InitVertexMatchingInterpolator::fluid)));
// }
//
} // namespace anonymous
} // namespace Private
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment