43 #include <lifev/one_d_fsi/function/OneDFSIFunctionSolverDefined.hpp> 75 #ifdef HAVE_LIFEV_DEBUG 99 ( M_bcSide == OneDFSI::left ) ? M_bcNode = 0 : M_bcNode = M_fluxPtr->physics()->data()->numberOfNodes() - 1;
127 return ( ( M_bcType == OneDFSI::W1 ) ? M_bcW[0] : M_bcW[1] );
136 M_bcU[0] = (* (*M_solutionPtr) [
"A"]) (M_bcNode);
137 M_bcU[1] = (* (*M_solutionPtr) [
"Q"]) (M_bcNode);
138 M_bcW[0] = (* (*M_solutionPtr) [
"W1"]) (M_bcNode);
139 M_bcW[1] = (* (*M_solutionPtr) [
"W2"]) (M_bcNode);
161 super ( bcFunctionCompatibility
),
181 mesh_Type::edge_Type boundaryEdge;
195 std::cout <<
"Warning: bcSide \"" << M_bcSide <<
"\" not available!" << std::endl;
209 return evaluateRHS ( M_eigenvalues[0], M_leftEigenvector1, M_deltaLeftEigenvector1, timeStep );
213 return evaluateRHS ( M_eigenvalues[1], M_leftEigenvector2, M_deltaLeftEigenvector2, timeStep );
217 std::cout <<
"Warning: bcType \"" << M_bcType <<
"\"not available!" << std::endl;
225 M_fluxPtr->eigenValuesEigenVectors ( M_bcU[0], M_bcU[1],
226 M_eigenvalues, M_leftEigenvector1, M_leftEigenvector2,
229 M_fluxPtr->deltaEigenValuesEigenVectors ( M_bcU[0], M_bcU[1],
230 M_deltaEigenvalues, M_deltaLeftEigenvector1, M_deltaLeftEigenvector2,
236 const container2D_Type& deltaEigenvector,
const Real& timeStep )
240 container2D_Type U_interpolated;
241 Real Qvisco_interpolated;
242 U_interpolated[0] = ( 1 - cfl ) * M_bcU[0] + cfl * (* (*M_solutionPtr) [
"A"]) ( M_bcInternalNode );
243 U_interpolated[1] = ( 1 - cfl ) * M_bcU[1] + cfl * (* (*M_solutionPtr) [
"Q"]) ( M_bcInternalNode );
246 if ( M_fluxPtr->physics()->data()->viscoelasticWall() && (* (*M_solutionPtr) [
"Q_visc"]) (M_bcNode) > 1e-10 )
248 Qvisco_interpolated = ( 1 - cfl ) * (* (*M_solutionPtr) [
"Q_visc"]) (M_bcNode) + cfl * (* (*M_solutionPtr) [
"Q_visc"]) ( M_bcInternalNode );
252 Qvisco_interpolated = 0;
257 container2D_Type bcNodes;
258 bcNodes[0] = M_bcNode;
259 bcNodes[1] = M_bcInternalNode;
261 #ifdef OLD_COMPATIBILITY 262 U[0] = U_interpolated[0] - timeStep * M_sourcePtr->interpolatedNonConservativeSource ( U_interpolated[0], U_interpolated[1], 0, bcNodes, cfl );
263 U[1] = U_interpolated[1] - timeStep * M_sourcePtr->interpolatedNonConservativeSource ( U_interpolated[0], U_interpolated[1], 1, bcNodes, cfl );
265 container2D_Type U0_interpolated;
266 U0_interpolated[0] = ( 1 - cfl ) * M_fluxPtr->physics()->data()->area0 (bcNodes[0]) + cfl * M_fluxPtr->physics()->data()->area0 (bcNodes[1]);
267 U0_interpolated[1] = 0;
269 U[0] = U_interpolated[0]
270 - U0_interpolated[0] - timeStep * ( M_sourcePtr->interpolatedNonConservativeSource ( U_interpolated[0], U_interpolated[1], 0, bcNodes, cfl ) -
271 M_sourcePtr->interpolatedNonConservativeSource ( U0_interpolated[0], U0_interpolated[1], 0, bcNodes, cfl ) );
272 U[1] = (U_interpolated[1] - Qvisco_interpolated)
273 - U0_interpolated[1] - timeStep * ( M_sourcePtr->interpolatedNonConservativeSource ( U_interpolated[0], U_interpolated[1], 1, bcNodes, cfl ) -
274 M_sourcePtr->interpolatedNonConservativeSource ( U0_interpolated[0], U0_interpolated[1], 1, bcNodes, cfl ) );
276 U_interpolated[0] -= U0_interpolated[0];
277 U_interpolated[1] -= U0_interpolated[1];
280 U[0] += M_fluxPtr->physics()->data()->area0 (bcNodes[0]);
289 Real cfl = eigenvalue * timeStep / edgeLength (M_fluxPtr->physics()->data()->mesh()->edge ( M_bcElement ) );
291 #ifdef HAVE_LIFEV_DEBUG 292 if ( M_bcInternalNode == 1 )
294 ASSERT ( -1. < cfl && cfl < 0. ,
"This characteristics is wrong!\nEither it is not outcoming (eigenvalue>0 at the left of the domain),\n or CFL is too high.");
299 ASSERT ( 0. < cfl && cfl < 1. ,
"This characteristics is wrong!\nEither it is not outcoming (eigenvalue<0 at the right of the domain),\n or CFL is too high.");
303 return std::abs (cfl);
317 Real W_out (0.), W_out_old (0.);
321 W_out = M_bcW[1] + evaluateRHS ( M_eigenvalues[1], M_leftEigenvector2, M_deltaLeftEigenvector2, timeStep ) - scalarProduct ( M_leftEigenvector2, M_bcU );
322 W_out_old = -M_bcW[0] + scalarProduct ( M_leftEigenvector1, M_bcU );
326 W_out = M_bcW[0] + evaluateRHS ( M_eigenvalues[0], M_leftEigenvector1, M_deltaLeftEigenvector1, timeStep ) - scalarProduct ( M_leftEigenvector1, M_bcU );
327 W_out_old = -M_bcW[1] + scalarProduct ( M_leftEigenvector2, M_bcU );
330 std::cout <<
"Warning: bcType \"" << M_bcType <<
"\"not available!" << std::endl;
334 Real a1, a2, a11, a22, b1, b2, c1, c2;
335 a1 = M_fluxPtr->physics()->pressure ( M_bcU[0], timeStep, M_bcNode ) -
this->venousPressure();
338 b1 = M_fluxPtr->physics()->dPdW ( M_bcW[0], M_bcW[1], 0, M_bcNode );
341 c1 = M_fluxPtr->physics()->dPdW ( M_bcW[0], M_bcW[1], 1, M_bcNode );
344 a11 = a1 - b1 * M_bcW[0] - c1 * M_bcW[1];
345 a22 = a2 - b2 * M_bcW[0] - c2 * M_bcW[1];
347 Real resistance (b1 / b2);
350 return W_out_old + W_out * (b2 * resistance - b1) / (c1 - c2 * resistance) + (a22 * resistance - a11) / (c1 - c2 * resistance);
364 super ( bcFunctionResistance
),
371 const bcType_Type& bcType,
372 const Real& resistance1,
373 const Real& resistance2,
374 const Real& compliance,
375 const bool& absorbing,
376 const Real& venousPressure ) :
390 super ( bcFunctionWindkessel3
),
422 std::cout <<
"Warning: bcType \"" << M_bcType <<
"\"not available!" << std::endl;
431 Real b1 ( M_fluxPtr->physics()->dPdW ( A, Q, 0, M_bcNode ) );
450 Real EXP ( std::exp ( a * time ) );
451 Real EXPdt ( std::exp ( a * timeStep ) );
452 Real integral (
M_integral_tn + ( timeStep / 2 ) * ( EXP * ( F * EXPdt + Fn ) ) );
465 return M_fluxPtr->physics()->fromPToW ( P, W_out, W_outID, M_bcNode );
container2D_Type M_deltaEigenvalues
void setFluxSource(const fluxPtr_Type &fluxPtr, const sourcePtr_Type &sourcePtr)
Set the flux and the source classes for the problem.
Real computeCFL(const Real &eigenvalue, const Real &timeStep) const
Compute the current CFL.
OneDFSIFunctionSolverDefinedCompatibility(const bcSide_Type &bcSide, const bcType_Type &bcType)
Constructor.
OneDFSIFunctionSolverDefinedAbsorbing - Class which implements absorbing boundary conditions for the ...
UInt M_bcElement
ID of the boundary edge.
OneDFSIFunctionSolverDefinedWindkessel3(const bcSide_Type &bcSide, const bcType_Type &bcType, const Real &resistance1, const Real &resistance2, const Real &compliance, const bool &absorbing=false, const Real &venousPressure=6666.)
Constructor.
Real operator()(const Real &time, const Real &timeStep)
Operator()
container2D_Type M_bcW
Value of W at the boundary.
virtual Real operator()(const Real &time, const Real &timeStep)
Operator()
UInt M_bcInternalNode
Dof of the internal node adjacent to the boundary.
container2D_Type M_deltaLeftEigenvector1
virtual void resistance(Real &)
Set the value of the resistance.
std::shared_ptr< flux_Type > fluxPtr_Type
container2D_Type M_leftEigenvector1
Left eigen vectors for the two eigen values.
void updateInverseJacobian(const UInt &iQuadPt)
OneDFSIFunctionSolverDefinedWindkessel3 - Class which implements windkessel RCR boundary conditions f...
virtual Real operator()(const Real &time, const Real &timeStep)
Operator()
Real computeRHS(const Real &timeStep)
Compute the rhs.
OneDFSIFunctionSolverDefinedCompatibility super
Real operator()(const Real &time, const Real &timeStep)
Operator()
solutionPtr_Type M_solutionPtr
OneDFSIFunctionSolverDefined super
OneDFSIFunctionSolverDefined(const OneDFSIFunctionSolverDefined &bcFunctionDefault)
Copy constructor.
OneDFSIFunctionSolverDefinedResistance - Class which implements resistance boundary conditions for th...
Real evaluateRHS(const Real &eigenvalue, const container2D_Type &eigenvector, const container2D_Type &deltaEigenvector, const Real &timeStep)
Compute the rhs.
OneDFSIFunctionSolverDefinedRiemann(const OneDFSIFunctionSolverDefinedRiemann &bcFunctionRiemann)
Copy constructor.
OneDFSIFunctionSolverDefinedResistance(const OneDFSIFunctionSolverDefinedResistance &bcFunctionResistance)
Copy constructor.
OneDFSIFunctionSolverDefinedCompatibility - Class which implements Compatibility boundary conditions ...
OneDFSIFunctionSolverDefinedAbsorbing(const OneDFSIFunctionSolverDefinedAbsorbing &bcFunctionAbsorbing)
Copy constructor.
void setupNode()
Automatically identify the boundary node.
OneDFSIFunctionSolverDefined(const bcSide_Type &bcSide, const bcType_Type &bcType)
Constructor.
container2D_Type M_eigenvalues
Eigen values of the jacobian diffFlux (= dF/dU = H)
sourcePtr_Type M_sourcePtr
OneDFSIFunctionSolverDefinedCompatibility(const OneDFSIFunctionSolverDefinedCompatibility &bcFunctionCompatibility)
Copy constructor.
container2D_Type M_deltaLeftEigenvector2
OneDFSIFunctionSolverDefinedRiemann super
double Real
Generic real data.
OneDFSIModelBCFunctionDefault - Base class for deriving specific 1D boundary functions.
std::shared_ptr< source_Type > sourcePtr_Type
void updateBCVariables()
Update the boundary condition variables.
virtual void setupNode()
Automatically identify the boundary node.
OneDFSIFunctionSolverDefinedResistance(const bcSide_Type &bcSide, const bcType_Type &bcType, const Real &resistance)
Constructor.
OneDFSIFunctionSolverDefinedAbsorbing(const bcSide_Type &bcSide, const bcType_Type &bcType)
Constructor.
OneDFSIFunctionSolverDefinedWindkessel3(const OneDFSIFunctionSolverDefinedWindkessel3 &bcFunctionWindkessel3)
Copy constructor.
OneDFSIFunctionSolverDefinedRiemann(const bcSide_Type &bcSide, const bcType_Type &bcType)
Constructor.
void computeEigenValuesVectors()
Compute the current eigenvalues and eigenvectors.
OneDFSIFunctionSolverDefinedAbsorbing super
Real scalarProduct(const container2D_Type &vector1, const container2D_Type &vector2)
Scalar product between 2 2D vectors.
container2D_Type M_bcU
Value of U at the boundary.
uint32_type UInt
generic unsigned integer (used mainly for addressing)
OneDFSIFunctionSolverDefinedRiemann - Class which implements Riemann boundary conditions for the 1D s...
container2D_Type M_leftEigenvector2