Skip to content
Snippets Groups Projects
Commit 77ec8cb8 authored by Andrew Heather's avatar Andrew Heather
Browse files

Merge branch 'master' into develop

parents 549b6cbe 66ed283a
Branches
Tags
1 merge request!121Merge develop into master for v1706 release
# About OpenFOAM
OpenFOAM is a free, open source CFD software [released and developed primarily by OpenCFD Ltd](http://www.openfoam.com) since 2004released and developed primarily by. It has a large user base across most areas of engineering and science, from both commercial and academic organisations. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to acoustics, solid mechanics and electromagnetics. [More...](http://www.openfoam.com/documentation)
OpenFOAM is a free, open source CFD software [released and developed primarily by OpenCFD Ltd](http://www.openfoam.com) since 2004. It has a large user base across most areas of engineering and science, from both commercial and academic organisations. OpenFOAM has an extensive range of features to solve anything from complex fluid flows involving chemical reactions, turbulence and heat transfer, to acoustics, solid mechanics and electromagnetics. [More...](http://www.openfoam.com/documentation)
OpenFOAM+ is professionally released every six months to include customer sponsored developments and contributions from the community, including the OpenFOAM Foundation. Releases designated OpenFOAM+ contain several man years of client-sponsored developments of which much has been transferred to, but not released in the OpenFOAM Foundation branch.
......@@ -23,4 +23,4 @@ Violations of the Trademark are continuously monitored, and will be duly prosecu
- [OpenFOAM Community](http://www.openfoam.com/community/)
- [Contacting OpenCFD](http://www.openfoam.com/contact/)
Copyright 2016 OpenCFD Ltd
Copyright 2016-2017 OpenCFD Ltd
......@@ -111,6 +111,9 @@ void Foam::waveModel::initialiseGeometry()
}
}
// Set minimum z reference level
zMin0_ = gMin(zMin_);
// Local paddle-to-face addressing
faceToPaddle_.setSize(patch_.size(), -1);
forAll(faceToPaddle_, facei)
......@@ -162,18 +165,21 @@ void Foam::waveModel::setAlpha(const scalarField& level)
const label paddlei = faceToPaddle_[facei];
const scalar paddleCalc = level[paddlei];
if (zMax_[facei] < paddleCalc)
const scalar zMin0 = zMin_[facei] - zMin0_;
const scalar zMax0 = zMax_[facei] - zMin0_;
if (zMax0 < paddleCalc)
{
alpha_[facei] = 1.0;
}
else if (zMin_[facei] > paddleCalc)
else if (zMin0 > paddleCalc)
{
alpha_[facei] = 0.0;
}
else
{
scalar dz = paddleCalc - zMin_[facei];
alpha_[facei] = dz/zSpan_;
scalar dz = paddleCalc - zMin0;
alpha_[facei] = dz/(zMax0 - zMin0);
}
}
}
......@@ -190,15 +196,15 @@ void Foam::waveModel::setPaddlePropeties
const label paddlei = faceToPaddle_[facei];
const scalar paddleCalc = level[paddlei];
const scalar paddleHeight = min(paddleCalc, waterDepthRef_);
const scalar zMin = zMin_[facei];
const scalar zMax = zMax_[facei];
const scalar zMin = zMin_[facei] - zMin0_;
const scalar zMax = zMax_[facei] - zMin0_;
fraction = 1;
z = 0;
if (zMax < paddleHeight)
{
z = z_[facei];
z = z_[facei] - zMin0_;
}
else if (zMin > paddleCalc)
{
......@@ -211,8 +217,8 @@ void Foam::waveModel::setPaddlePropeties
if ((zMax > paddleCalc) && (zMin < paddleCalc))
{
scalar dz = paddleCalc - zMin;
fraction = dz/zSpan_;
z = z_[facei];
fraction = dz/(zMax - zMin);
z = z_[facei] - zMin0_;
}
}
else
......@@ -224,7 +230,7 @@ void Foam::waveModel::setPaddlePropeties
else if ((zMax > paddleCalc) && (zMin < paddleCalc))
{
scalar dz = paddleCalc - zMin;
fraction = dz/zSpan_;
fraction = dz/(zMax - zMin);
z = waterDepthRef_;
}
}
......@@ -382,7 +388,7 @@ void Foam::waveModel::correct(const scalar t)
{
const label paddlei = faceToPaddle_[facei];
if (zMin_[facei] < activeLevel[paddlei])
if (zMin_[facei] - zMin0_ < activeLevel[paddlei])
{
scalar UCorr =
(calculatedLevel[paddlei] - activeLevel[paddlei])
......
......@@ -106,6 +106,9 @@ protected:
//- Maximum z (point) height per patch face / [m]
scalarField zMax_;
//- Minimum z reference level / [m]
scalar zMin0_;
//- Reference water depth / [m]
scalar waterDepthRef_;
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment