43 #ifndef OneDFSIPhysics_H 44 #define OneDFSIPhysics_H 46 #include <lifev/one_d_fsi/solver/OneDFSIData.hpp> 169 #ifdef HAVE_NEUMANN_VISCOELASTIC_BC 172 Real fromPToA (
const Real& P,
const Real& timeStep,
const UInt& iNode,
const bool& elasticExternalNodes =
true )
const;
208 #ifdef HAVE_NEUMANN_VISCOELASTIC_BC 211 Real dPdA (
const Real& A,
const Real& timeStep,
const UInt& iNode,
const bool& elasticExternalNodes =
true )
const;
231 #ifdef HAVE_NEUMANN_VISCOELASTIC_BC 247 #ifdef HAVE_NEUMANN_VISCOELASTIC_BC 250 Real dAdP (
const Real& P,
const Real& timeStep,
const UInt& iNode,
const bool& elasticExternalNodes =
true )
const;
286 #ifdef HAVE_NEUMANN_VISCOELASTIC_BC 289 Real pressure (
const Real& A,
const Real& timeStep,
const UInt& iNode,
const bool& elasticExternalNodes =
true )
const;
298 return M_dataPtr->externalPressure();
307 return M_dataPtr->venousPressure();
326 #ifdef HAVE_NEUMANN_VISCOELASTIC_BC 363 M_previousAreaPtr.reset (
new vector_Type ( area_tn ) );
406 if ( !M_dataPtr->viscoelasticWall() || ( ( iNode == 0 || iNode == M_dataPtr->numberOfNodes() - 1 ) && elasticExternalNodes ) )
408 return ( M_dataPtr->area0 ( iNode ) * OneDFSI::pow20 ( ( P - externalPressure() ) / M_dataPtr->beta0 ( iNode ) + 1, 1 / M_dataPtr->beta1 ( iNode ) ) );
413 Real tolerance (1e-6);
417 Real A ( M_dataPtr->area0 ( iNode ) );
418 Real newtonUpdate (0);
419 for ( ; i < maxIT ; ++i )
421 if ( std::abs (
pressure ( A
, timeStep
, iNode
, elasticExternalNodes
) - P ) < tolerance )
426 newtonUpdate = (
pressure ( A
, timeStep
, iNode
, elasticExternalNodes
) - P ) /
dPdA ( A
, timeStep
, iNode
, elasticExternalNodes
);
427 if ( A - newtonUpdate <= 0 )
438 std::cout <<
"!!! Warning: conversion fromPToA below tolerance !!! " << std::endl;
439 std::cout <<
"Tolerance: " << tolerance <<
"; Residual: " << std::abs ( pressure ( A, timeStep, iNode, elasticExternalNodes ) - P ) << std::endl;
452 return ( Anp1 - (*M_previousAreaPtr) [iNode] ) / timeStep;
464 return M_dataPtr->beta0 ( iNode ) * M_dataPtr->beta1 ( iNode ) * OneDFSI::pow05 ( A / M_dataPtr->area0 ( iNode ), M_dataPtr->beta1 ( iNode ) ) / A;
470 if ( !M_dataPtr->viscoelasticWall() || ( ( iNode == 0 || iNode == M_dataPtr->numberOfNodes() - 1 ) && elasticExternalNodes ) )
476 return M_dataPtr->viscoelasticCoefficient ( iNode ) / ( A * std::sqrt ( A ) ) * ( 1 / timeStep - 3 * dAdt ( A, timeStep, iNode ) / ( 2 * A ) );
483 if ( !M_dataPtr->viscoelasticWall() || ( ( iNode == 0 || iNode == M_dataPtr->numberOfNodes() - 1 ) && elasticExternalNodes ) )
485 return M_dataPtr->area0 ( iNode ) / ( M_dataPtr->beta0 ( iNode ) * M_dataPtr->beta1 ( iNode ) )
486 * OneDFSI::pow10 ( 1 + ( P - externalPressure() )
487 / M_dataPtr->beta0 ( iNode ), 1 / M_dataPtr->beta1 ( iNode ) - 1 );
492 return ( fromPToA ( P + M_dataPtr->jacobianPerturbationStress(), timeStep, iNode, elasticExternalNodes ) - fromPToA ( P, timeStep, iNode, elasticExternalNodes ) )
493 / M_dataPtr->jacobianPerturbationStress();
502 return dPdA ( A, timeStep, iNode ) - M_dataPtr->densityRho() * Q * Q / ( A * A * A );
507 return M_dataPtr->densityRho() * Q / ( A * A );
510 ERROR_MSG (
"Total pressure's differential function has only 2 components.");
520 return std::sqrt ( M_dataPtr->beta0 ( iNode ) * M_dataPtr->beta1 ( iNode ) / M_dataPtr->densityRho() );
532 return ( M_dataPtr->beta0 ( iNode ) * ( OneDFSI::pow05 ( A / M_dataPtr->area0 ( iNode ), M_dataPtr->beta1 ( iNode ) ) - 1 ) );
538 if ( !M_dataPtr->viscoelasticWall() || ( ( iNode == 0 || iNode == M_dataPtr->numberOfNodes() - 1 ) && elasticExternalNodes ) )
544 return M_dataPtr->viscoelasticCoefficient ( iNode ) / ( A * std::sqrt ( A ) ) * dAdt ( A, timeStep, iNode );
551 return elasticPressure ( A, iNode ) + M_dataPtr->densityRho() / 2 * Q * Q / ( A * A );
VectorEpetra - The Epetra Vector format Wrapper.
virtual Real fromPToW(const Real &P, const Real &W, const ID &iW, const UInt &iNode) const =0
Compute or from .
OneDFSIPhysics - Base class providing physical operations for the 1D model data.
virtual Real fromWToP(const Real &W1, const Real &W2, const UInt &iNode) const =0
Compute from .
FactorySingleton< Factory< OneDFSIPhysics, OneDFSI::physicsType_Type > > factoryPhysics_Type
Real dPdAviscoelastic(const Real &A, const Real &timeStep, const UInt &iNode, const bool &elasticExternalNodes=true) const
Compute the derivative of the viscoelastic pressure with respect to .
virtual void fromWToU(Real &U1, Real &U2, const Real &W1, const Real &W2, const UInt &iNode) const =0
Compute from .
OneDFSIData - Class which read and holds all the data for the One Dimensional Model Solver...
virtual Real fromQToW(const Real &Q, const Real &W_tn, const Real &W, const ID &iW, const UInt &iNode) const =0
Compute or from .
OneDFSIPhysics()
Empty constructor.
void setArea_tn(const vector_Type &area_tn)
Set the area at time .
const Real & externalPressure() const
Return the external pressure.
Real fromPToA(const Real &P, const Real &timeStep, const UInt &iNode, const bool &elasticExternalNodes=true) const
Compute the area given the elastic pressure .
OneDFSIPhysics(const dataPtr_Type dataPtr)
Constructor.
Real celerity0(const UInt &iNode) const
Compute the reference celerity.
virtual ~OneDFSIPhysics()
Destructor.
const Real & venousPressure() const
Return the venous pressure.
void updateInverseJacobian(const UInt &iQuadPt)
std::shared_ptr< data_Type > dataPtr_Type
vectorPtr_Type M_previousAreaPtr
Real totalPressure(const Real &A, const Real &Q, const UInt &iNode) const
Compute the total pressure.
void setData(const dataPtr_Type &dataPtr)
Set the data container of the problem.
Real pressure(const Real &A, const Real &timeStep, const UInt &iNode, const bool &elasticExternalNodes=true) const
Compute the pressure.
Real dAdP(const Real &P, const Real &timeStep, const UInt &iNode, const bool &elasticExternalNodes=true) const
Compute the derivative of the area with respect to .
OneDFSIPhysics(const OneDFSIPhysics &physics)
Real viscoelasticPressure(const Real &A, const Real &timeStep, const UInt &iNode, const bool &elasticExternalNodes=true) const
Compute the viscoelastic pressure.
Real dAdt(const Real &Anp1, const Real &timeStep, const UInt &iNode) const
Compute the derivative of the area with respect to the time using a first order finite difference...
OneDFSIPhysics & operator=(const OneDFSIPhysics &physics)
double Real
Generic real data.
virtual Real dPdW(const Real &W1, const Real &W2, const ID &iW, const UInt &iNode) const =0
Compute the derivative of pressure with respect to .
dataPtr_Type data() const
Get the data container of the problem.
Real dPdAelastic(const Real &A, const UInt &iNode) const
Compute the derivative of the elastic pressure with respect to .
Real elasticPressure(const Real &A, const UInt &iNode) const
Compute the elastic pressure.
Real dPdA(const Real &A, const Real &timeStep, const UInt &iNode, const bool &elasticExternalNodes=true) const
Compute the derivative of the pressure with respect to .
Real dPTdU(const Real &A, const Real &Q, const Real &timeStep, const ID &id, const UInt &iNode) const
Compute the derivative of total pressure with respect to or .
uint32_type UInt
generic unsigned integer (used mainly for addressing)
virtual void fromUToW(Real &W1, Real &W2, const Real &U1, const Real &U2, const UInt &iNode) const =0
Compute from .
std::shared_ptr< vector_Type > vectorPtr_Type