Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding super controller #22

Open
wants to merge 77 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
77 commits
Select commit Hold shift + click to select a range
acc8013
Added two example cases, ssc and ssc.base, which will be used to test…
paulf81 May 1, 2018
8c541a3
Implement option to enable/disable SSC. No real SSC implemented yet.
May 2, 2018
c51204e
_SSC_ is the search term for new code
May 2, 2018
487c50c
Added sscProperties to turbineArrayProperties in ssc example case
May 2, 2018
d927475
Fix backwards compatibility for when sscProperties is not defined ins…
May 2, 2018
56928ce
Only print SSC enabled/disabled message for processor0 to avoid clutt…
May 2, 2018
516438d
Adding the new variables and functions for SSC into the ADM.H file
May 2, 2018
100ec85
Including the number of inputs/outputs into the turbineArrayProperties
May 2, 2018
7f48e7a
Initializing the dynamic arrays used in message passing
May 2, 2018
ecc2227
Assume PIDSC (turbine pitch controller for ssc) uses same vars as PID
May 2, 2018
9cbce60
Added yaw super controller
paulf81 May 3, 2018
6f0895c
Fixed name of superInfo array in yawSC
paulf81 May 3, 2018
d375fec
Added PIDSC.H file, turbine pitch controller for SSC
paulf81 May 3, 2018
1557aac
added sscControllerType and callSUperController to ADM.H
paulf81 May 3, 2018
9e5919c
Added SCSimple.C/.H (simple super controller example files)
paulf81 May 3, 2018
219cfcb
Added sscControllerType to sscProperties in turbineArrayProperties
paulf81 May 3, 2018
f6fbf0a
Implement super controller infrastructure and example call in ADM.C
paulf81 May 3, 2018
a5698a8
Fix sscControllerType read function from the turbineArrayProperties file
May 3, 2018
c4d36b5
Add example SC_INPUT.txt file to the .ssc case, and update the NREL 5…
May 3, 2018
b997352
Clarify some comments in the horizontalAxisWindTurbinesADM.C file
May 3, 2018
19647b0
Implement improved timeTableSSC look-up. More modular, more checks fo…
May 4, 2018
6448d61
set makeNewWorkingDir and preprocess specific to peregrine 2018
paulf81 May 4, 2018
2536906
Merge pull request #1 from paulf81/devBart
paulf81 May 4, 2018
ee2dc9e
Merge branch 'master' of github.com:paulf81/SOWFA
paulf81 May 4, 2018
974f22c
Write turbine measurements to the superInfoToSSC variable in the YawS…
May 4, 2018
b3a747a
Add zeromq to the required libraries and includes in preparation of t…
May 4, 2018
506bef2
Upload initial implementation of the zeroMQ superController. Currentl…
May 4, 2018
569bb74
Increase buffer dimensions. Now allows messages of up to 9900 charact…
May 4, 2018
f03e653
Update nOutputsFromSC to nOutputsFromSSC for consistency. Also, add s…
May 4, 2018
e8f6584
Upload example SC files for Python, C and MATLAB. MATLAB still requir…
May 4, 2018
dd84eb9
Fix the matlabSSC code. Proper formatting from received message to an…
May 5, 2018
e458933
Remove the workspace.mat that was accidentally added during debugging
May 5, 2018
b93fae7
Update readme.txt
May 5, 2018
7e60b03
Merge pull request #2 from paulf81/devBart
paulf81 May 7, 2018
fa54638
Update cSSC.c
May 7, 2018
0f9f343
Update the ADM flags for compilation to be compatible with a generic …
May 7, 2018
353bbb5
In ssc example, corrected turbineArrayProp to call timeTableSSC
paulf81 May 7, 2018
66fe0f9
Splitting ssc example into timetable and zeromq
paulf81 May 7, 2018
b216d38
Removing zeromq pythong folder from time table example
paulf81 May 7, 2018
8e2a701
Merge branch 'master' of github.com:paulf81/SOWFA
paulf81 May 7, 2018
9117eec
Merge branch 'master' of github.com:paulf81/SOWFA into devBart
May 7, 2018
578509e
Update zeromqSSC.H
Jul 11, 2018
e71ecd3
Merge changes from NREL master repository
Jul 11, 2018
cf13d92
Make ZeroMQ compilation optional with backwards compatibility. Defaul…
Jul 11, 2018
1b1ef75
Add error message when attempting to run ZeroMQ SSC when it has not b…
Jul 12, 2018
272dab3
Merge pull request #4 from paulf81/devBart
paulf81 Jul 17, 2018
8184ac1
Bug fix for writing and collecting the measurements for the zeroMQ in…
Sep 4, 2018
766f7ef
Merge pull request #5 from paulf81/devBart
Sep 4, 2018
f416655
Update zeromqSSC implementation to a more general implementation. Mov…
Sep 18, 2018
50224f4
Merge pull request #6 from paulf81/devBart
Sep 18, 2018
98246e3
Update options compilation file to remove warning message for backsla…
Sep 18, 2018
c28ecb0
Merge pull request #7 from paulf81/devBart
Sep 18, 2018
607794f
Add separate option to define the zeroMQ address for connection. This…
Oct 25, 2018
e345aee
Update horizontalAxisWindTurbinesADM.C
Oct 29, 2018
2a82cf4
Add files via upload
Oct 29, 2018
d6f4293
Add .gitignore file that will ignore any compiled files and any prepr…
Nov 7, 2018
74fe070
Update .bash_profile to include a SSC option, depending on whether or…
Nov 7, 2018
9683043
Remove old example cases and create two new example cases
Nov 7, 2018
e7a8b9b
Remove old example cases for the SSC
Nov 7, 2018
ec31a13
Remove outdated zeroMQ example case
Nov 7, 2018
5ad61c9
Bug fix and simplify TimeTableSSC
Nov 7, 2018
6d8d881
Set-up a working zeroMQ example case
Nov 7, 2018
d61fc08
Remove SCSimple case. This has been replaced by the TimeTableSSC code.
Nov 7, 2018
5fd13ec
Add a separate function that defines which measurements are used. Thi…
Nov 7, 2018
ff84f14
Update gitignore file
Nov 7, 2018
2b28753
move superController functions separate from the ADM code, since they…
Nov 7, 2018
9d817c4
Update ADM code and make SSC code ADM-specific
Nov 7, 2018
54e0a9b
Add SSC for the ALMAdvanced code. Still needs two example cases for t…
Nov 7, 2018
b0423e5
Add example case for ALMAdvanced with timeTable SSC
Nov 7, 2018
3d8f7c0
Add example case for ALMAdvanced with zeroMQ SSC
Nov 7, 2018
54e3ea5
Upload a simple MATLAB SSC file
Nov 7, 2018
c6d3574
Upload simple MATLAB zeroMQ example
Nov 7, 2018
452ce6a
Merge pull request #8 from NREL/master
Nov 14, 2018
220a6f1
Bug fix for addition of measurementFunction
Nov 14, 2018
41be0c8
Merge pull request #9 from NREL/master
Dec 21, 2018
3e3c264
Update horizontalAxisWindTurbinesALMAdvanced.C
Dec 21, 2018
618c867
Update horizontalAxisWindTurbinesALMAdvanced.C
Jun 3, 2019
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
64 changes: 62 additions & 2 deletions .bash_profile
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,8 @@ fi



