The Navier-Stokes equations on the driven cavity benchmark with the method of characteristics.
The Navier-Stokes equations on the driven cavity benchmark with the method of characteristics
int main (
int argc,
char**argv) {
if (argc < 2) {
cerr << "usage: " << argv[0] << " <geo> <Re> <err> <n_adapt>" << endl;
exit (1);
}
Float Re = (argc > 2) ? atof(argv[2]) : 100;
options.
err = (argc > 3) ? atof(argv[3]) : 1e-2;
size_t n_adapt = (argc > 4) ? atoi(argv[4]) : 5;
for (size_t i = 0; true; i++) {
size_t max_iter = 1000;
if (i >= n_adapt) break;
omega = adapt (ch, options);
o.
open (omega.name(),
"geo");
o << omega;
Qh =
space (omega,
"P1");
}
}
The driven cavity benchmark: 2D boundary conditions.
see the Float page for the full documentation
see the field page for the full documentation
see the geo page for the full documentation
see the catchmark page for the full documentation
see the environment page for the full documentation
odiststream: see the diststream page for the full documentation
void open(std::string filename, std::string suffix="", io::mode_type mode=io::out, const communicator &comm=communicator())
This routine opens a physical output file.
see the space page for the full documentation
This file is part of Rheolef.
The Navier-Stokes equations – adaptive mesh criterion.
field navier_stokes_criterion(Float Re, const field &uh)
The Navier-Stokes equations with the method of characteristics – solver function.
int navier_stokes_solve(Float Re, Float delta_t, field l0h, field &uh, field &ph, size_t &max_iter, Float &tol, odiststream *p_derr=0)
rheolef - reference manual
static space velocity_space(const geo &omega, string approx)
static field velocity_field(const space &Xh, Float alpha=1)
adapt_option: see the adapt page for the full documentation