77 f_jac_x = RealMatrixX::Zero( n2, n2),
78 fm_jac_xdot = RealMatrixX::Zero( n2, n2);
90 local_jac = ComplexMatrixX::Zero( n2, n2);
96 local_f = RealVectorX::Zero(n2);
124 local_jac = (f_jac_x.cast<
Complex>() * b_V +
125 iota * omega * fm_jac_xdot.cast<
Complex>());
127 if (request_jacobian)
132 return request_jacobian;
142 bool request_jacobian,
157 f_jac_x = RealMatrixX::Zero( n2, n2),
158 fm_jac_xdot = RealMatrixX::Zero( n2, n2);
170 local_jac = ComplexMatrixX::Zero( n2, n2),
171 local_jac_sens = ComplexMatrixX::Zero( n2, n2);
177 local_f = RealVectorX::Zero(n2);
208 local_jac = (f_jac_x.cast<
Complex>() * b_V +
209 iota * omega * fm_jac_xdot.cast<
Complex>());
211 local_jac_sens = (iota * domega * fm_jac_xdot.cast<
Complex>());
214 if (request_jacobian)
215 jac += local_jac_sens;
219 return request_jacobian;
230 std::multimap<libMesh::boundary_id_type, MAST::BoundaryConditionBase*>& bc) {
243 f_jac_x = RealMatrixX::Zero(n2, n2);
246 local_f = RealVectorX::Zero(n2);
253 std::map<unsigned int, std::vector<MAST::BoundaryConditionBase*>> loads;
256 std::map<unsigned int, std::vector<MAST::BoundaryConditionBase*>>::const_iterator
260 for ( ; it != end; it++) {
262 std::vector<MAST::BoundaryConditionBase*>::const_iterator
263 bc_it = it->second.begin(),
264 bc_end = it->second.end();
266 for ( ; bc_it != bc_end; bc_it++) {
269 switch ((*bc_it)->type()) {
287 if (request_jacobian)
288 jac += f_jac_x.cast<
Complex>() * b_V;
322 if (request_jacobian)
323 jac += f_jac_x.cast<
Complex>() * b_V;
342 return request_jacobian;
353 bool request_jacobian,
356 std::multimap<libMesh::boundary_id_type, MAST::BoundaryConditionBase*>& bc) {
369 f_jac_x = RealMatrixX::Zero(n2, n2);
372 local_f = RealVectorX::Zero(n2);
378 std::map<unsigned int, std::vector<MAST::BoundaryConditionBase*>> loads;
381 std::map<unsigned int, std::vector<MAST::BoundaryConditionBase*>>::const_iterator
385 for ( ; it != end; it++) {
387 std::vector<MAST::BoundaryConditionBase*>::const_iterator
388 bc_it = it->second.begin(),
389 bc_end = it->second.end();
391 for ( ; bc_it != bc_end; bc_it++) {
394 switch ((*bc_it)->type()) {
466 return request_jacobian;
479 const unsigned int s,
491 const std::vector<Real> &JxW = fe->get_JxW();
492 const std::vector<libMesh::Point>& normals = fe->get_normals_for_reference_coordinate();
493 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
498 n2 = fe->n_shape_functions()*n1;
501 vec1_n1 = RealVectorX::Zero(n1),
502 uvec = RealVectorX::Zero(3),
503 dwdot_i = RealVectorX::Zero(3),
504 ni = RealVectorX::Zero(3),
505 dni = RealVectorX::Zero(3),
506 tmp = RealVectorX::Zero(6);
509 Dw_i = ComplexVectorX::Zero(3),
510 Dni = ComplexVectorX::Zero(3),
511 Duvec = ComplexVectorX::Zero(3),
512 vec2_n1 = ComplexVectorX::Zero(n1),
513 vec2_n2 = ComplexVectorX::Zero(n2),
514 flux = ComplexVectorX::Zero(n1),
515 tmp_c = ComplexVectorX::Zero(6);
518 mat1_n1n1 = RealMatrixX::Zero( n1, n1),
519 mat2_n1n2 = RealMatrixX::Zero( n1, n2),
520 mat3_n2n2 = RealMatrixX::Zero( n2, n2);
531 Dvi_ni_freq_indep = 0.,
532 Dvi_ni_freq_dep = 0.;
547 *displ_perturb =
nullptr;
549 *n_rot_perturb =
nullptr;
554 if (bc.
contains(
"normal_rotation")) {
561 if (bc.
contains(
"frequency_domain_displacement")) {
565 libmesh_assert(bc.
contains(
"frequency_domain_normal_rotation"));
579 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
587 primitive_sol.
zero();
588 primitive_sol.
init(dim,
595 sd_primitive_sol.
zero();
622 for (
unsigned int i_dim=0; i_dim<
dim; i_dim++)
623 ni(i_dim) = normals[qp](i_dim);
638 (*vel)(qpoint[qp],
_time, tmp);
639 dwdot_i = tmp.topRows(3);
643 (*n_rot)(qpoint[qp], normals[qp],
_time, dni);
645 ui_ni_steady = dwdot_i.dot(ni+dni) - uvec.dot(dni);
647 flux += ui_ni_steady * b_V * vec2_n1;
648 flux(n1-1) += ui_ni_steady * b_V * sd_primitive_sol.
dp;
655 (*displ_perturb)(qpoint[qp],
_time, tmp_c);
656 Dw_i = tmp_c.topRows(3);
657 (*n_rot_perturb)(qpoint[qp], normals[qp],
_time, Dni);
660 Dvi_ni_freq_dep = Dw_i.dot(ni+dni) * iota * omega;
661 Dvi_ni_freq_indep = (dwdot_i.cast<
Complex>().dot(Dni) -
662 uvec.cast<
Complex>().dot(Dni) -
666 flux += (Dvi_ni_freq_indep * b_V +
667 Dvi_ni_freq_dep) * vec1_n1;
668 flux(n1-1) += (Dvi_ni_freq_indep * b_V +
669 Dvi_ni_freq_dep) * primitive_sol.
p;
672 flux.segment(1, dim) += ((sd_primitive_sol.
dp * b_V) *
673 ni.segment(0,dim).cast<
Complex>());
676 f += JxW[qp] * vec2_n2;
678 if ( request_jacobian ) {
691 jac += (JxW[qp] * b_V) * mat3_n2n2.cast<
Complex>() ;
695 return request_jacobian;
706 bool request_jacobian,
709 const unsigned int s,
721 const std::vector<Real> &JxW = fe->get_JxW();
722 const std::vector<libMesh::Point>& normals = fe->get_normals_for_reference_coordinate();
723 const std::vector<libMesh::Point>& qpoint = fe->get_xyz();
728 n2 = fe->n_shape_functions()*n1;
731 vec1_n1 = RealVectorX::Zero(n1),
732 uvec = RealVectorX::Zero(3),
733 ni = RealVectorX::Zero(3),
734 dni = RealVectorX::Zero(3),
735 dwdot_i = RealVectorX::Zero(3),
736 tmp = RealVectorX::Zero(6);
739 vec2_n1 = ComplexVectorX::Zero(n1),
740 vec2_n2 = ComplexVectorX::Zero(n2),
741 flux = ComplexVectorX::Zero(n1),
742 tmp_c = ComplexVectorX::Zero(6),
743 Dw_i = ComplexVectorX::Zero(3),
744 Dni = ComplexVectorX::Zero(3);
747 mat1_n1n1 = RealMatrixX::Zero( n1, n1),
748 mat2_n1n2 = RealMatrixX::Zero( n1, n2),
749 mat3_n2n2 = RealMatrixX::Zero( n2, n2);
760 Dvi_ni_freq_indep = 0.,
761 Dvi_ni_freq_dep = 0.;
776 *displ_perturb =
nullptr;
778 *n_rot_perturb =
nullptr;
785 libmesh_assert( bc.
contains(
"normal_rotation"));
793 if (bc.
contains(
"frequency_domain_displacement")) {
797 libmesh_assert( bc.
contains(
"frequency_domain_normal_rotation"));
810 for (
unsigned int qp=0; qp<JxW.size(); qp++) {
818 primitive_sol.
zero();
819 primitive_sol.
init(dim,
826 sd_primitive_sol.
zero();
851 for (
unsigned int i_dim=0; i_dim<
dim; i_dim++)
852 ni(i_dim) = normals[qp](i_dim);
863 (*displ) (qpoint[qp],
_time, tmp);
864 dwdot_i = tmp.topRows(3);
865 (*n_rot)(qpoint[qp], normals[qp],
_time, dni);
873 (*displ_perturb)(qpoint[qp],
_time, tmp_c);
874 Dw_i = tmp_c.topRows(3);
875 (*n_rot_perturb)(qpoint[qp], normals[qp],
_time, Dni);
879 Dvi_ni_freq_dep = Dw_i.dot(ni+dni) * iota * domega;
882 flux += Dvi_ni_freq_dep * vec1_n1;
883 flux(n1-1) += Dvi_ni_freq_dep * primitive_sol.
p;
887 f += JxW[qp] * vec2_n2;
889 if ( request_jacobian ) {
890 libmesh_assert(
false);
895 return request_jacobian;
This class provides the necessary functionality for spatial discretization of the conservative fluid ...
Class defines basic operations and calculation of the small disturbance primitive variables...
virtual void external_side_loads_for_quadrature_elem(std::multimap< libMesh::boundary_id_type, MAST::BoundaryConditionBase *> &bc, std::map< unsigned int, std::vector< MAST::BoundaryConditionBase *>> &loads) const
From the given list of boundary loads, this identifies the sides of the quadrature element and the lo...
virtual bool internal_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, ComplexVectorX &f, ComplexMatrixX &jac)
sensitivity of internal force contribution to system residual.
const MAST::GeomElem & _elem
geometric element for which the computations are performed
void calculate_advection_flux_jacobian_for_moving_solid_wall_boundary(const MAST::PrimitiveSolution &sol, const Real ui_ni, const libMesh::Point &nvec, const RealVectorX &dnvec, RealMatrixX &mat)
Class defines the conversion and some basic operations on primitive fluid variables used in calculati...
void init(const MAST::PrimitiveSolution &sol, const typename VectorType< ValType >::return_type &delta_sol, bool if_viscous)
virtual bool internal_residual(bool request_jacobian, ComplexVectorX &f, ComplexMatrixX &jac)
internal force contribution to system residual
ComplexVectorX _complex_sol
local solution used for frequency domain analysis
Matrix< Complex, Dynamic, 1 > ComplexVectorX
void get_uvec(RealVectorX &u) const
virtual bool side_external_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, ComplexVectorX &f, ComplexMatrixX &jac, std::multimap< libMesh::boundary_id_type, MAST::BoundaryConditionBase *> &bc)
sensitivity of internal force contribution to system residual.
virtual bool velocity_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac_xdot, RealMatrixX &jac)
inertial force contribution to system residual
MAST::FrequencyFunction * freq
frequency function that provides the frequency for computations.
FrequencyDomainLinearizedConservativeFluidElem(MAST::SystemInitialization &sys, const MAST::GeomElem &elem, const MAST::FlightCondition &f)
const MAST::FlightCondition * flight_condition
This defines the surface motion for use with the nonlinear fluid solver.
virtual bool symmetry_surface_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int s, MAST::BoundaryConditionBase &bc)
void nondimensionalizing_factor(Real &v)
bool contains(const std::string &nm) const
checks if the card contains the specified property value
Matrix< Real, Dynamic, Dynamic > RealMatrixX
Matrix< Complex, Dynamic, Dynamic > ComplexMatrixX
ComplexVectorX _complex_sol_sens
local solution used for frequency domain analysis
void right_multiply(T &r, const T &m) const
[R] = [this] * [M]
void get_duvec(typename VectorType< ValType >::return_type &du) const
void vector_mult_transpose(T &res, const T &v) const
res = v^T * [this]
Matrix< Real, Dynamic, 1 > RealVectorX
void right_multiply_transpose(T &r, const T &m) const
[R] = [this]^T * [M]
virtual ~FrequencyDomainLinearizedConservativeFluidElem()
RealVectorX _sol
local solution
virtual bool internal_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac)
internal force contribution to system residual
void init(const unsigned int dim, const RealVectorX &conservative_sol, const Real cp_val, const Real cv_val, bool if_viscous)
This class acts as a wrapper around libMesh::Elem for the purpose of providing a uniform interface fo...
bool side_external_residual(bool request_jacobian, ComplexVectorX &f, ComplexMatrixX &jac, std::multimap< libMesh::boundary_id_type, MAST::BoundaryConditionBase *> &bc)
side external force contribution to system residual
void _initialize_fem_interpolation_operator(const unsigned int qp, const unsigned int dim, const MAST::FEBase &fe, MAST::FEMOperatorMatrix &Bmat)
GasProperty gas_property
Ambient air properties.
const ValType & get(const std::string &nm) const
returns a constant reference to the specified function
virtual std::unique_ptr< MAST::FEBase > init_side_fe(unsigned int s, bool init_grads, bool init_second_order_derivative, int extra_quadrature_order=0) const
initializes the finite element shape function and quadrature object for the side with the order of qu...
virtual bool slip_wall_surface_residual_sensitivity(const MAST::FunctionBase &p, bool request_jacobian, ComplexVectorX &f, ComplexMatrixX &jac, const unsigned int s, MAST::BoundaryConditionBase &bc)
sensitivity of residual of the slip wall that may be oscillating.
virtual bool far_field_surface_residual(bool request_jacobian, RealVectorX &f, RealMatrixX &jac, const unsigned int s, MAST::BoundaryConditionBase &bc)
virtual void derivative(const MAST::FunctionBase &f, Real &v) const
calculates the value of the function derivative and returns it in v.
void left_multiply(T &r, const T &m) const
[R] = [M] * [this]
const Real & _time
time for which system is being assembled
virtual bool slip_wall_surface_residual(bool request_jacobian, ComplexVectorX &f, ComplexMatrixX &jac, const unsigned int s, MAST::BoundaryConditionBase &bc)
residual of the slip wall that may be oscillating.