# SOWFA-2.4.x
SOWFA-2.4.x()
# OpenFOAM-2.4.x
OpenFOAM-2.4.x()
{
# Unset OpenFOAM environment variables.
if [ -z "$FOAM_INST_DIR" ]; then
Expand All @@ -36,6 +36,66 @@ SOWFA-2.4.x()
export OPENFOAM_NAME=OpenFOAM-$OPENFOAM_VERSION
export FOAM_INST_DIR=/projects/windsim/OpenFOAM

# Set the ZeroMQ compilation option to false
echo "Disabling the compilation and usage of ZeroMQ."
export COMPILEZEROMQ=0

foamDotFile=$FOAM_INST_DIR/$OPENFOAM_NAME/etc/bashrc
if [ -f $foamDotFile ] ; then
echo "Sourcing $foamDotFile..."
source $foamDotFile
fi
export WM_PROJECT_USER_DIR=$FOAM_INST_DIR/SOWFA-$OPENFOAM_VERSION
export WM_NCOMPPROCS=12
export WM_COLOURS="white blue green cyan red magenta yellow"
export OPENFAST_DIR=$FOAM_INST_DIR/openfast-openmpi-gcc-1.7.3-4.8.2/install
export HDF5_DIR=$FOAM_INST_DIR/openfast-openmpi-gcc-1.7.3-4.8.2/install
export FOAM_USER_LIBBIN=$WM_PROJECT_USER_DIR/lib/$WM_OPTIONS
export FOAM_USER_APPBIN=$WM_PROJECT_USER_DIR/applications/bin/$WM_OPTIONS
export FOAM_RUN=$WM_PROJECT_USER_DIR/run
export LD_LIBRARY_PATH=$FOAM_USER_LIBBIN:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$OPENFAST_DIR/lib/:$LD_LIBRARY_PATH
export PATH=$FOAM_USER_APPBIN:$PATH
}

