-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain-ldc.cpp
More file actions
23 lines (22 loc) · 831 Bytes
/
Copy pathmain-ldc.cpp
File metadata and controls
23 lines (22 loc) · 831 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
#include "cfd_solver.hpp"
int main() {
using cfdsolv = CFD::CFDSolver<double>;
using bedge = cfdsolv::BoundaryEdge_t;
using bcond = cfdsolv::BoundaryCondition_t;
cfdsolv::numeric_parameters np{ 0.5, 1.7, 0.001, 100 };
cfdsolv::problem_data pd{ 10, 0, 0 };
cfdsolv::time_parameters tp{ 0.5, 0.0, 0.02, 2.0, 2.0 };
cfdsolv::problem_geometry pg { 10, 10, 50, 50 };
using vec_t = cfdsolv::VectorType;
vec_t u(52, 52, 0.);
vec_t v(52, 52, 0.);
vec_t p(52, 52, 0.);
cfdsolv cfdsv(pd, pg, tp, np, u, v, p);
cfdsv.SetBoundaryCondition(bedge::left, bcond::noslip);
cfdsv.SetBoundaryCondition(bedge::right, bcond::noslip);
cfdsv.SetBoundaryCondition(bedge::bottom, bcond::noslip);
cfdsv.SetBoundaryCondition(bedge::top, bcond::inflow, [](double x, double y) -> auto {
return std::make_pair(1., 0.);
});
cfdsv.Solve();
}