1 #include <lifev/navier_stokes_blocks/solver/StabilizationSUPG_semi_implicit.hpp> 4 #define TAU_M value(1.0
)/( eval(squareroot,TAU_M_DEN) ) 6 #define TAU_M_DEN_DT value(M_density*M_density)*value(M_bdfOrder*M_bdfOrder)/value(M_timestep * M_timestep) 7 #define TAU_M_DEN_VEL ( value(M_density*M_density)*dot(value(M_fespaceUETA, velocity_extrapolated_rep), G* value(M_fespaceUETA, velocity_extrapolated_rep)) ) 8 #define TAU_M_DEN_VISC ( value(M_C_I)*value(M_viscosity*M_viscosity) *dot (G, G) ) 11 #define TAU_C value(1.0
)/( dot(g, TAU_M*g ) ) 20 StabilizationSUPG_semi_implicit::StabilizationSUPG_semi_implicit():
21 M_label(
"SUPG_semi_implicit")
29 void StabilizationSUPG_semi_implicit::setConstant(
const int & value)
33 else if ( value == 2 )
36 ASSERT(0!=0,
"Please implement a suitable value for M_C_I for your velocity FE order");
40 void StabilizationSUPG_semi_implicit::apply_matrix(
const vector_Type& velocityExtrapolated )
43 M_block_00.reset (
new matrix_Type ( M_uFESpace->map() ) );
45 M_block_01.reset (
new matrix_Type ( M_uFESpace->map() ) );
47 M_block_10.reset (
new matrix_Type ( M_pFESpace->map() ) );
49 M_block_11.reset (
new matrix_Type ( M_pFESpace->map() ) );
59 vector_Type velocity_extrapolated_rep( velocityExtrapolated, Repeated);
60 std::shared_ptr<SquareRoot_supg_semi_implicit> squareroot(
new SquareRoot_supg_semi_implicit());
62 using namespace ExpressionAssembly;
65 elements(M_uFESpace->mesh()),
71 dot( value(M_fespaceUETA, velocity_extrapolated_rep)*grad(phi_i), value(M_density*M_density*M_alpha/M_timestep) * phi_j
72 +value(M_density*M_density) * value(M_fespaceUETA, velocity_extrapolated_rep)*grad(phi_j)
73 -value(M_density*M_viscosity)*laplacian(phi_j)
78 +
TAU_C*div(phi_i)*div(phi_j)
82 M_block_00->globalAssemble();
85 elements(M_uFESpace->mesh()),
92 dot( grad(phi_i), value(M_density*M_alpha/M_timestep)*phi_j
93 +value(M_density)*value(M_fespaceUETA, velocity_extrapolated_rep)*grad(phi_j)
94 -value(M_viscosity)*laplacian(phi_j)
101 M_block_10->globalAssemble( M_uFESpace->mapPtr(), M_pFESpace->mapPtr() );
104 elements(M_uFESpace->mesh()),
109 TAU_M*value(M_density)*dot( value(M_fespaceUETA, velocity_extrapolated_rep)*grad(phi_i), grad(phi_j) )
113 M_block_01->globalAssemble( M_pFESpace->mapPtr(), M_uFESpace->mapPtr() );
116 elements(M_uFESpace->mesh()),
121 TAU_M*dot( grad(phi_j), grad(phi_i) )
125 M_block_11->globalAssemble();
129 void StabilizationSUPG_semi_implicit::apply_vector( vectorPtr_Type& rhs_velocity,
130 vectorPtr_Type& rhs_pressure,
131 const vector_Type& velocityExtrapolated,
132 const vector_Type& velocity_rhs)
134 M_rhsVelocity.reset(
new vector_Type ( velocity_rhs, Unique ) );
136 vector_Type velocity_rhs_rep( velocity_rhs, Repeated);
138 vector_Type velocity_extrapolated_rep( velocityExtrapolated, Repeated);
140 std::shared_ptr<SquareRoot_supg_semi_implicit> squareroot(
new SquareRoot_supg_semi_implicit());
142 using namespace ExpressionAssembly;
145 elements(M_uFESpace->mesh()),
149 TAU_M*value(M_density*M_density)*dot( value(M_fespaceUETA, velocity_extrapolated_rep)*grad(phi_i), value(M_fespaceUETA, velocity_rhs_rep) )
154 elements(M_uFESpace->mesh()),
158 TAU_M*value(M_density)*dot( grad(phi_i), value(M_fespaceUETA, velocity_rhs_rep))