# OpenFOAM-2.4.x
OpenFOAM-2.4.x_SSC()
{
# Unset OpenFOAM environment variables.
if [ -z "$FOAM_INST_DIR" ]; then
echo "Nothing to unset..."
else
echo "Unsetting OpenFOAM environment variables..."
. $FOAM_INST_DIR/OpenFOAM-$OPENFOAM_VERSION/etc/config/unset.sh
fi

# Unload any compilers already loaded
echo "Purging modules..."
module purge

# Load the appropriate modules
echo "Loading modules..."
module load openmpi-gcc/1.7.3-4.8.2
module load mkl/13.5.192
module load cmake/3.7.2
module list

# Set the OpenFOAM version and installation directory
export OPENFOAM_VERSION=2.4.x
export OPENFOAM_NAME=OpenFOAM-$OPENFOAM_VERSION
export FOAM_INST_DIR=/projects/windsim/OpenFOAM

# Set the ZeroMQ compilation option to true
echo "Enabling the compilation and usage of ZeroMQ."
export COMPILEZEROMQ=1
export ZEROMQ_HOME=$HOME/OpenFOAM/zeroMQ/libzmq/install
export ZEROMQ_INCLUDE=$ZEROMQ_HOME/include
export ZEROMQ_LIB=$ZEROMQ_HOME/lib64
export LD_LIBRARY_PATH=$ZEROMQ_HOME/lib:$LD_LIBRARY_PATH
export LD_LIBRARY_PATH=$ZEROMQ_HOME/lib64:$LD_LIBRARY_PATH
echo "Specified ZeroMQ directory: $ZEROMQ_HOME"


foamDotFile=$FOAM_INST_DIR/$OPENFOAM_NAME/etc/bashrc
if [ -f $foamDotFile ] ; then
echo "Sourcing $foamDotFile..."
Expand Down
46 changes: 46 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
*.asv
**/*.dep

archivedCases
platforms
src/fileFormats/lnInclude
src/finiteVolume/lnInclude
src/postProcessing/functionObjects/utilities/lnInclude/
src/sampling/lnInclude/
src/turbineModels/turbineModelsStandard/lnInclude/
src/turbulenceModels/incompressible/LES/lnInclude/

**/Make/linux64*

*Cases/**/processor*
*Cases/**/postProces*
*Cases/**/turbineOutp*
*Cases/**/*.e0*
*Cases/**/*.e1*
*Cases/**/*.e2*
*Cases/**/*.e3*
*Cases/**/*.e4*
*Cases/**/*.e5*
*Cases/**/*.e6*
*Cases/**/*.e7*
*Cases/**/*.e8*
*Cases/**/*.e9*
*Cases/**/*.o0*
*Cases/**/*.o1*
*Cases/**/*.o2*
*Cases/**/*.o3*
*Cases/**/*.o4*
*Cases/**/*.o5*
*Cases/**/*.o6*
*Cases/**/*.o7*
*Cases/**/*.o8*
*Cases/**/*.o9*
*Cases/**/log.*
*Cases/**/*.log
*Cases/**/*.gz
*Cases/**/system/controlDict
*Cases/**/constant/polyMesh/boundary
*Cases/**/constant/boundaryData
*Cases/**/constant/sources
*Cases/**/0
*Cases/**/*00
9 changes: 8 additions & 1 deletion Allwmake
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,12 @@ cd ../../../../


# Actuator turbine models.
if [ -z ${COMPILEZEROMQ+x} ] # ZeroMQ SSC for the ADM code
then
echo "COMPILEZEROMQ is not set. Not compiling ZeroMQ SSC in ADM."
else
echo "COMPILEZEROMQ is set to '${COMPILEZEROMQ}'. Compiling with ZeroMQ SSC if COMPILEZEROMQ==1 or without otherwise."
fi
cd src/turbineModels/turbineModelsStandard
wmake libso
cd ../../../
Expand Down Expand Up @@ -112,7 +118,7 @@ else
fi
fi

# The wind plant solver with the actuator disk.

cd applications/solvers/incompressible/windEnergy/windPlantSolver.ADM
wmake
cd ../../../../../
Expand Down Expand Up @@ -147,6 +153,7 @@ else
fi



# The basic non-buoyant solver with the actuator disk.
cd applications/solvers/incompressible/windEnergy/pisoFoamTurbine.ADM
wmake
Expand Down
58 changes: 58 additions & 0 deletions exampleCases/example.ADM.ssc.timeTable/0.original/U
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volVectorField;
location "0";
object U;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#include "../setUp"


dimensions [0 1 -1 0 0 0 0];

internalField uniform ($U0Mag 0 0);

boundaryField
{
lower
{
type slip;
}
upper
{
type slip;
}
west
{
type fixedValue;
value uniform ($U0Mag 0 0);
}
east
{
type inletOutlet;
inletValue uniform (0 0 0);
value uniform ($U0Mag 0 0);
}
south
{
type slip;
}
north
{
type slip;
}
}



// ************************************************************************* //
60 changes: 60 additions & 0 deletions exampleCases/example.ADM.ssc.timeTable/0.original/k
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object k ;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#include "../setUp"


dimensions [0 2 -2 0 0 0 0];

internalField uniform 0.0;

boundaryField
{
lower
{
type zeroGradient;
value uniform 0.0;
}
upper
{
type zeroGradient;
value uniform 0.0;
}
west
{
type fixedValue;
value uniform 0.0;
}
east
{
type zeroGradient;
value uniform 0.0;
}
north
{
type zeroGradient;
value uniform 0.0;
}
south
{
type zeroGradient;
value uniform 0.0;
}
}


// ************************************************************************* //
60 changes: 60 additions & 0 deletions exampleCases/example.ADM.ssc.timeTable/0.original/nuSgs
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 2.1.x |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0";
object nuSgs;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#include "../setUp"


dimensions [0 2 -1 0 0 0 0];

internalField uniform $nuSgs0;

boundaryField
{
lower
{
type zeroGradient;
value uniform 0.0;
}
upper
{
type zeroGradient;
value uniform 0.0;
}
west
{
type fixedValue;
value uniform 0.0;
}
east
{
type zeroGradient;
value uniform 0.0;
}
north
{
type zeroGradient;
value uniform 0.0;
}
south
{
type zeroGradient;
value uniform 0.0;
}
}


// ************************************************************************* //
60 changes: 60 additions & 0 deletions exampleCases/example.ADM.ssc.timeTable/0.original/p
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: 1.6 |
| \\ / A nd | Web: http://www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "0000";
object p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#include "../setUp"


dimensions [0 2 -2 0 0 0 0];

internalField uniform 0;

boundaryField
{
lower
{
type zeroGradient;
value uniform 0;
}
upper
{
type zeroGradient;
value uniform 0;
}
east
{
type fixedValue;
value uniform 0;
}
west
{
type zeroGradient;
value uniform 0;
}
south
{
type zeroGradient;
value uniform 0;
}
north
{
type zeroGradient;
value uniform 0;
}
}


// ************************************************************************* //
Loading