34 #include "navier_stokes.h" 37 #include "meshes/tetgen_mesh.h" 41 using namespace oomph;
58 template<
class ELEMENT>
66 const string& node_file_name,
67 const string& element_file_name,
68 const string& face_file_name);
84 void actions_before_newton_solve();
110 template<
class ELEMENT>
112 const string& node_file_name,
113 const string& element_file_name,
114 const string& face_file_name)
125 sprintf(filename,
"boundaries.dat");
126 some_file.open(filename);
127 mesh_pt()->output_boundaries(some_file);
140 unsigned num_nod=
mesh_pt()->nboundary_node(ibound);
141 for (
unsigned inod=0;inod<num_nod;inod++)
143 mesh_pt()->boundary_node_pt(ibound,inod)->pin(1);
144 mesh_pt()->boundary_node_pt(ibound,inod)->pin(2);
155 unsigned num_nod=
mesh_pt()->nboundary_node(ibound);
156 for (
unsigned inod=0;inod<num_nod;inod++)
158 mesh_pt()->boundary_node_pt(ibound,inod)->pin(0);
159 mesh_pt()->boundary_node_pt(ibound,inod)->pin(1);
160 mesh_pt()->boundary_node_pt(ibound,inod)->pin(2);
168 unsigned n_element =
mesh_pt()->nelement();
169 for(
unsigned i=0;i<n_element;i++)
172 ELEMENT* el_pt =
dynamic_cast<ELEMENT*
>(
mesh_pt()->element_pt(i));
180 cout <<
"Number of equations: " << assign_eqn_numbers() << std::endl;
188 template<
class ELEMENT>
194 unsigned num_nod=
mesh_pt()->nboundary_node(ibound);
195 for (
unsigned inod=0;inod<num_nod;inod++)
198 mesh_pt()->boundary_node_pt(ibound,inod)->set_value(2,1.0);
208 template<
class ELEMENT>
220 sprintf(filename,
"%s/soln%i.dat",
Doc_info.directory().c_str(),
222 some_file.open(filename);
223 mesh_pt()->output(some_file,npts);
239 int main(
int argc,
char* argv[])
243 CommandLineArgs::setup(argc,argv);
248 std::string error_message =
249 "Wrong number of command line arguments.\n";
251 "Must specify the following file names \n";
253 "filename.node then filename.ele then filename.face\n";
255 throw OomphLibError(error_message,
256 OOMPH_CURRENT_FUNCTION,
257 OOMPH_EXCEPTION_LOCATION);
261 string node_file_name(argv[1]);
262 string element_file_name(argv[2]);
263 string face_file_name(argv[3]);
269 doc_info.set_directory(
"RESLT");
273 problem(doc_info,node_file_name,element_file_name,face_file_name);
276 problem.newton_solve();
DocInfo Doc_info
Doc info object.
void actions_before_newton_solve()
Update the problem specs before solve.
Driver for a 3D navier stokes flow with tetgen.
int main(int argc, char *argv[])
3D Navier Stokes on an unstructured mesh
void actions_after_newton_solve()
Doc the solution after solve.
NavierStokesProblem(DocInfo &doc_info, const string &node_file_name, const string &element_file_name, const string &face_file_name)
Constructor: Pass DocInfo object and file names.
Unstructured tet mesh based on output from Tetgen: http://wias-berlin.de/software/tetgen/.
~NavierStokesProblem()
Destructor (empty)
double Re
Reynolds number.
TetgenMesh< ELEMENT > * mesh_pt()
Entry flow problem in quarter tube domain.
void doc_solution()
Doc the solution.
Namespace for physical parameters.