30 #include "helmholtz.h" 
   31 #include "time_harmonic_linear_elasticity.h" 
   32 #include "multi_physics.h" 
   35 #include "meshes/annular_mesh.h" 
   38 using namespace oomph;
 
   67  TimeHarmonicIsotropicElasticityTensor 
E(
Nu);
 
   87                                   Vector<std::complex<double> >& u)
 
   89   Vector<double> normal(2);
 
   90   double norm=sqrt(x[0]*x[0]+x[1]*x[1]);
 
   91   double phi=atan2(x[1],x[0]);
 
   95   u[0]=complex<double>(normal[0]*cos(
double(
N)*phi),0.0);
 
   96   u[1]=complex<double>(normal[1]*cos(
double(
N)*phi),0.0);
 
  107  std::complex<double> 
HankelH1(
const double& k, 
const double& x)
 
  109   Vector<std::complex<double> > h(2);
 
  110   Vector<std::complex<double> > hp(2);
 
  111   Hankel_functions_for_helmholtz_problem::Hankel_first(2,x,h,hp);
 
  123     cout << 
"Never get here. k=" << k << std::endl;
 
  126     return std::complex<double>(1.0,1.0); 
 
  135   std::complex<double> MapleGenVar1;
 
  136   std::complex<double> MapleGenVar2;
 
  137   std::complex<double> MapleGenVar3;
 
  138   std::complex<double> MapleGenVar4;
 
  139   std::complex<double> MapleGenVar5;
 
  140   std::complex<double> MapleGenVar6;
 
  141   std::complex<double> MapleGenVar7;
 
  142   std::complex<double> MapleGenVar8;
 
  143   std::complex<double> t0;
 
  146       MapleGenVar3 = (-2.0/(2.0+2.0*
Nu)*1.0+2.0/(2.0+2.0*
Nu)*1.0*
 
  149       MapleGenVar5 = -1/(
Nu/(1.0+
Nu)/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu)-2.0/(2.0+2.0
 
  162       MapleGenVar4 = MapleGenVar5*MapleGenVar6;
 
  163       MapleGenVar2 = MapleGenVar3+MapleGenVar4;
 
  164       MapleGenVar3 = MapleGenVar2;
 
  165       MapleGenVar5 = -(2.0/(2.0+2.0*
Nu)*1.0-2.0/(2.0+2.0*
Nu)*1.0*
 
  167 )/(1.0-2.0*
Nu))/(
Nu/(1.0+
Nu)/(1.0-2.0*
Nu)+2.0/(2.0+2.0*
Nu)-2.0/(2.0+2.0*
Nu)*
 
  184       MapleGenVar6 = MapleGenVar7*MapleGenVar8;
 
  185       MapleGenVar4 = MapleGenVar5+MapleGenVar6;
 
  186       MapleGenVar1 = MapleGenVar3+MapleGenVar4;
 
  188       t0 = MapleGenVar1*MapleGenVar2;
 
  196                              Vector<double>& soln)
 
  199   double r=sqrt(x[0]*x[0]+x[1]*x[1]);
 
  217   Vector<std::complex<double> > h(2),hp(2);
 
  218   Hankel_functions_for_helmholtz_problem::Hankel_first(1,rr,h,hp);
 
  221   double power=sqrt(
K_squared)*0.5*r*2.0*MathematicalConstants::Pi*
 
  222    (imag(C*hp[0])*real(C*h[0])-real(C*hp[0])*imag(C*h[0]));       
 
  234 template<
class ELASTICITY_ELEMENT, 
class HELMHOLTZ_ELEMENT>
 
  252    Helmholtz_outer_boundary_mesh_pt->setup_gamma();
 
  256  void actions_before_adapt();
 
  259  void actions_after_adapt();
 
  267  void create_fsi_traction_elements();
 
  270  void create_helmholtz_fsi_flux_elements();
 
  273  void delete_face_elements(Mesh* 
const & boundary_mesh_pt);
 
  276  void create_helmholtz_DtN_elements();
 
  279  void setup_interaction();
 
  308 template<
class ELASTICITY_ELEMENT, 
class HELMHOLTZ_ELEMENT>
 
  314  double azimuthal_fraction_of_coating=1.0;
 
  329   RefineableTwoDAnnularMesh<ELASTICITY_ELEMENT>
 
  330   (periodic,azimuthal_fraction_of_coating,
 
  350  Helmholtz_mesh_pt = 
new  
  351   RefineableTwoDAnnularMesh<HELMHOLTZ_ELEMENT>
 
  352   (periodic,azimuthal_fraction_of_coating,
 
  353    ntheta_helmholtz,nr_helmholtz,a,h_thick_helmholtz);
 
  357  Solid_mesh_pt->spatial_error_estimator_pt()=
new Z2ErrorEstimator;
 
  358  Helmholtz_mesh_pt->spatial_error_estimator_pt()=
new Z2ErrorEstimator;
 
  364  unsigned nfourier=20;
 
  365  Helmholtz_outer_boundary_mesh_pt = 
 
  371  unsigned n_element=Solid_mesh_pt->nelement();
 
  372  for(
unsigned i=0;i<n_element;i++)
 
  375    ELASTICITY_ELEMENT *el_pt = 
 
  376     dynamic_cast<ELASTICITY_ELEMENT*
>(Solid_mesh_pt->element_pt(i));
 
  387  n_element =Helmholtz_mesh_pt->nelement();
 
  388  for(
unsigned i=0;i<n_element;i++)
 
  391    HELMHOLTZ_ELEMENT *el_pt = 
 
  392     dynamic_cast<HELMHOLTZ_ELEMENT*
>(Helmholtz_mesh_pt->element_pt(i));
 
  401  Solid_mesh_pt->output(
"solid_mesh.dat");
 
  402  Helmholtz_mesh_pt->output(
"helmholtz_mesh.dat");
 
  403  Solid_mesh_pt->output_boundaries(
"solid_mesh_boundary.dat");
 
  404  Helmholtz_mesh_pt->output_boundaries(
"helmholtz_mesh_boundary.dat");
 
  411  FSI_traction_mesh_pt=
new Mesh;
 
  412  create_fsi_traction_elements(); 
 
  415  Helmholtz_fsi_flux_mesh_pt=
new Mesh;
 
  416  create_helmholtz_fsi_flux_elements();
 
  419  create_helmholtz_DtN_elements();
 
  426  add_sub_mesh(Solid_mesh_pt);
 
  429  add_sub_mesh(FSI_traction_mesh_pt);
 
  432  add_sub_mesh(Helmholtz_mesh_pt);
 
  435  add_sub_mesh(Helmholtz_fsi_flux_mesh_pt);
 
  438  add_sub_mesh(Helmholtz_outer_boundary_mesh_pt); 
 
  447  unsigned n_node = Solid_mesh_pt->nboundary_node(0);
 
  448  Vector<std::complex<double> > u(2);
 
  450  for(
unsigned i=0;i<n_node;i++)
 
  452    Node* nod_pt=Solid_mesh_pt->boundary_node_pt(0,i);
 
  464    nod_pt->set_value(0,u[0].real());
 
  467    nod_pt->set_value(1,u[1].real());
 
  470    nod_pt->set_value(2,u[0].imag());
 
  473    nod_pt->set_value(3,u[1].imag());
 
  482  oomph_info << 
"Number of unknowns: " << assign_eqn_numbers() << std::endl; 
 
  489  sprintf(filename,
"%s/trace.dat",Doc_info.directory().c_str());
 
  490  Trace_file.open(filename);
 
  499 template<
class ELASTICITY_ELEMENT, 
class HELMHOLTZ_ELEMENT>
 
  504  delete_face_elements(FSI_traction_mesh_pt);
 
  507  delete_face_elements(Helmholtz_fsi_flux_mesh_pt);
 
  510  delete_face_elements(Helmholtz_outer_boundary_mesh_pt);
 
  513  rebuild_global_mesh();
 
  522 template<
class ELASTICITY_ELEMENT, 
class HELMHOLTZ_ELEMENT>
 
  528  create_fsi_traction_elements();
 
  531  create_helmholtz_fsi_flux_elements();
 
  535  create_helmholtz_DtN_elements();
 
  541  rebuild_global_mesh();
 
  549 template<
class ELASTICITY_ELEMENT, 
class HELMHOLTZ_ELEMENT>
 
  554  unsigned n_element = boundary_mesh_pt->nelement();
 
  557  for(
unsigned e=0;e<n_element;e++)
 
  560    delete boundary_mesh_pt->element_pt(e);
 
  564  boundary_mesh_pt->flush_element_and_node_storage();
 
  573 template<
class ELASTICITY_ELEMENT, 
class HELMHOLTZ_ELEMENT>
 
  581  unsigned n_element = Solid_mesh_pt->nboundary_element(b);
 
  584  for(
unsigned e=0;e<n_element;e++)
 
  587    ELASTICITY_ELEMENT* bulk_elem_pt = 
dynamic_cast<ELASTICITY_ELEMENT*
>(
 
  588     Solid_mesh_pt->boundary_element_pt(b,e));
 
  591    int face_index = Solid_mesh_pt->face_index_at_boundary(b,e);
 
  594    TimeHarmonicLinElastLoadedByHelmholtzPressureBCElement
 
  595     <ELASTICITY_ELEMENT,HELMHOLTZ_ELEMENT>* el_pt=
 
  596     new TimeHarmonicLinElastLoadedByHelmholtzPressureBCElement
 
  597     <ELASTICITY_ELEMENT,HELMHOLTZ_ELEMENT>(bulk_elem_pt,
 
  600    FSI_traction_mesh_pt->add_element_pt(el_pt);
 
  604    el_pt->set_boundary_number_in_bulk_mesh(b); 
 
  619 template<
class ELASTICITY_ELEMENT, 
class HELMHOLTZ_ELEMENT>
 
  628  unsigned n_element = Helmholtz_mesh_pt->nboundary_element(b);
 
  631  for(
unsigned e=0;e<n_element;e++)
 
  634    HELMHOLTZ_ELEMENT* bulk_elem_pt = 
dynamic_cast<HELMHOLTZ_ELEMENT*
>(
 
  635     Helmholtz_mesh_pt->boundary_element_pt(b,e));
 
  638    int face_index = Helmholtz_mesh_pt->face_index_at_boundary(b,e);
 
  641    HelmholtzFluxFromNormalDisplacementBCElement
 
  642     <HELMHOLTZ_ELEMENT,ELASTICITY_ELEMENT>* el_pt=
 
  643     new HelmholtzFluxFromNormalDisplacementBCElement
 
  644     <HELMHOLTZ_ELEMENT,ELASTICITY_ELEMENT>(bulk_elem_pt,
 
  648    Helmholtz_fsi_flux_mesh_pt->add_element_pt(el_pt);
 
  652    el_pt->set_boundary_number_in_bulk_mesh(b); 
 
  663 template<
class ELASTICITY_ELEMENT, 
class HELMHOLTZ_ELEMENT>
 
  671  unsigned n_element = Helmholtz_mesh_pt->nboundary_element(b);
 
  674  for(
unsigned e=0;e<n_element;e++)
 
  677    HELMHOLTZ_ELEMENT* bulk_elem_pt = 
dynamic_cast<HELMHOLTZ_ELEMENT*
>(
 
  678     Helmholtz_mesh_pt->boundary_element_pt(b,e));
 
  681    int face_index = Helmholtz_mesh_pt->face_index_at_boundary(b,e);
 
  684    HelmholtzDtNBoundaryElement<HELMHOLTZ_ELEMENT>* flux_element_pt = 
new  
  685     HelmholtzDtNBoundaryElement<HELMHOLTZ_ELEMENT>(bulk_elem_pt,face_index);
 
  689    flux_element_pt->set_outer_boundary_mesh_pt(
 
  690     Helmholtz_outer_boundary_mesh_pt);  
 
  693    Helmholtz_outer_boundary_mesh_pt->add_element_pt(flux_element_pt);
 
  704 template<
class ELASTICITY_ELEMENT, 
class HELMHOLTZ_ELEMENT>
 
  709  unsigned boundary_in_helmholtz_mesh=0;
 
  710   Multi_domain_functions::setup_bulk_elements_adjacent_to_face_mesh
 
  711   <HELMHOLTZ_ELEMENT,2>
 
  712   (
this,boundary_in_helmholtz_mesh,Helmholtz_mesh_pt,FSI_traction_mesh_pt);
 
  715  unsigned boundary_in_solid_mesh=2;
 
  716  Multi_domain_functions::setup_bulk_elements_adjacent_to_face_mesh
 
  717   <ELASTICITY_ELEMENT,2>(
 
  718    this,boundary_in_solid_mesh,Solid_mesh_pt,Helmholtz_fsi_flux_mesh_pt);
 
  726 template<
class ELASTICITY_ELEMENT, 
class HELMHOLTZ_ELEMENT>
 
  730  ofstream some_file,some_file2;
 
  738  sprintf(filename,
"%s/power%i.dat",Doc_info.directory().c_str(),
 
  740  some_file.open(filename);
 
  744  unsigned nn_element=Helmholtz_outer_boundary_mesh_pt->nelement(); 
 
  745  for(
unsigned e=0;e<nn_element;e++)
 
  747    HelmholtzBCElementBase<HELMHOLTZ_ELEMENT> *el_pt = 
 
  748     dynamic_cast<HelmholtzBCElementBase<HELMHOLTZ_ELEMENT>*
>(
 
  749      Helmholtz_outer_boundary_mesh_pt->element_pt(e)); 
 
  750    power += el_pt->global_power_contribution(some_file);
 
  753  oomph_info << 
"Step: " << Doc_info.number() 
 
  758             << 
" Total radiated power " << power  << 
"\n" 
  759             << 
" Axisymmetric radiated power "  << 
"\n" 
  773  std::ostringstream case_string;
 
  774  case_string << 
"TEXT X=10,Y=90, T=\"Q="  
  776              << 
",  k<sup>2</sup>=" 
  778              << 
",  density ratio=" 
  787  sprintf(filename,
"%s/elast_soln%i.dat",Doc_info.directory().c_str(),
 
  789  some_file.open(filename);
 
  790  Solid_mesh_pt->output(some_file,n_plot);
 
  796  sprintf(filename,
"%s/traction_soln%i.dat",Doc_info.directory().c_str(),
 
  798  some_file.open(filename);
 
  799  FSI_traction_mesh_pt->output(some_file,n_plot);
 
  805  sprintf(filename,
"%s/flux_bc_soln%i.dat",Doc_info.directory().c_str(),
 
  807  some_file.open(filename);
 
  808  Helmholtz_fsi_flux_mesh_pt->output(some_file,n_plot);
 
  814  sprintf(filename,
"%s/helmholtz_soln%i.dat",Doc_info.directory().c_str(),
 
  816  some_file.open(filename);
 
  817  Helmholtz_mesh_pt->output(some_file,n_plot);
 
  818  some_file << case_string.str();
 
  824  sprintf(filename,
"%s/exact_helmholtz_soln%i.dat",Doc_info.directory().c_str(),
 
  826  some_file.open(filename);
 
  827  Helmholtz_mesh_pt->output_fct(some_file,n_plot,
 
  833       << Doc_info.number() << 
")\n";
 
  845 int main(
int argc, 
char **argv)
 
  849  CommandLineArgs::setup(argc,argv);
 
  855  CommandLineArgs::specify_command_line_flag(
"--dir",
 
  862  CommandLineArgs::specify_command_line_flag(
"--el_multiplier",
 
  866  CommandLineArgs::specify_command_line_flag(
"--outer_radius",
 
  871  CommandLineArgs::specify_command_line_flag(
"--nstep",&nstep);
 
  874  double q_increment=5.0;
 
  875  CommandLineArgs::specify_command_line_flag(
"--q_increment",&q_increment);
 
  878  unsigned max_adapt=3;
 
  879  CommandLineArgs::specify_command_line_flag(
"--max_adapt",&max_adapt);
 
  882  CommandLineArgs::parse_and_assign(); 
 
  885  CommandLineArgs::doc_specified_flags();
 
  889                    RefineableQHelmholtzElement<2,3> > problem; 
 
  897  for(
unsigned i=0;i<nstep;i++)
 
  901    problem.newton_solve(max_adapt);
 
int main(int argc, char **argv)
Driver for acoustic fsi problem.
HelmholtzDtNMesh< HELMHOLTZ_ELEMENT > * Helmholtz_outer_boundary_mesh_pt
Pointer to mesh containing the DtN elements.
void create_fsi_traction_elements()
Create FSI traction elements.
Mesh * Helmholtz_fsi_flux_mesh_pt
Pointer to mesh of Helmholtz FSI flux elements.
void create_helmholtz_DtN_elements()
Create DtN face elements.
void create_helmholtz_fsi_flux_elements()
Create Helmholtz FSI flux elements.
void actions_before_newton_solve()
Update function (empty)
void delete_face_elements(Mesh *const &boundary_mesh_pt)
Delete (face) elements in specified mesh.
ofstream Trace_file
Trace file.
void actions_before_adapt()
Actions before adapt: Wipe the mesh of traction elements.
void actions_before_newton_convergence_check()
Recompute gamma integral before checking Newton residuals.
void actions_after_adapt()
Actions after adapt: Rebuild the mesh of traction elements.
CoatedDiskProblem()
Constructor:
void actions_after_newton_solve()
Update function (empty)
TreeBasedRefineableMeshBase * Solid_mesh_pt
Pointer to solid mesh.
DocInfo Doc_info
DocInfo object for output.
void setup_interaction()
Setup interaction.
TreeBasedRefineableMeshBase * Helmholtz_mesh_pt
Pointer to Helmholtz mesh.
Mesh * FSI_traction_mesh_pt
Pointer to mesh of FSI traction elements.
void doc_solution()
Doc the solution.
/////////////////////////////////////////////////////////////////// /////////////////////////////////...
std::complex< double > HankelH1(const double &k, const double &x)
Interface to Hankel function in maple style.
std::complex< double > axisym_coefficient()
Coefficient in front of Hankel function for axisymmetric solution of Helmholtz potential.
double Nu
Poisson's ratio.
string Directory
Output directory.
unsigned El_multiplier
Multiplier for number of elements.
double Density_ratio
Density ratio: solid to fluid.
double exact_axisym_radiated_power()
Exact radiated power for axisymmetric solution.
double Outer_radius
Radius of outer boundary of Helmholtz domain.
double K_squared
Square of wavenumber for the Helmholtz equation.
void solid_boundary_displacement(const Vector< double > &x, Vector< std::complex< double > > &u)
Displacement field on inner boundary of solid.
void update_parameter_values()
Function to update dependent parameter values.
double H_coating
Non-dim thickness of elastic coating.
TimeHarmonicIsotropicElasticityTensor E(Nu)
The elasticity tensor for the solid.
void exact_axisym_potential(const Vector< double > &x, Vector< double > &soln)
Exact solution for Helmholtz potential for axisymmetric solution.
double Omega_sq
Non-dim square of frequency for solid – dependent variable!
unsigned N
Azimuthal wavenumber for imposed displacement of coating on inner boundary.