implements a simple one-dimensional finite-diffference solver for the Couette flow.
More...
|
| FiniteDifferenceSolver (const double channelheight, tarch::la::Vector< 3, double > wallVelocity, const double kinVisc, const double dx, const double dt, const int plotEveryTimestep, const std::string filestem, const tarch::la::Vector< 3, unsigned int > processes, const unsigned int numThreads=1) |
| a simple constructor
|
|
| ~FiniteDifferenceSolver () |
| a simple destructor
|
|
void | advance (double dt) override |
| advances one time step dt in time and triggers vtk plot if required
|
|
tarch::la::Vector< 3, double > | getVelocity (tarch::la::Vector< 3, double > pos) const override |
| gets the velocity at a given position
|
|
virtual void | setWallVelocity (const tarch::la::Vector< 3, double > wallVelocity) override |
| changes the velocity at the moving wall (z=0)
|
|
double | getDensity (tarch::la::Vector< 3, double > pos) const override |
| returns density at a certain position
|
|
void | setMDBoundaryValues (coupling::datastructures::FlexibleCellContainer< 3 > &md2macroBuffer) override |
| applies the values received from the MD-solver within the conntinuum solver
|
|
| NumericalSolver (const double channelheight, const double dx, const double dt, const double kinVisc, const int plotEveryTimestep, const std::string filestem, const tarch::la::Vector< 3, unsigned int > processes, const Scenario *scen=nullptr) |
| a simple constructor
|
|
virtual | ~NumericalSolver () |
| a simple destructor
|
|
void | setMDBoundary (tarch::la::Vector< 3, double > mdDomainOffset, tarch::la::Vector< 3, double > mdDomainSize, unsigned int overlapStrip) |
| flags the domain boundary cells.
|
|
tarch::la::Vector< 3, unsigned int > | getNumberProcesses () const |
| returns the number of process, regards parallel runs
|
|
tarch::la::Vector< 3, unsigned int > | getAvgNumberLBCells () const |
| returns the average number of cells on each process
|
|
virtual | ~AbstractCouetteSolver () |
| a dummy destructor
|
|
virtual tarch::la::Vector< dim, double > | getVelocity (tarch::la::Vector< dim, double > pos) const=0 |
| returns the current velocity at the given position
|
|
virtual void | setWallVelocity (const tarch::la::Vector< dim, double > wallVelocity)=0 |
| changes the velocity at the moving for, refers to Couette scenario
|
|
|
static int | getAvgDomainSize (double channelheight, double dx, tarch::la::Vector< 3, unsigned int > processes, int d) |
|
enum | Flag {
FLUID = 0
, NO_SLIP = 1
, MOVING_WALL = 2
, PERIODIC = 3
,
MD_BOUNDARY = 4
, PARALLEL_BOUNDARY = 5
} |
| for every cell exists a flag entry, upon this is defined how the cell is handled More...
|
|
enum | NbFlag {
LEFT = 0
, RIGHT = 1
, BACK = 2
, FRONT = 3
,
BOTTOM = 4
, TOP = 5
} |
| The flags are used on parallel boundaries to define in which direction the boundary goes. More...
|
|
int | get (int i) const |
| returns i and performs checks in debug mode
|
|
int | get (int x, int y, int z) const |
| returns linearized index and performs checks in debug mode
|
|
int | getParBuf (int x, int y, int lengthx, int lengthy) const |
| returns index in 2D parallel buffer with buffer dimensions lengthx+2,lengthy+2. Performs checks in debug mode
|
|
void | plot () const |
|
void | plot (std::string filename) const |
| create vtk plot if required
|
|
bool | skipRank () const |
| returns true, if this rank is not of relevance for the LB simulation
|
|
const double | _channelheight |
| the height and width of the channel in z and y direction
|
|
const double | _dx |
| mesh size, dx=dy=dz
|
|
const double | _dt |
| time step
|
|
const double | _kinVisc |
| kinematic viscosity of the fluid
|
|
tarch::la::Vector< 3, unsigned int > | _processes |
| domain decomposition on MPI rank basis; total number is given by multipling all entries
|
|
const int | _plotEveryTimestep |
| number of time steps between vtk plots
|
|
const std::string | _filestem |
| file stem for vtk plot
|
|
const int | _domainSizeX {getDomainSize(_channelheight, _dx, _processes, 0)} |
| domain size in x-direction
|
|
const int | _domainSizeY {getDomainSize(_channelheight, _dx, _processes, 1)} |
| domain size in y-direction
|
|
const int | _domainSizeZ {getDomainSize(_channelheight, _dx, _processes, 2)} |
| domain size in z-direction
|
|
const int | _avgDomainSizeX {getAvgDomainSize(_channelheight, _dx, _processes, 0)} |
| avg. domain size in MPI-parallel simulation in x-direction
|
|
const int | _avgDomainSizeY {getAvgDomainSize(_channelheight, _dx, _processes, 1)} |
| avg. domain size in MPI-parallel simulation in y-direction
|
|
const int | _avgDomainSizeZ {getAvgDomainSize(_channelheight, _dx, _processes, 2)} |
| avg. domain size in MPI-parallel simulation in z-direction
|
|
const tarch::la::Vector< 3, unsigned int > | _coords {getProcessCoordinates()} |
| coordinates of this process (=1,1,1, unless parallel run of the solver )
|
|
int | _counter {0} |
| time step counter
|
|
double * | _vel {NULL} |
| velocity field
|
|
double * | _density {NULL} |
| density field
|
|
Flag * | _flag {NULL} |
| flag field
|
|
double * | _sendBufferX {NULL} |
| buffer to send data from left/right to right/left neighbour
|
|
double * | _recvBufferX {NULL} |
| buffer to receive data from from left/right neighbour
|
|
double * | _sendBufferY {NULL} |
| buffer to send data from front/back to front/back neighbour
|
|
double * | _recvBufferY {NULL} |
| buffer to receive data from from front/back neighbour
|
|
double * | _sendBufferZ {NULL} |
| buffer to send data from top/buttom to top/buttom neighbour
|
|
double * | _recvBufferZ {NULL} |
| buffer to receive data from from top/buttom neighbour
|
|
const int | _xO {_domainSizeX + 2} |
| offset for y-direction (lexicographic grid ordering)
|
|
const int | _yO {(_domainSizeX + 2) * (_domainSizeY + 2)} |
| offset for z-direction
|
|
tarch::la::Vector< 6, int > | _parallelNeighbours {(-1)} |
| neighbour ranks
|
|
tarch::la::Vector< 3, int > | _offset {(-1)} |
| offset of the md domain
|
|
tarch::la::Vector< 3, int > | _globalNumberCouplingCells {(-1)} |
| the total number of coupling cells of the coupled simulation
|
|
const Scenario * | _scen |
|
implements a simple one-dimensional finite-diffference solver for the Couette flow.
In our scenario, the lower wall is accelerated and the upper wall stands still. The lower wall is located at zero height. The grid is just a simple cubic, equidistant mesh.
- Author
- Helene Wittenberg