コード例 #1
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void VelocityBufferReadStencil::applyBackWall   (FlowField & flowField, int i, int j, int k){
    const int index = 3 * (i + (flowField.getNx()+3) * j);
    flowField.getVelocity().getVector(i, j, flowField.getNz()+2)[0] = _backBufferIn[ index ];
    flowField.getVelocity().getVector(i, j, flowField.getNz()+2)[1] = _backBufferIn[index+1];
    flowField.getVelocity().getVector(i, j, flowField.getNz()+2)[2] = _backBufferIn[index+2];
}
コード例 #2
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void VelocityBufferFillStencil::applyFrontWall  (FlowField & flowField, int i, int j, int k){
    const int index = 3 * (i + (flowField.getNx()+3) * j);
    _frontBufferOut[ index ] = flowField.getVelocity().getVector(i, j, 2)[0];
    _frontBufferOut[index+1] = flowField.getVelocity().getVector(i, j, 2)[1];
    _frontBufferOut[index+2] = flowField.getVelocity().getVector(i, j, 2)[2];
}
コード例 #3
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void VelocityBufferReadStencil::applyLeftWall (FlowField & flowField, int i, int j){
    flowField.getVelocity().getVector(0, j)[0] = _leftBufferIn[ 2*j ];
    flowField.getVelocity().getVector(1, j)[1] = _leftBufferIn[2*j+1];
}
コード例 #4
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void PressureBufferReadStencil::applyBackWall   (FlowField & flowField, int i, int j, int k){
    const int index = i + (flowField.getNx()+3) * j;
    flowField.getPressure().getScalar(i, j, flowField.getNz()+2) = _backBufferIn[index];
}
コード例 #5
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void VelocityBufferFillStencil::applyRightWall  (FlowField & flowField, int i, int j, int k){
    const int index = 3 * (j + (flowField.getNy()+3) * k);
    _rightBufferOut[ index ] = flowField.getVelocity().getVector(flowField.getNx(),   j, k)[0];
    _rightBufferOut[index+1] = flowField.getVelocity().getVector(flowField.getNx()+1, j, k)[1];
    _rightBufferOut[index+2] = flowField.getVelocity().getVector(flowField.getNx()+1, j, k)[2];
}
コード例 #6
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void PressureBufferReadStencil::applyBottomWall (FlowField & flowField, int i, int j, int k){
    const int index = i + (flowField.getNx()+3) * k;
    flowField.getPressure().getScalar(i, 1, k) = _bottomBufferIn[index];
}
コード例 #7
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void PressureBufferReadStencil::applyTopWall    (FlowField & flowField, int i, int j, int k){
    const int index = i + (flowField.getNx()+3) * k;
    flowField.getPressure().getScalar(i, flowField.getNy()+2, k) = _topBufferIn[index];
}
コード例 #8
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void PressureBufferFillStencil::applyRightWall  (FlowField & flowField, int i, int j, int k){
    const int index = j + (flowField.getNy()+3) * k;
    _rightBufferOut[index] = flowField.getPressure().getScalar(flowField.getNx()+1, j, k);
}
コード例 #9
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void PressureBufferFillStencil::applyBottomWall (FlowField & flowField, int i, int j, int k){
    const int index = i + (flowField.getNx()+3) * k;
    _bottomBufferOut[index] = flowField.getPressure().getScalar(i, 2, k);
}
コード例 #10
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void PressureBufferFillStencil::applyBottomWall (FlowField & flowField, int i, int j){
    _bottomBufferOut[i] = flowField.getPressure().getScalar(i, 2);
}
コード例 #11
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void PressureBufferFillStencil::applyTopWall    (FlowField & flowField, int i, int j){
    _topBufferOut[i] = flowField.getPressure().getScalar(i, flowField.getNy()+1);
}
コード例 #12
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void PressureBufferFillStencil::applyRightWall  (FlowField & flowField, int i, int j){
    _rightBufferOut[j] = flowField.getPressure().getScalar(flowField.getNx()+1, j);
}
コード例 #13
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void VelocityBufferFillStencil::applyLeftWall (FlowField & flowField, int i, int j){
    _leftBufferOut[ 2*j ] = flowField.getVelocity().getVector(2, j)[0];
    _leftBufferOut[2*j+1] = flowField.getVelocity().getVector(2, j)[1];
}
コード例 #14
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void PressureBufferFillStencil::applyLeftWall   (FlowField & flowField, int i, int j){
    _leftBufferOut[j] = flowField.getPressure().getScalar(2, j);
}
コード例 #15
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void PressureBufferReadStencil::applyTopWall    (FlowField & flowField, int i, int j){
    flowField.getPressure().getScalar(i, flowField.getNy()+2) = _topBufferIn[i];
}
コード例 #16
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void PressureBufferFillStencil::applyTopWall    (FlowField & flowField, int i, int j, int k){
    const int index = i + (flowField.getNx()+3) * k;
    _topBufferOut[index] = flowField.getPressure().getScalar(i, flowField.getNy()+1, k);
}
コード例 #17
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void PressureBufferReadStencil::applyRightWall  (FlowField & flowField, int i, int j, int k){
    const int index = j + (flowField.getNy()+3) * k;
    flowField.getPressure().getScalar(flowField.getNx()+2, j, k) = _rightBufferIn[index];
}
コード例 #18
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void PressureBufferFillStencil::applyFrontWall  (FlowField & flowField, int i, int j, int k){
    const int index = i + (flowField.getNx()+3) * j;
    _frontBufferOut[index] = flowField.getPressure().getScalar(i, j, 2);
}
コード例 #19
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void VelocityBufferFillStencil::applyBottomWall (FlowField & flowField, int i, int j){
    _bottomBufferOut[ 2*i ] = flowField.getVelocity().getVector(i, 2)[0];
    _bottomBufferOut[2*i+1] = flowField.getVelocity().getVector(i, 2)[1];
}
コード例 #20
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void PressureBufferFillStencil::applyBackWall   (FlowField & flowField, int i, int j, int k){
    const int index = i + (flowField.getNx()+3) * j;
    _backBufferOut[index] = flowField.getPressure().getScalar(i, j, flowField.getNz()+1);
}
コード例 #21
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void PressureBufferReadStencil::applyFrontWall  (FlowField & flowField, int i, int j, int k){
    const int index = i + (flowField.getNx()+3) * j;
    flowField.getPressure().getScalar(i, j, 1) = _frontBufferIn[index];
}
コード例 #22
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void VelocityBufferFillStencil::applyRightWall (FlowField & flowField, int i, int j){
    _rightBufferOut[ 2*j ] = flowField.getVelocity().getVector(flowField.getNx()  , j)[0];
    _rightBufferOut[2*j+1] = flowField.getVelocity().getVector(flowField.getNx()+1, j)[1];
}
コード例 #23
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void VelocityBufferFillStencil::applyTopWall (FlowField & flowField, int i, int j){
    _topBufferOut[ 2*i ] = flowField.getVelocity().getVector(i, flowField.getNy()+1)[0];
    _topBufferOut[2*i+1] = flowField.getVelocity().getVector(i, flowField.getNy()  )[1];
}
コード例 #24
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void PressureBufferReadStencil::applyLeftWall   (FlowField & flowField, int i, int j){
    flowField.getPressure().getScalar(1, j) = _leftBufferIn[j];
}
コード例 #25
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void VelocityBufferFillStencil::applyTopWall    (FlowField & flowField, int i, int j, int k){
    const int index = 3 * (i + (flowField.getNx()+3) * k);
    _topBufferOut[ index ] = flowField.getVelocity().getVector(i, flowField.getNy()+1, k)[0];
    _topBufferOut[index+1] = flowField.getVelocity().getVector(i, flowField.getNy()  , k)[1];
    _topBufferOut[index+2] = flowField.getVelocity().getVector(i, flowField.getNy()+1, k)[2];
}
コード例 #26
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void PressureBufferReadStencil::applyRightWall  (FlowField & flowField, int i, int j){
    flowField.getPressure().getScalar(flowField.getNx()+2, j) = _rightBufferIn[j];
}
コード例 #27
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void VelocityBufferFillStencil::applyBackWall   (FlowField & flowField, int i, int j, int k){
    const int index = 3 * (i + (flowField.getNx()+3) * j);
    _backBufferOut[ index ] = flowField.getVelocity().getVector(i, j, flowField.getNz()+1)[0];
    _backBufferOut[index+1] = flowField.getVelocity().getVector(i, j, flowField.getNz()+1)[1];
    _backBufferOut[index+2] = flowField.getVelocity().getVector(i, j, flowField.getNz()  )[2];
}
コード例 #28
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void PressureBufferReadStencil::applyBottomWall (FlowField & flowField, int i, int j){
    flowField.getPressure().getScalar(i, 1) = _bottomBufferIn[i];
}
コード例 #29
0
ファイル: VelocityStencil.cpp プロジェクト: muyan93/Euler-EOF
void VelocityStencil::apply ( FlowField & flowField, int i, int j, int k ){

    const FLOAT dt = _parameters.timestep.dt;
    const int obstacle = flowField.getFlags().getValue(i, j, k);
    VectorField & velocity = flowField.getVelocity();

    if ((obstacle & OBSTACLE_SELF) == 0) {
        if ((obstacle & OBSTACLE_RIGHT) == 0) {
            const FLOAT dx = 0.5*(_parameters.meshsize->getDx(i,j,k)+_parameters.meshsize->getDx(i+1,j,k));
            velocity.getVector(i,j,k)[0] = flowField.getFGH().getVector(i,j,k)[0] - dt/dx *
                (flowField.getPressure().getScalar(i+1,j,k) - flowField.getPressure().getScalar(i,j,k));
        } else {
            velocity.getVector(i, j, k)[0] = 0.0;
        }
        if ((obstacle & OBSTACLE_TOP) == 0) {
            const FLOAT dy = 0.5*(_parameters.meshsize->getDy(i,j,k)+_parameters.meshsize->getDy(i,j+1,k));
            velocity.getVector(i,j,k)[1] = flowField.getFGH().getVector(i,j,k)[1] - dt/dy *
                (flowField.getPressure().getScalar(i,j+1,k) - flowField.getPressure().getScalar(i,j,k));
        } else {
            velocity.getVector(i, j, k)[1] = 0.0;
        }
        if ((obstacle & OBSTACLE_BACK) == 0) {
            const FLOAT dz = 0.5*(_parameters.meshsize->getDz(i,j,k)+_parameters.meshsize->getDz(i,j,k+1));
            velocity.getVector(i,j,k)[2] = flowField.getFGH().getVector(i,j,k)[2] - dt/dz *
                (flowField.getPressure().getScalar(i,j,k+1) - flowField.getPressure().getScalar(i,j,k));
        } else {
            velocity.getVector(i, j, k)[2] = 0.0;
        }
    }
}
コード例 #30
0
ファイル: BufferStencils.cpp プロジェクト: EvaBr/CFD-Lab
void VelocityBufferReadStencil::applyFrontWall  (FlowField & flowField, int i, int j, int k){
    const int index = 3 * (i + (flowField.getNx()+3) * j);
    flowField.getVelocity().getVector(i, j, 1)[0] = _frontBufferIn[ index ];
    flowField.getVelocity().getVector(i, j, 1)[1] = _frontBufferIn[index+1];
    flowField.getVelocity().getVector(i, j, 0)[2] = _frontBufferIn[index+2];
}