melt.cc File Reference
#include <fenv.h>
#include "generic.h"
#include "unsteady_heat.h"
#include "solid.h"
#include "meshes/triangle_mesh.h"
#include "heat_transfer_and_melt_elements.h"

Classes

class  UnsteadyHeatMeltProblem< ELEMENT >
 UnsteadyHeat problem. More...
 

Namespaces

 ProblemParameters
 Namespace for exact solution and problem parameters.
 
 ExactSolution
 Namespace for exact solution.
 

Functions

void ExactSolution::get_exact_u_for_unsteady_heat_validation (const double &t, const Vector< double > &x, Vector< double > &u)
 Exact solution as a Vector. More...
 
void ExactSolution::get_exact_u_for_unsteady_heat_validation (const double &t, const Vector< double > &x, double &u)
 Exact solution as a scalar. More...
 
void ExactSolution::get_source_for_unsteady_heat_validation (const double &t, const Vector< double > &x, double &source)
 Source function to make it an exact solution. More...
 
void ExactSolution::prescribed_flux_for_unsteady_heat_validation (const double &t, const Vector< double > &x, const Vector< double > &n, const double &u, double &flux)
 
double ExactSolution::melting_surface_height (const double &t, const double &x)
 Height of melting surface. More...
 
int main (int argc, char *argv[])
 Driver code for unsteady heat equation. More...
 

Function Documentation

◆ main()

int main ( int argc  ,
char argv[] 
)

Driver code for unsteady heat equation.

///////////////////////////////////////////////////////////////////// ///////////////////////////////////////////////////////////////////// /////////////////////////////////////////////////////////////////////

708 {
709 
710  FiniteElement::Accept_negative_jacobian=true;
711 
712  // Store command line arguments
713  CommandLineArgs::setup(argc,argv);
714 
715  // Define possible command line arguments and parse the ones that
716  // were actually specified
717 
718  // Suppress adaptation
720 
721  // Suppress melting?
722  CommandLineArgs::specify_command_line_flag("--disable_melting");
723 
724  // Suppress melt flux?
725  CommandLineArgs::specify_command_line_flag("--disable_melt_flux");
726 
727  // Non-default initial temperature
730 
731  // Frequency of co-sinusoidal oscillation of incoming heat flux
732  // (to assess suppression of re-freezing).
735 
736  // Validation
738 
739  // Parse command line
741 
742  // Doc what has actually been specified on the command line
744 
745  // Create generalised Hookean constitutive equations
748 
749  // Build problem
753  problem;
754 
755 
756  // Choose simulation interval and timestep
757  double t_max=0.5;
758  double dt=0.01;
759 
760  // Initialise timestep -- also sets the weights for all timesteppers
761  // in the problem.
762  problem.initialise_dt(dt);
763 
764  // Set impulsive IC
765  problem.assign_initial_values_impulsive(dt);
766 
767  //Output initial condition
768  problem.doc_solution();
769 
770  unsigned max_adapt=1;
771  bool first=false;
773  {
774  max_adapt=0;
775  }
776 
777  // Find number of steps
778  unsigned nstep = unsigned(t_max/dt);
779 
780  // Validation?
782  {
783  nstep=5;
784  }
785 
786  // Timestepping loop
787  for (unsigned istep=0;istep<nstep;istep++)
788  {
789  cout << " Timestep " << istep << std::endl;
790 
791  // Dummy double adaptivity (timestep is always accepted because
792  // tolerance is set to huge value; mainly used to automatically
793  // re-solve with smaller timestep increment after non-convergence
794  double epsilon_t=DBL_MAX;
795  unsigned suppress_resolve_after_spatial_adapt_flag=0;
796  double next_dt=
797  problem.doubly_adaptive_unsteady_newton_solve(
798  dt,
799  epsilon_t,
800  max_adapt,
801  suppress_resolve_after_spatial_adapt_flag,
802  first);
803  oomph_info << "Suggested next dt: " << next_dt << std::endl;
804  dt = next_dt;
805 
806  //Output solution
807  problem.doc_solution();
808 
809  }
810 
811 } // end of main
UnsteadyHeat problem.
Definition: melt.cc:186
Definition: constitutive_laws.h:699
UnsteadyHeat upgraded to become projectable.
Definition: unsteady_heat_elements.h:699
Definition: pseudosolid_node_update_elements.h:58
Definition: solid_elements.h:1756
double U0
Constant/initial temperature.
Definition: circular_boulder_melt.cc:99
double Omega_cos
Definition: circular_boulder_melt.cc:109
void setup(Time *time_pt)
Create all GeomObjects needed to define the cylinder and the flag.
Definition: turek_flag_non_fsi.cc:277
double Nu
Poisson's ratio.
Definition: unstructured_two_d_curved.cc:65
ConstitutiveLaw * Constitutive_law_pt
Pointer to constitutive law.
Definition: circular_boulder_melt.cc:76
bool command_line_flag_has_been_set(const std::string &flag)
Definition: oomph_utilities.cc:501
void specify_command_line_flag(const std::string &command_line_flag, const std::string &doc)
Specify possible argument-free command line flag.
Definition: oomph_utilities.cc:451
void parse_and_assign(int argc, char *argv[], const bool &throw_on_unrecognised_args)
Definition: oomph_utilities.cc:760
void doc_specified_flags()
Document specified command line flags.
Definition: oomph_utilities.cc:610
OomphInfo oomph_info
Definition: oomph_definitions.cc:319
Constructor for SteadyAxisymAdvectionDiffusion problem
Definition: steady_axisym_advection_diffusion.cc:213

References oomph::CommandLineArgs::command_line_flag_has_been_set(), ProblemParameters::Constitutive_law_pt, oomph::CommandLineArgs::doc_specified_flags(), ProblemParameters::Nu, ExactSolution::Omega_cos, oomph::oomph_info, oomph::CommandLineArgs::parse_and_assign(), problem, Flag_definition::setup(), oomph::CommandLineArgs::specify_command_line_flag(), and ExactSolution::U0.