Merge branch 'HJ/AdjointImmersedBoundary' into masterSF

Conflicts:
	ThirdParty/AllMake.stage1
	ThirdParty/AllMake.stage4
	ThirdParty/rpmBuild/SOURCES/libccmio-2.6.1.patch_0
	ThirdParty/rpmBuild/SPECS/ParaView-3.12.0.spec
	ThirdParty/rpmBuild/SPECS/libccmio-2.6.1.spec
	ThirdParty/rpmBuild/SPECS/mesquite-2.1.2.spec
	ThirdParty/rpmBuild/SPECS/qt-everywhere-opensource-src-4.7.4.spec
	etc/prefs.csh-EXAMPLE
	etc/prefs.sh-EXAMPLE
	etc/settings.csh
	etc/settings.sh
	src/finiteVolume/fields/fvPatchFields/derived/advective/advectiveFvPatchField.C
	src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwind.C
	src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/linearUpwind/linearUpwindV.C
	src/finiteVolume/interpolation/surfaceInterpolation/limitedSchemes/reconCentral/reconCentral.C
	testHarness/OSIG/Turbomachinery/README.txt
	testHarness/OpenFOAM/1.6-ext/CMakeFiles/CMakeLists.txt
This commit is contained in:
Henrik Rusche 2013-07-03 15:11:21 +02:00
commit e394390d8f
1363 changed files with 293569 additions and 17724 deletions

6
ThirdParty/AllMake vendored
View file

@ -71,6 +71,12 @@ echo
# Running stage 4
./AllMake.stage4
# Running stage 5
# This stage depends on a properly compiled installation
# of OpenFOAM. On a brand new installation of OpenFOAM-1.6-ext,
# this stage should be called last in your compilation process
./AllMake.stage5
echo ========================================
echo Done ThirdParty Allwmake
echo ========================================

View file

@ -125,6 +125,17 @@ fi
# echo ""
#fi
# PyFoam
if [ -z "$PYFOAM_SYSTEM" ]
then
# ( rpm_make -p PyFoam-0.5.6 -s PyFoam-0.5.6.spec -u http://openfoamwiki.net/images/b/b8/PyFoam-0.5.6.tar.gz -n PyFoam-0.5.6-1.noarch -a noarch)
( rpm_make -p PyFoam-0.5.7 -s PyFoam-0.5.7.spec -u http://openfoamwiki.net/images/d/dc/PyFoam-0.5.7.tar.gz -n PyFoam-0.5.7-1.noarch -a noarch)
else
echo "Using system installed PyFoam"
echo ""
fi
echo ========================================
echo Done ThirdParty AllMake: Stage3
echo ========================================

113
ThirdParty/AllMake.stage5 vendored Executable file
View file

@ -0,0 +1,113 @@
#!/bin/bash
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# AllMake.stage5
#
# Description
# Build script for ThirdParty packages not requiring rpm packaging
#
#
# Requirements:
# 1: Your OpenFOAM environment must be properly initialized
# 2: OpenFOAM must already been compiled because swak4Foam depends on
# OpenFOAM include files and libraries
#
# Author:
# Martin Beaudoin, Hydro-Quebec, (2012)
#
#------------------------------------------------------------------------------
# run from Third-party directory only
cd ${0%/*} || exit 1
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
#------------------------------------------------------------------------------
echo "========================================"
echo "Starting ThirdParty AllMake: Stage5 "
echo "========================================"
echo
# swak4Foam - Version 0.2.0
# In fact, we are basically tracking the head branch from the Mercurial repository
# which is also replicated under the Breeder_1.7 section of the Subversion repository
#
if [ -z "$SWAK4FOAM_SYSTEM" ]
then
# Do we need to download the source code?
# We choose to put the source code under ./rpmBuild/BUILD prior to compiling.
# We will not generate a rpm package, but all ThirdParty source code will be
# centralized under the same scratch area
if [ ! -e ./rpmBuild/BUILD/swak4Foam-0.2.0 ];
then
echo "Checking for a Mercurial client: hg"
command -v hg >/dev/null
if [ $? -eq 0 ];
then
echo "Using Mercurial/hg to download the source code for swak4Foam"
(cd ./rpmBuild/BUILD; hg clone http://openfoam-extend.hg.sourceforge.net:8000/hgroot/openfoam-extend/swak4Foam swak4Foam-0.2.0)
else
echo "Warning: Mercurial/hg is not installed. Switching to an alternate Subversion repository"
command -v svn >/dev/null
if [ $? -eq 0 ];
then
echo "Using Subversion/svn to download the source code for swak4Foam"
(cd ./rpmBuild/BUILD; svn checkout https://openfoam-extend.svn.sourceforge.net/svnroot/openfoam-extend/trunk/Breeder_1.7/libraries/swak4Foam swak4Foam-0.2.0)
else
echo "Error: Please install either a Mercurial or Subversion client in order to download the source code for swak4Foam"
exit -1
fi
fi
# We move the compilation results directly to $FOAM_SITE_APPBIN and $FOAM_SITE_LIBBIN
# If you prefer to keep the libraries and tools under $FOAM_USER_LIBBIN and $FOAM_USER_APPBIN, simply
# comment out the next two lines
(cd ./rpmBuild/BUILD/swak4Foam-0.2.0; find . -name files | xargs -n 1 sed -i.old "s/FOAM_USER/FOAM_SITE/g")
(cd ./rpmBuild/BUILD/swak4Foam-0.2.0; find . -name options | xargs -n 1 sed -i.old "s/FOAM_USER/FOAM_SITE/g")
# We recompile everything
(cd ./rpmBuild/BUILD/swak4Foam-0.2.0; ./Allwclean; ./Allwmake)
else
echo "The source code for swak4Foam is already present under ./rpmBuild/BUILD/swak4Foam-0.2.0"
echo "Please remove this directory if you want to refresh your installation of swak4Foam"
fi
echo ""
else
echo "Using system installed swak4Foam"
echo ""
fi
echo "========================================"
echo "Done ThirdParty AllMake: Stage5 "
echo "========================================"
echo
# ----------------------------------------------------------------- end-of-file

68
ThirdParty/AllMake.stage6 vendored Executable file
View file

@ -0,0 +1,68 @@
#!/bin/bash
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# AllMake.stage6
#
# Description
# Build script for ThirdParty packages located under LocalDev
#
#
# Requirements:
# 1: Your OpenFOAM environment must be properly initialized
#
# Author:
# Martin Beaudoin, Hydro-Quebec, (2012)
#
#------------------------------------------------------------------------------
# run from Third-party directory only
cd ${0%/*} || exit 1
wmakeCheckPwd "$WM_THIRD_PARTY_DIR" || {
echo "Error: Current directory is not \$WM_THIRD_PARTY_DIR"
echo " The environment variables are inconsistent with the installation."
echo " Check the OpenFOAM entries in your dot-files and source them."
exit 1
}
#------------------------------------------------------------------------------
echo "========================================"
echo "Starting ThirdParty AllMake: Stage6 "
echo "========================================"
echo
# Local developments from Hydro-Quebec (Turbomachinery)
# Temporary solution until we find a more suitable place
# for this. MB
(cd ./LocalDev/Hydro-Quebec/PyFoam; ./AllMake)
echo "========================================"
echo "Done ThirdParty AllMake: Stage6 "
echo "========================================"
echo
# ----------------------------------------------------------------- end-of-file

View file

@ -0,0 +1,73 @@
#!/bin/bash
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software: you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by
# the Free Software Foundation, either version 3 of the License, or
# (at your option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
#
# Script
# AllMake
#
# Description
# Installation script for local development
#
# Author:
# Martin Beaudoin, Hydro-Quebec, (2012)
#
#------------------------------------------------------------------------------
command -v python -V >/dev/null
if [ ! $? -eq 0 ];
then
echo "Error: You need to install python in order to run these PyFoam scripts"
exit -1
fi
if [ -z "$PYFOAM_DIR" ]
then
echo "Error: Missing environment variable \$PYFOAM_DIR."
echo " Please execute the script ThirdParty/AllMake.stage5 to install PyFoam."
echo " Then, make sure to freshen your OpenFOAM environment by sourcing your main"
echo " OpenFOAM configuration file."
exit -1
fi
pythonVersion=$(python -V 2>&1 | awk -F ' ' {'print $2'} | awk -F \. {'print $1 "." $2'})
set -x
# pyFoamChangeMixingPlaneBoundary.py
cp pyFoamChangeMixingPlaneBoundary.py $PYFOAM_DIR/bin
cp ChangeMixingPlaneBoundary.py $PYFOAM_DIR/lib/python$pythonVersion/site-packages/PyFoam/Applications
# pyFoamChangeGGIBoundary.py
# Same as pyFoamModifyGGIBoundary.py. We just harmonize the name with rest of PyFoam
cp pyFoamChangeGGIBoundary.py $PYFOAM_DIR/bin
cp ChangeGGIBoundary.py $PYFOAM_DIR/lib/python$pythonVersion/site-packages/PyFoam/Applications
set +x
echo ========================================
echo Done
echo ========================================
echo
# ----------------------------------------------------------------- end-of-file

View file

@ -0,0 +1,156 @@
"""
Application-class that implements pyFoamChangeGGIBoundary.py
Modification of GGI and cyclicGGI interface parameters in
constant/polymesh/boundary file.
Author:
Martin Beaudoin, Hydro-Quebec, 2009. All rights reserved
"""
from PyFoamApplication import PyFoamApplication
from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile
from os import path
import sys
import re
class ChangeGGIBoundary(PyFoamApplication):
def __init__(self,args=None):
description="""\
Change GGI boundary condition parameters
"""
PyFoamApplication.__init__(self,
args=args,
description=description,
usage="%prog <caseDirectory> ggiPatchName",
interspersed=True,
changeVersion=False,
nr=2)
def addOptions(self):
self.parser.add_option("--shadowPatch",
action="store",
dest="shadowPatch",
default=None,
help='Name of the shadowPatch')
self.parser.add_option("--shadowName",
action="store",
dest="shadowName",
default=None,
help='Name of the shadowPatch. Deprecated. Use --shadowPatch instead')
self.parser.add_option("--zone",
action="store",
dest="zone",
default=None,
help='Name of the zone for the GGI patch')
self.parser.add_option("--patchZoneName",
action="store",
dest="patchZoneName",
default=None,
help='Name of the zone for the GGI patch. Deprecated. Use --zone instead')
self.parser.add_option("--bridgeOverlap",
action="store",
dest="bridgeOverlap",
default=None,
help='bridgeOverlap flag (on/off)')
self.parser.add_option("--bridgeOverlapFlag",
action="store",
dest="bridgeOverlapFlag",
default=None,
help='bridgeOverlap flag (on/off). Deprecated. Use --bridgeOverlap instead')
self.parser.add_option("--rotationAxis",
action="store",
dest="rotationAxis",
default=None,
help='rotation axis for cyclicGgi')
self.parser.add_option("--rotationAngle",
action="store",
dest="rotationAngle",
default=None,
help='rotation axis angle for cyclicGgi')
self.parser.add_option("--separationOffset",
action="store",
dest="separationOffset",
default=None,
help='separation offset for cyclicGgi')
self.parser.add_option("--test",
action="store_true",
default=False,
dest="test",
help="Only print the new boundary file")
def run(self):
fName=self.parser.getArgs()[0]
bName=self.parser.getArgs()[1]
boundary=ParsedParameterFile(path.join(".",fName,"constant","polyMesh","boundary"),debug=False,boundaryDict=True)
bnd=boundary.content
if type(bnd)!=list:
self.error("Problem with boundary file (not a list)")
found=False
for val in bnd:
if val==bName:
found=True
elif found:
bcType=val["type"]
if re.match("cyclicGgi", bcType)!= None or re.match("ggi", bcType)!= None:
if self.parser.getOptions().shadowPatch!=None:
shadowPatch=self.parser.getOptions().shadowPatch
val["shadowPatch"]=shadowPatch
if shadowPatch not in bnd:
self.error("\n Option --shadowPatch for patch:",bName,": there is no patch called",shadowPatch,"\n")
if self.parser.getOptions().zone!=None:
val["zone"]=self.parser.getOptions().zone
if self.parser.getOptions().bridgeOverlap!=None:
val["bridgeOverlap"]=self.parser.getOptions().bridgeOverlap
if val["type"]=="cyclicGgi":
if self.parser.getOptions().rotationAxis!=None:
val["rotationAxis"]=self.parser.getOptions().rotationAxis
if self.parser.getOptions().rotationAngle!=None:
val["rotationAngle"]=self.parser.getOptions().rotationAngle
if self.parser.getOptions().separationOffset!=None:
val["separationOffset"]=self.parser.getOptions().separationOffset
# Deprecated
if self.parser.getOptions().shadowName!=None:
self.warning("\n PatchName:",bName,": Option --shadowName is deprecated. Use --shadowPatch instead\n")
shadowName=self.parser.getOptions().shadowName
val["shadowPatch"]=shadowName
if shadowName not in bnd:
self.error("\n Option --shadowName for patch:",bName,": there is no patch called",shadowName,"\n")
# Deprecated
if self.parser.getOptions().patchZoneName!=None:
self.warning("\n PatchName:",bName,": Option --patchZoneName is deprecated. Use --zone instead\n")
val["zone"]=self.parser.getOptions().patchZoneName
# Deprecated
if self.parser.getOptions().bridgeOverlapFlag!=None:
self.warning("\n PatchName:",bName,": Option --bridgeOverlapFlag is deprecated. Use --bridgeOverlap instead\n")
val["bridgeOverlap"]=self.parser.getOptions().bridgeOverlapFlag
else:
print "Unsupported GGI type '",bcType,"' for patch",bName
break
if not found:
self.error("Boundary",bName,"not found in",bnd[::2])
if self.parser.getOptions().test:
print boundary
else:
boundary.writeFile()

View file

@ -0,0 +1,139 @@
"""
Application-class that implements pyFoamChangeMixingPlaneBoundary.py
Change various mixingPlane interface attributes in
constant/polymesh/boundary file.
Author:
Martin Beaudoin, Hydro-Quebec, 2012. All rights reserved
"""
from PyFoamApplication import PyFoamApplication
from PyFoam.RunDictionary.ParsedParameterFile import ParsedParameterFile
from os import path
import sys
class ChangeMixingPlaneBoundary(PyFoamApplication):
def __init__(self,args=None):
description="""
Change MixingPlane boundary condition parameters
"""
PyFoamApplication.__init__(self,
args=args,
description=description,
usage="%prog <caseDirectory> mixingPlanePatchName",
interspersed=True,
changeVersion=False,
nr=2)
def addOptions(self):
self.parser.add_option("--shadowPatch",
action="store",
dest="shadowPatch",
default=None,
help='Name of the shadowPatch')
self.parser.add_option("--coordinateSystemName",
action="store",
dest="coordinateSystemName",
default="mixingCS",
help='coordinateSystemName (mixingCS)')
self.parser.add_option("--coordinateSystemType",
action="store",
dest="coordinateSystemType",
default=None,
help='coordinateSystemType (cyindrical/spherical)')
self.parser.add_option("--coordinateSystemOrigin",
action="store",
dest="coordinateSystemOrigin",
default=None,
help='origin for coordinate system of mixingPlane')
self.parser.add_option("--coordinateSystemE1",
action="store",
dest="coordinateSystemE1",
default=None,
help='axis E1 for coordinate system of mixingPlane')
self.parser.add_option("--coordinateSystemE3",
action="store",
dest="coordinateSystemE3",
default=None,
help='axis E3 for coordinate system of mixingPlane')
self.parser.add_option("--assembly",
action="store",
dest="assembly",
default=None,
help='Assembly (master|slave|both|userdefined')
self.parser.add_option("--orientation",
action="store",
dest="orientation",
default=None,
help='Orientation of profile (\
dirX_spanY| \
dirX_spanZ|dirY_spanX|dirY_spanZ|dirZ_spanX|dirZ_spanY|dirR_spanTheta|dirR_spanZ|dirTheta_spanZ|dirTheta_spanR|dirZ_spanTheta|dirZ_spanR|unknown)')
self.parser.add_option("--test",
action="store_true",
default=False,
dest="test",
help="Only print the new boundary file")
def run(self):
fName=self.parser.getArgs()[0]
bName=self.parser.getArgs()[1]
boundary=ParsedParameterFile(path.join(".",fName,"constant","polyMesh","boundary"),debug=False,boundaryDict=True)
bnd=boundary.content
if type(bnd)!=list:
print "Problem with boundary file (not a list)"
sys.exit(-1)
found=False
for val in bnd:
if val==bName:
found=True
elif found:
if val["type"]=="mixingPlane":
if self.parser.getOptions().shadowPatch!=None:
val["shadowPatch"]=self.parser.getOptions().shadowPatch
if self.parser.getOptions().orientation!=None:
val["orientation"]=self.parser.getOptions().orientation
if val.has_key("coordinateSystem")==False:
val["coordinateSystem"]={}
if self.parser.getOptions().coordinateSystemName!=None:
val["coordinateSystem"]["name"]=self.parser.getOptions().coordinateSystemName
if self.parser.getOptions().coordinateSystemType!=None:
val["coordinateSystem"]["type"]=self.parser.getOptions().coordinateSystemType
if self.parser.getOptions().coordinateSystemOrigin!=None:
val["coordinateSystem"]["origin"]=self.parser.getOptions().coordinateSystemOrigin
if self.parser.getOptions().coordinateSystemE1!=None:
val["coordinateSystem"]["e1"]=self.parser.getOptions().coordinateSystemE1
if self.parser.getOptions().coordinateSystemE3!=None:
val["coordinateSystem"]["e3"]=self.parser.getOptions().coordinateSystemE3
if self.parser.getOptions().assembly!=None:
val["assembly"]=self.parser.getOptions().assembly
if self.parser.getOptions().orientation!=None:
val["orientation"]=self.parser.getOptions().orientation
break
if not found:
print "Boundary",bName,"not found in",bnd[::2]
sys.exit(-1)
if self.parser.getOptions().test:
print boundary
else:
boundary.writeFile()

View file

@ -0,0 +1,6 @@
PyFoam scripts for handling GGI and mixingPlane cases.
--
Martin Beaudoin
Hydro-Quebec
April 2012

View file

@ -0,0 +1,5 @@
#!/usr/bin/env python
from PyFoam.Applications.ChangeGGIBoundary import ChangeGGIBoundary
ChangeGGIBoundary()

View file

@ -0,0 +1,5 @@
#!/usr/bin/env python
from PyFoam.Applications.ChangeMixingPlaneBoundary import ChangeMixingPlaneBoundary
ChangeMixingPlaneBoundary()

13
ThirdParty/LocalDev/Readme.txt vendored Normal file
View file

@ -0,0 +1,13 @@
This directory contains ThirdParty developments specific to the mixingPlane_RC1 branch.
Those developments might eventually find a more suitable home elsewhere.
Instead of spreading these developments around in various repositories, I find
it more convenient to regroup them under this directory.
So expect this ThirdParty/LocalDev directory to disappear eventually, once its
content will prove it usefulness.
--
Martin Beaudoin
Hydro-Quebec
April 2012

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,16 @@
diff a/CMakeLists.txt b/CMakeLists.txt
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -403,6 +403,12 @@
DESTINATION ${PV_INSTALL_CMAKE_DIR}
COMPONENT Development)
+ # install ParaViewUse.cmake
+ INSTALL(
+ FILES ${ParaView_SOURCE_DIR}/ParaViewUse.cmake
+ DESTINATION ${PV_INSTALL_CMAKE_DIR}
+ COMPONENT Development)
+
# Re-configure for the install.
SET(SOURCE_TREE ${ParaView_SOURCE_DIR})
SET(BUILD_TREE ${ParaView_BINARY_DIR})

View file

@ -0,0 +1,12 @@
diff -ruN ParaView-3.14.1_orig/Applications/ParaView-3.14.1_extra_install_Darwin.cmake ParaView-3.14.1/Applications/ParaView-3.14.1_extra_install_Darwin.cmake
--- ParaView-3.14.1_orig/Applications/ParaView-3.14.1_extra_install_Darwin.cmake 1969-12-31 19:00:00.000000000 -0500
+++ ParaView-3.14.1/Applications/ParaView-3.14.1_extra_install_Darwin.cmake 2010-11-06 19:34:12.000000000 -0400
@@ -0,0 +1,8 @@
+#
+# Additional install rules for Mac OS X platforms
+#
+INSTALL (DIRECTORY ../../buildObj/bin/paraview.app
+ DESTINATION ${PV_INSTALL_BIN_DIR}
+ USE_SOURCE_PERMISSIONS
+ COMPONENT Runtime)
+

View file

@ -0,0 +1,12 @@
*** include/Mesquite.hpp 2009-12-07 22:48:45.000000000 +0000
--- /home/hjasak/OpenFOAM/OpenFOAM-1.6-ext/ThirdParty/rpmBuild/BUILD/mesquite-2.1.2/include/Mesquite.hpp 2011-11-03 21:59:55.734930462 +0000
***************
*** 69,74 ****
--- 69,75 ----
namespace MESQUITE_NS { }
namespace Mesquite = MESQUITE_NS;
+ using std::size_t;
/*! \file Mesquite.hpp
*/

View file

@ -73,7 +73,7 @@ License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
URL: http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis
URL: http://glaros.dtc.umn.edu/gkhome/fetch/sw/parmetis/OLD
Source: %url/%{name}-%{version}.tar.gz
Prefix: %{_prefix}
Group: Development/Tools

View file

@ -0,0 +1,289 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# RPM spec file for ParaView-3.14.1
#
# Description
# RPM spec file for creating a relocatable RPM
#
# Author:
# Martin Beaudoin, Hydro-Quebec, (2010)
#
#------------------------------------------------------------------------------
# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable
%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)}
%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)}
# Disable the generation of debuginfo packages
%define debug_package %{nil}
# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory
%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild
%define _tmppath %{_topdir}/tmp
# Will install the package directly $WM_THIRD_PARTY_DIR
# Some comments about package relocation:
# By using this prefix for the Prefix: parameter in thi file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
# Simply take note that libraries built with libtool are not relocatable because the
# prefix we specify will be hard-coded in the library .la files.
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
%define name ParaView
%define release %{_WM_OPTIONS}
%define version 3.14.1
%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: ParaView
License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
URL: http://www.paraview.org/files/v3.14/
Source: %url/%{name}-%{version}-Source.tar.gz
Prefix: %{_prefix}
Group: Development/Tools
Patch0: ParaView-3.14.1.patch_0_ParaView.git_0f43430
Patch1: ParaView-3.14.1.patch_1
Patch2: ParaView-3.14.1.patch_darwin
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
#--------------------------------------------------------------------------
#
# Here, we define default compiling options for cmake
#
# One can override the option on the commande line : --define='MACRO EXPR'
#
%{!?_withVerbose: %define _withVerbose false}
%{!?_withMesa: %define _withMesa false}
%{!?_withMPI: %define _withMPI false}
%{!?_withPython: %define _withPython false}
%{!?_withQt: %define _withQt true}
%{!?_qmakePath: %define _qmakePath Undefined}
%{!?_mesaIncludePath: %define _mesaIncludePath Undefined}
%{!?_mesaLibPath: %define _mesaLibPath Undefined}
%{!?_pythonLibPath: %define _pythonLibPath Undefined}
#--------------------------------------------------------------------------
%description
%{summary}
%prep
%setup -q -n ParaView-3.14.1-Source
# Patch from ParaView.git
# BUG #13065. CMake files were not being installed correctly.
%patch0 -p1
# Correction to BUG #13065.
%patch1 -p1
%ifos darwin
# Patch for proper install of paraview binary under Mac OS X
%patch2 -p1
%endif
%build
#
# set CMake cache variables
#
addCMakeVariable()
{
while [ -n "$1" ]
do
CMAKE_VARIABLES="$CMAKE_VARIABLES -D$1"
shift
done
}
# export WM settings in a form that GNU configure recognizes
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
set +x
echo ""
echo "Compilation options:"
echo " _withVerbose : %{_withVerbose}"
echo " _withMesa : %{_withMesa}"
echo " _withMPI : %{_withMPI}"
echo " _withPython : %{_withPython}"
echo " _withQt : %{_withQt}"
echo " _qmakePath : %{_qmakePath}"
echo " _mesaIncludePath : %{_mesaIncludePath}"
echo " _mesaLibPath : %{_mesaLibPath}"
echo " _pythonLibPath : %{_pythonLibPath}"
echo ""
set -x
# start with these general settings
addCMakeVariable VTK_USE_TK:BOOL=OFF
addCMakeVariable BUILD_SHARED_LIBS:BOOL=ON VTK_USE_RPATH:BOOL=OFF
addCMakeVariable CMAKE_BUILD_TYPE:STRING=Release
# include development files in "make install"
addCMakeVariable PARAVIEW_INSTALL_DEVELOPMENT:BOOL=ON
# new alternative to "make HTMLDocumentation"
addCMakeVariable PARAVIEW_GENERATE_PROXY_DOCUMENTATION:BOOL=OFF
%ifos darwin
# Additional installation rules for Mac OS X
addCMakeVariable PARAVIEW_EXTRA_INSTALL_RULES_FILE:FILEPATH=%{_topdir}/BUILD/%{name}-%{version}-Source/Applications/ParaView-3.14.1_extra_install_Darwin.cmake
%endif
# Add the value of _qmakePath for QT_QMAKE_EXECUTABLE
addCMakeVariable QT_QMAKE_EXECUTABLE:FILEPATH=%{_qmakePath}
echo "CMAKE_VARIABLES: $CMAKE_VARIABLES"
mkdir -p ./buildObj
cd ./buildObj
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=%{_installPrefix} \
$CMAKE_VARIABLES \
..
[ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1
make -j $WM_NCOMPPROCS
%install
# On OpenSUSE, rpmbuild, will choke when detecting unreferenced symlinks
# created during installation.
# Qt version 4.6.3 will generate some unreferenced symlinks when
# ParaView is compiled and installed. By enabling the following
# environment variable, the command brp-symlink will still complain
# about missing link targets, but it won't stop rpmbuild from generating
# the final rpm.
# For all other Unix distros, this is a no-op.
export NO_BRP_STALE_LINK_ERROR=yes
cd buildObj
make install DESTDIR=$RPM_BUILD_ROOT
# Creation of OpenFOAM specific .csh and .sh files"
echo ""
echo "Generating OpenFOAM specific .csh and .sh files for the package %{name}-%{version}"
echo ""
#
# Generate package specific .sh file for OpenFOAM
#
mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc
cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export PARAVIEW_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
export PARAVIEW_BIN_DIR=\$PARAVIEW_DIR/bin
export PARAVIEW_LIB_DIR=\$PARAVIEW_DIR/lib
export PARAVIEW_INCLUDE_DIR=\$PARAVIEW_DIR/include/paraview-3.14
export PARAVIEW_VERSION=%{version}
# NB: It is important to set the PV_PLUGIN_PATH location to a directory containing only the ParaView plugins.
# Otherwise, paraview will try to automatically autoload each and every dynamic library it can find in the
# specified directory to see if a given library is a paraview plugin.
# In the case of \$FOAM_LIBBIN, with over 80 libraries, this is a total waste of time that will slow down the
# startup of paraview or even make paraview crash on startup.
export PV_PLUGIN_PATH=\$FOAM_LIBBIN/paraview_plugins
[ -d \$PARAVIEW_LIB_DIR/paraview-3.14 ] && _foamAddLib \$PARAVIEW_LIB_DIR/paraview-3.14
# Enable access to the package applications if present
[ -d \$PARAVIEW_BIN_DIR ] && _foamAddPath \$PARAVIEW_BIN_DIR
# Additional binary path if running on Mac OS X
[ -d \$PARAVIEW_BIN_DIR/paraview.app/Contents/MacOS ] && _foamAddPath \$PARAVIEW_BIN_DIR/paraview.app/Contents/MacOS
DOT_SH_EOF
#
# Generate package specific .csh file for OpenFOAM
#
cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv PARAVIEW_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
setenv PARAVIEW_BIN_DIR \$PARAVIEW_DIR/bin
setenv PARAVIEW_LIB_DIR \$PARAVIEW_DIR/lib
setenv PARAVIEW_INCLUDE_DIR \$PARAVIEW_DIR/include/paraview-3.14
setenv PARAVIEW_VERSION %{version}
# NB: It is important to set the PV_PLUGIN_PATH location to a directory containing only the ParaView plugins.
# Otherwise, paraview will try to automatically autoload each and every dynamic library it can find in the
# specified directory to see if a given library is a paraview plugin.
# In the case of \$FOAM_LIBBIN, with over 80 libraries, this is a total waste of time that will slow down the
# startup of paraview or even make paraview crash on startup.
setenv PV_PLUGIN_PATH \$FOAM_LIBBIN/paraview_plugins
if ( -e \$PARAVIEW_BIN_DIR ) then
_foamAddPath \$PARAVIEW_BIN_DIR
endif
if ( -e \$PARAVIEW_LIB_DIR/paraview-3.14 ) then
_foamAddLib \$PARAVIEW_LIB_DIR/paraview-3.14
endif
# Additional binary path if running on Mac OS X
if ( -e \$PARAVIEW_BIN_DIR/paraview.app/Contents/MacOS ) then
_foamAddPath \$PARAVIEW_BIN_DIR/paraview.app/Contents/MacOS
endif
DOT_CSH_EOF
#finally, generate a .tgz file for systems where using rpm for installing packages
# as a non-root user might be a problem.
(mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version})
# Make sure we clean the installation directory. Somehow, make install generates files there. Need to revisit this eventually.
(rm -rf %{_prefix}/packages/%{name}-%{version} )
%clean
rm -rf $RPM_BUILD_ROOT
rm -rf %{_prefix}/packages/%{name}-%{version}
%files
%defattr(-,root,root)
%{_installPrefix}

View file

@ -206,7 +206,7 @@ cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh
export PARAVIEW_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
export PARAVIEW_BIN_DIR=\$PARAVIEW_DIR/bin
export PARAVIEW_LIB_DIR=\$PARAVIEW_DIR/lib
export PARAVIEW_INCLUDE_DIR=\$PARAVIEW_DIR/include
export PARAVIEW_INCLUDE_DIR=\$PARAVIEW_DIR/include/paraview-3.8
export PARAVIEW_VERSION=%{version}
@ -236,7 +236,7 @@ cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.cs
setenv PARAVIEW_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
setenv PARAVIEW_BIN_DIR \$PARAVIEW_DIR/bin
setenv PARAVIEW_LIB_DIR \$PARAVIEW_DIR/lib
setenv PARAVIEW_INCLUDE_DIR \$PARAVIEW_DIR/include
setenv PARAVIEW_INCLUDE_DIR \$PARAVIEW_DIR/include/paraview-3.8
setenv PARAVIEW_VERSION %{version}

View file

@ -0,0 +1,183 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# RPM spec file for PyFoam-0.5.6
#
# Description
# RPM spec file for PyFoam version 0.5.6
#
# Author:
# Martin Beaudoin, Hydro-Quebec, (2012)
#
#------------------------------------------------------------------------------
# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable
%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)}
%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)}
# Disable the generation of debuginfo packages
%define debug_package %{nil}
# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory
%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild
%define _tmppath %{_topdir}/tmp
# Will install the package directly $WM_THIRD_PARTY_DIR
# Some comments about package relocation:
# By using this prefix for the Prefix: parameter in thi file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
# Simply take note that libraries built with libtool are not relocatable because the
# prefix we specify will be hard-coded in the library .la files.
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
%define name PyFoam
%define release 1
%define version 0.5.6
%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: PyFoam
License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
BuildArch: noarch
URL: http://openfoamwiki.net/images/b/b8/PyFoam-0.5.6.tar.gz
Source: %url/%{name}-%{version}.tar.gz
Prefix: %{_prefix}
Group: Development/Tools
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/noarch
%description
%{summary}
%prep
%setup -q
%build
# Make the shebang line portable
python setup.py build --executable "/usr/bin/env python"
%install
python setup.py install --prefix=$RPM_BUILD_ROOT/%{_installPrefix}
%define pythonVersion $(python -V 2>&1 | awk -F ' ' {'print $2'} | awk -F \. {'print $1 "." $2'})
# Creation of OpenFOAM specific .csh and .sh files"
echo ""
echo "Generating OpenFOAM specific .csh and .sh files for the package %{name}-%{version}"
echo ""
#
# Generate package specific .sh file for OpenFOAM
#
mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc
cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export PYFOAM_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
export PYTHONPATH=\$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages
# Enable access to the package applications if present
[ -d \$PYFOAM_DIR/bin ] && _foamAddPath \$PYFOAM_DIR/bin
DOT_SH_EOF
#
# Generate package specific .csh file for OpenFOAM
#
cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv PYFOAM_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages
if ( -e \$PYFOAM_DIR/bin ) then
_foamAddPath \$PYFOAM_DIR/bin
endif
DOT_CSH_EOF
cat << DOT_HARDCODED_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}_hardcoded.sh
# In this version of the configuration script, the paths are hardcoded,
# which makes it easier to load PyFoam without the OpenFOAM environment
# variables
#
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export PYFOAM_DIR=$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
export PYTHONPATH=\$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages
# Enable access to the package applications if present
[ -d \$PYFOAM_DIR/bin ] && export PATH=\$PYFOAM_DIR/bin:\$PATH
DOT_HARDCODED_SH_EOF
#
# Generate package specific .csh file for OpenFOAM
#
cat << DOT_HARDCODED_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}_hardcoded.csh
# In this version of the configuration script, the paths are hardcoded,
# which makes it easier to load PyFoam without the OpenFOAM environment
# variables
#
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv PYFOAM_DIR $WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages
if ( -e \$PYFOAM_DIR/bin ) then
setenv PATH \$PYFOAM_DIR/bin:\$PATH
endif
DOT_HARDCODED_CSH_EOF
#finally, generate a .tgz file for systems where using rpm for installing packages
# as a non-root user might be a problem.
(mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version})
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{_installPrefix}

View file

@ -0,0 +1,183 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# RPM spec file for PyFoam-0.5.7
#
# Description
# RPM spec file for PyFoam version 0.5.7
#
# Author:
# Martin Beaudoin, Hydro-Quebec, (2012)
#
#------------------------------------------------------------------------------
# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable
%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)}
%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)}
# Disable the generation of debuginfo packages
%define debug_package %{nil}
# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory
%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild
%define _tmppath %{_topdir}/tmp
# Will install the package directly $WM_THIRD_PARTY_DIR
# Some comments about package relocation:
# By using this prefix for the Prefix: parameter in thi file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
# Simply take note that libraries built with libtool are not relocatable because the
# prefix we specify will be hard-coded in the library .la files.
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
%define name PyFoam
%define release 1
%define version 0.5.7
%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: PyFoam
License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
BuildArch: noarch
URL: http://openfoamwiki.net/images/d/dc/PyFoam-0.5.7.tar.gz
Source: %url/%{name}-%{version}.tar.gz
Prefix: %{_prefix}
Group: Development/Tools
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/noarch
%description
%{summary}
%prep
%setup -q
%build
# Make the shebang line portable
python setup.py build --executable "/usr/bin/env python"
%install
python setup.py install --prefix=$RPM_BUILD_ROOT/%{_installPrefix}
%define pythonVersion $(python -V 2>&1 | awk -F ' ' {'print $2'} | awk -F \. {'print $1 "." $2'})
# Creation of OpenFOAM specific .csh and .sh files"
echo ""
echo "Generating OpenFOAM specific .csh and .sh files for the package %{name}-%{version}"
echo ""
#
# Generate package specific .sh file for OpenFOAM
#
mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc
cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export PYFOAM_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
export PYTHONPATH=\$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages
# Enable access to the package applications if present
[ -d \$PYFOAM_DIR/bin ] && _foamAddPath \$PYFOAM_DIR/bin
DOT_SH_EOF
#
# Generate package specific .csh file for OpenFOAM
#
cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv PYFOAM_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages
if ( -e \$PYFOAM_DIR/bin ) then
_foamAddPath \$PYFOAM_DIR/bin
endif
DOT_CSH_EOF
cat << DOT_HARDCODED_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}_hardcoded.sh
# In this version of the configuration script, the paths are hardcoded,
# which makes it easier to load PyFoam without the OpenFOAM environment
# variables
#
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export PYFOAM_DIR=$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
export PYTHONPATH=\$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages
# Enable access to the package applications if present
[ -d \$PYFOAM_DIR/bin ] && export PATH=\$PYFOAM_DIR/bin:\$PATH
DOT_HARDCODED_SH_EOF
#
# Generate package specific .csh file for OpenFOAM
#
cat << DOT_HARDCODED_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}_hardcoded.csh
# In this version of the configuration script, the paths are hardcoded,
# which makes it easier to load PyFoam without the OpenFOAM environment
# variables
#
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv PYFOAM_DIR $WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/noarch
setenv PYTHONPATH \$PYFOAM_DIR/lib/python%{pythonVersion}/site-packages
if ( -e \$PYFOAM_DIR/bin ) then
setenv PATH \$PYFOAM_DIR/bin:\$PATH
endif
DOT_HARDCODED_CSH_EOF
#finally, generate a .tgz file for systems where using rpm for installing packages
# as a non-root user might be a problem.
(mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version})
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{_installPrefix}

View file

@ -0,0 +1,151 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# RPM spec file for cmake-2.8.5
#
# Description
# RPM spec file for creating a relocatable RPM
#
# Author:
# Martin Beaudoin, Hydro-Quebec, (2010)
#
#------------------------------------------------------------------------------
# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable
%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)}
%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)}
# Disable the generation of debuginfo packages
%define debug_package %{nil}
# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory
%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild
%define _tmppath %{_topdir}/tmp
# Will install the package directly $WM_THIRD_PARTY_DIR
# Some comments about package relocation:
# By using this prefix for the Prefix: parameter in thi file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
# Simply take note that libraries built with libtool are not relocatable because the
# prefix we specify will be hard-coded in the library .la files.
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
%define name cmake
%define release %{_WM_OPTIONS}
%define version 2.8.5
%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: cmake
License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
URL: http://www.cmake.org/files/v2.8/
Source: %url/%{name}-%{version}.tar.gz
Prefix: %{_prefix}
Group: Development/Tools
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
%description
%{summary}
%prep
%setup -q
%build
# export WM settings in a form that GNU configure recognizes
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
./configure \
--prefix=%{_installPrefix}
[ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1
make -j $WM_NCOMPPROCS
%install
make install DESTDIR=$RPM_BUILD_ROOT
# Creation of OpenFOAM specific .csh and .sh files"
echo ""
echo "Generating OpenFOAM specific .csh and .sh files for the package %{name}-%{version}"
echo ""
#
# Generate package specific .sh file for OpenFOAM
#
mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc
cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export CMAKE_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
export CMAKE_BIN_DIR=\$CMAKE_DIR/bin
# Enable access to the runtime package applications
[ -d \$CMAKE_BIN_DIR ] && _foamAddPath \$CMAKE_BIN_DIR
DOT_SH_EOF
#
# Generate package specific .csh file for OpenFOAM
#
cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv CMAKE_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
setenv CMAKE_BIN_DIR \$CMAKE_DIR/bin
if ( -e \$CMAKE_BIN_DIR ) then
_foamAddPath \$CMAKE_BIN_DIR
endif
DOT_CSH_EOF
#finally, generate a .tgz file for systems where using rpm for installing packages
# as a non-root user might be a problem.
(mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version})
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{_installPrefix}

View file

@ -0,0 +1,151 @@
#------------------------------------------------------------------------------
# ========= |
# \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
# \\ / O peration |
# \\ / A nd | Copyright held by original author
# \\/ M anipulation |
#------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM.
#
# OpenFOAM is free software; you can redistribute it and/or modify it
# under the terms of the GNU General Public License as published by the
# Free Software Foundation; either version 2 of the License, or (at your
# option) any later version.
#
# OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
# FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
# for more details.
#
# You should have received a copy of the GNU General Public License
# along with OpenFOAM; if not, write to the Free Software Foundation,
# Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
#
# Script
# RPM spec file for cmake-2.8.6
#
# Description
# RPM spec file for creating a relocatable RPM
#
# Author:
# Martin Beaudoin, Hydro-Quebec, (2010)
#
#------------------------------------------------------------------------------
# We grab the value of WM_THIRD_PARTY and WM_OPTIONS from the environment variable
%{expand:%%define _WM_THIRD_PARTY_DIR %(echo $WM_THIRD_PARTY_DIR)}
%{expand:%%define _WM_OPTIONS %(echo $WM_OPTIONS)}
# Disable the generation of debuginfo packages
%define debug_package %{nil}
# The topdir needs to point to the $WM_THIRD_PARTY/rpmbuild directory
%define _topdir %{_WM_THIRD_PARTY_DIR}/rpmBuild
%define _tmppath %{_topdir}/tmp
# Will install the package directly $WM_THIRD_PARTY_DIR
# Some comments about package relocation:
# By using this prefix for the Prefix: parameter in thi file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
# Simply take note that libraries built with libtool are not relocatable because the
# prefix we specify will be hard-coded in the library .la files.
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
%define name cmake
%define release %{_WM_OPTIONS}
%define version 2.8.6
%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
BuildRoot: %{buildroot}
Summary: cmake
License: Unkown
Name: %{name}
Version: %{version}
Release: %{release}
URL: http://www.cmake.org/files/v2.8/
Source: %url/%{name}-%{version}.tar.gz
Prefix: %{_prefix}
Group: Development/Tools
%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
%description
%{summary}
%prep
%setup -q
%build
# export WM settings in a form that GNU configure recognizes
[ -n "$WM_CC" ] && export CC="$WM_CC"
[ -n "$WM_CXX" ] && export CXX="$WM_CXX"
[ -n "$WM_CFLAGS" ] && export CFLAGS="$WM_CFLAGS"
[ -n "$WM_CXXFLAGS" ] && export CXXFLAGS="$WM_CXXFLAGS"
[ -n "$WM_LDFLAGS" ] && export LDFLAGS="$WM_LDFLAGS"
./configure \
--prefix=%{_installPrefix}
[ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1
make -j $WM_NCOMPPROCS
%install
make install DESTDIR=$RPM_BUILD_ROOT
# Creation of OpenFOAM specific .csh and .sh files"
echo ""
echo "Generating OpenFOAM specific .csh and .sh files for the package %{name}-%{version}"
echo ""
#
# Generate package specific .sh file for OpenFOAM
#
mkdir -p $RPM_BUILD_ROOT/%{_installPrefix}/etc
cat << DOT_SH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.sh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
export CMAKE_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
export CMAKE_BIN_DIR=\$CMAKE_DIR/bin
# Enable access to the runtime package applications
[ -d \$CMAKE_BIN_DIR ] && _foamAddPath \$CMAKE_BIN_DIR
DOT_SH_EOF
#
# Generate package specific .csh file for OpenFOAM
#
cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh
# Load %{name}-%{version} libraries and binaries if available
# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
setenv CMAKE_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
setenv CMAKE_BIN_DIR \$CMAKE_DIR/bin
if ( -e \$CMAKE_BIN_DIR ) then
_foamAddPath \$CMAKE_BIN_DIR
endif
DOT_CSH_EOF
#finally, generate a .tgz file for systems where using rpm for installing packages
# as a non-root user might be a problem.
(mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version})
%clean
rm -rf %{buildroot}
%files
%defattr(-,root,root)
%{_installPrefix}

View file

@ -60,7 +60,7 @@ rpm_make()
_PACKAGE_URL=''
_ADDITIONALFLAGS=''
while getopts p:s:u:a: flags
while getopts p:s:u:f:n:a: flags
do
case $flags in
p) _PACKAGE=$OPTARG
@ -69,7 +69,11 @@ rpm_make()
;;
s) _SPECFILE=$OPTARG
;;
a) _ADDITIONALFLAGS=$OPTARG
f) _ADDITIONALFLAGS=$OPTARG
;;
n) _RPMFILENAME=$OPTARG
;;
a) architecture=$OPTARG
;;
esac
done
@ -82,13 +86,11 @@ rpm_make()
# Shift options
shift `expr $OPTIND - 1`
# Make sure the ThirdParty environment is up-to-date
echo "Updating the ThirdParty environment variables before building package $_PACKAGE"
. $WM_PROJECT_DIR/etc/settings.sh
rpmName=$_PACKAGE-$WM_OPTIONS.$architecture
rpmFile=$buildBase/RPMS/$architecture/$rpmName.rpm
echo "RPM file name : $rpmFile"
# We check immediatly if the RPM binary package is available in the local RPMs vault.
# If so, we basically uninstall/reinstall the package. This is handy for installation
# on machines with no Internet access, so without downloading capabilities. If one wants to
@ -184,7 +186,7 @@ rpm_uninstall()
rpm_install()
{
package="$1";
rpmName=$package-$WM_OPTIONS.$architecture;
rpmName=$package.$architecture;
rpmFile=$buildBase/RPMS/$architecture/$rpmName.rpm;
echo " Installing $package using RPM file: $rpmFile";

View file

@ -12,8 +12,7 @@
mesh
);
p = dimensionedScalar("zero", p.dimensions(), 0.0);
p.internalField() = 0;
Info<< "Reading field U\n" << endl;
volVectorField U
@ -29,7 +28,10 @@
mesh
);
U = dimensionedVector("0", U.dimensions(), vector::zero);
if (args.optionFound("resetU"))
{
U.internalField() = vector::zero;
}
surfaceScalarField phi
(

View file

@ -38,7 +38,7 @@ Description
int main(int argc, char *argv[])
{
argList::validOptions.insert("resetU", "");
argList::validOptions.insert("writep", "");
# include "setRootCase.H"

View file

@ -36,7 +36,6 @@ Description
int main(int argc, char *argv[])
{
# include "setRootCase.H"
# include "createTime.H"

View file

@ -29,4 +29,5 @@ EXE_LIBS = \
-llaminarFlameSpeedModels \
-lfiniteVolume \
-ldynamicFvMesh \
-llduSolvers
-llduSolvers \
-L$(MESQUITE_LIB_DIR) -lmesquite

View file

@ -299,7 +299,9 @@ void PDRkEpsilon::correct()
epsEqn().relax();
epsEqn().boundaryManipulate(epsilon_.boundaryField());
// No longer needed: matrix completes at the point of solution
// HJ, 17/Apr/2012
// epsEqn().completeAssembly();
solve(epsEqn);
bound(epsilon_, epsilon0_);

View file

@ -5,7 +5,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
mesh,
fields,
phi,
mesh.divScheme("div(phi,ft_b_h_hu)")
mesh.schemesDict().divScheme("div(phi,ft_b_h_hu)")
)
);

View file

@ -19,4 +19,5 @@ EXE_LIBS = \
-llaminarFlameSpeedModels \
-lfiniteVolume \
-lmeshTools \
-llduSolvers
-llduSolvers \
-L$(MESQUITE_LIB_DIR) -lmesquite

View file

@ -5,7 +5,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
mesh,
fields,
phi,
mesh.divScheme("div(phi,ft_b_h_hu)")
mesh.schemesDict().divScheme("div(phi,ft_b_h_hu)")
)
);

View file

@ -16,4 +16,5 @@ EXE_LIBS = \
-lbasicThermophysicalModels \
-lspecie \
-lfiniteVolume \
-llduSolvers
-llduSolvers \
-L$(MESQUITE_LIB_DIR) -lmesquite

View file

@ -34,4 +34,5 @@ EXE_LIBS = \
-lchemistryModel \
-lODE \
-lpdf \
-llduSolvers
-llduSolvers \
-L$(MESQUITE_LIB_DIR) -lmesquite

View file

@ -5,7 +5,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
mesh,
fields,
phi,
mesh.divScheme("div(phi,Yi_h)")
mesh.schemesDict().divScheme("div(phi,Yi_h)")
)
);
@ -28,7 +28,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
==
dieselSpray.evaporationSource(i)
+ kappa*chemistry.RR(i),
mesh.solver("Yi")
mesh.solutionDict().solver("Yi")
);
Yi.max(0.0);

View file

@ -18,4 +18,5 @@ EXE_LIBS = \
-lspecie \
-llaminarFlameSpeedModels \
-lfiniteVolume \
-llduSolvers
-llduSolvers \
-L$(MESQUITE_LIB_DIR) -lmesquite

View file

@ -18,7 +18,7 @@ if (oCorr == nOuterCorr - 1)
fvc::interpolate(rho)*(g & mesh.Sf())
- fvc::snGrad(p)*mesh.magSf()
),
mesh.solver("UFinal")
mesh.solutionDict().solver("UFinal")
);
}
else

View file

@ -77,7 +77,7 @@ int main(int argc, char *argv[])
#include "fuhsEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr = 0; corr < nCorr; corr++)
{
#include "pEqn.H"
}

View file

@ -5,7 +5,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
mesh,
fields,
phi,
mesh.divScheme("div(phi,ft_b_h)")
mesh.schemesDict().divScheme("div(phi,ft_b_h)")
)
);

View file

@ -32,11 +32,11 @@ for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
{
pEqn.solve(mesh.solver(p.name() + "Final"));
pEqn.solve(mesh.solutionDict().solver(p.name() + "Final"));
}
else
{
pEqn.solve(mesh.solver(p.name()));
pEqn.solve(mesh.solutionDict().solver(p.name()));
}
if (nonOrth == nNonOrthCorr)

View file

@ -8,12 +8,12 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude
EXE_LIBS = \
-lbasicThermophysicalModels \
-lcompressibleTurbulenceModel \
-lcompressibleRASModels \
-lcompressibleLESModels \
-lreactionThermophysicalModels \
-lspecie \
-lbasicThermophysicalModels \
-lchemistryModel \
-lODE \
-lfiniteVolume \

View file

@ -5,7 +5,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
mesh,
fields,
phi,
mesh.divScheme("div(phi,Yi_h)")
mesh.schemesDict().divScheme("div(phi,Yi_h)")
)
);
@ -26,7 +26,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
- fvm::laplacian(turbulence->muEff(), Yi)
==
kappa*chemistry.RR(i),
mesh.solver("Yi")
mesh.solutionDict().solver("Yi")
);
Yi.max(0.0);

View file

@ -5,7 +5,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
mesh,
fields,
phi,
mesh.divScheme("div(phi,Yi_h)")
mesh.schemesDict().divScheme("div(phi,Yi_h)")
)
);
@ -26,7 +26,7 @@ tmp<fv::convectionScheme<scalar> > mvConvection
- fvm::laplacian(turbulence->muEff(), Yi)
==
kappa*chemistry.RR(i),
mesh.solver("Yi")
mesh.solutionDict().solver("Yi")
);
Yi.max(0.0);

View file

@ -38,7 +38,7 @@
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solver(p.name() + "Final"));
pEqn.solve(mesh.solutionDict().solver(p.name() + "Final"));
}
else
{
@ -76,7 +76,7 @@
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solver(p.name() + "Final"));
pEqn.solve(mesh.solutionDict().solver(p.name() + "Final"));
}
else
{

View file

@ -163,13 +163,13 @@ void smoluchowskiJumpTFvPatchScalarField::updateCoeffs()
}
const fvPatchScalarField& pmu =
patch().lookupPatchField<volScalarField, scalar>("mu");
lookupPatchField<volScalarField, scalar>("mu");
const fvPatchScalarField& prho =
patch().lookupPatchField<volScalarField, scalar>("rho");
lookupPatchField<volScalarField, scalar>("rho");
const fvPatchField<scalar>& ppsi =
patch().lookupPatchField<volScalarField, scalar>("psi");
lookupPatchField<volScalarField, scalar>("psi");
const fvPatchVectorField& pU =
patch().lookupPatchField<volVectorField, vector>("U");
lookupPatchField<volVectorField, vector>("U");
// Prandtl number reading consistent with rhoCentralFoam
const dictionary& thermophysicalProperties =

View file

@ -141,11 +141,11 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs()
}
const fvPatchScalarField& pmu =
patch().lookupPatchField<volScalarField, scalar>("mu");
lookupPatchField<volScalarField, scalar>("mu");
const fvPatchScalarField& prho =
patch().lookupPatchField<volScalarField, scalar>("rho");
lookupPatchField<volScalarField, scalar>("rho");
const fvPatchField<scalar>& ppsi =
patch().lookupPatchField<volScalarField, scalar>("psi");
lookupPatchField<volScalarField, scalar>("psi");
Field<scalar> C1 = sqrt(ppsi*mathematicalConstant::pi/2.0)
*(2.0 - accommodationCoeff_)/accommodationCoeff_;
@ -170,7 +170,7 @@ void maxwellSlipUFvPatchVectorField::updateCoeffs()
if(curvature_)
{
const fvPatchTensorField& ptauMC =
patch().lookupPatchField<volTensorField, tensor>("tauMC");
lookupPatchField<volTensorField, tensor>("tauMC");
vectorField n = patch().nf();
refValue() -= C1/prho*transform(I - n*n, (n & ptauMC));

View file

@ -100,10 +100,10 @@ void fixedRhoFvPatchScalarField::updateCoeffs()
}
const fvPatchField<scalar>& psip =
patch().lookupPatchField<volScalarField, scalar>("psi");
lookupPatchField<volScalarField, scalar>("psi");
const fvPatchField<scalar>& pp =
patch().lookupPatchField<volScalarField, scalar>("p");
lookupPatchField<volScalarField, scalar>("p");
operator==(psip*pp);

View file

@ -7,9 +7,16 @@ tmp<fvVectorMatrix> UEqn
+ turbulence->divDevRhoReff(U)
);
if (oCorr == nOuterCorr-1)
if (oCorr == nOuterCorr - 1)
{
if (mesh.solutionDict().relax("UFinal"))
{
UEqn().relax(mesh.solutionDict().relaxationFactor("UFinal"));
}
else
{
UEqn().relax(1);
}
}
else
{
@ -22,7 +29,7 @@ if (momentumPredictor)
{
if (oCorr == nOuterCorr-1)
{
solve(UEqn() == -fvc::grad(p), mesh.solver("UFinal"));
solve(UEqn() == -fvc::grad(p), mesh.solutionDict().solver("UFinal"));
}
else
{

View file

@ -11,7 +11,7 @@
if (oCorr == nOuterCorr-1)
{
hEqn.relax();
hEqn.solve(mesh.solver("hFinal"));
hEqn.solve(mesh.solutionDict().solver("hFinal"));
}
else
{

View file

@ -36,7 +36,7 @@ if (transonic)
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solver("pFinal"));
pEqn.solve(mesh.solutionDict().solver("pFinal"));
}
else
{
@ -75,7 +75,7 @@ else
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solver("pFinal"));
pEqn.solve(mesh.solutionDict().solver("pFinal"));
}
else
{

View file

@ -79,7 +79,7 @@ int main(int argc, char *argv[])
#include "hEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr = 0; corr < nCorr; corr++)
{
#include "pEqn.H"
}

View file

@ -9,7 +9,14 @@ tmp<fvVectorMatrix> UEqn
if (oCorr == nOuterCorr-1)
{
if (mesh.solutionDict().relax("UFinal"))
{
UEqn().relax(mesh.solutionDict().relaxationFactor("UFinal"));
}
else
{
UEqn().relax(1);
}
}
else
{
@ -25,7 +32,7 @@ if (momentumPredictor)
{
if (oCorr == nOuterCorr-1)
{
solve(UEqn() == -fvc::grad(p), mesh.solver("UFinal"));
solve(UEqn() == -fvc::grad(p), mesh.solutionDict().solver("UFinal"));
}
else
{

View file

@ -37,7 +37,7 @@ if (transonic)
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solver("pFinal"));
pEqn.solve(mesh.solutionDict().solver("pFinal"));
}
else
{
@ -77,7 +77,7 @@ else
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solver("pFinal"));
pEqn.solve(mesh.solutionDict().solver("pFinal"));
}
else
{

View file

@ -81,7 +81,7 @@ int main(int argc, char *argv[])
#include "hEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr = 0; corr < nCorr; corr++)
{
#include "pEqn.H"
}

View file

@ -26,7 +26,7 @@ if (transonic)
);
// Relax the pressure equation to ensure diagonal-dominance
pEqn.relax(mesh.relaxationFactor("pEqn"));
pEqn.relax(mesh.solutionDict().relaxationFactor("pEqn"));
pEqn.setReference(pRefCell, pRefValue);

View file

@ -129,13 +129,13 @@ void inviscidWallPFvPatchScalarField::updateCoeffs()
}
const fvPatchField<vector>& rhoUp =
patch().lookupPatchField<volVectorField, vector>("rhoU");
lookupPatchField<volVectorField, vector>("rhoU");
const fvsPatchField<scalar>& phip =
patch().lookupPatchField<surfaceScalarField, scalar>("phi");
lookupPatchField<surfaceScalarField, scalar>("phi");
const fvsPatchField<scalar>& rAp =
patch().lookupPatchField<surfaceScalarField, scalar>("rrhoUAf");
lookupPatchField<surfaceScalarField, scalar>("rrhoUAf");
gradient() = (fluxFraction_*phip - (patch().Sf() & rhoUp))/
(rAp*patch().magSf());

View file

@ -98,10 +98,10 @@ void fixedRhoFvPatchScalarField::updateCoeffs()
}
const fvPatchField<scalar>& psip =
patch().lookupPatchField<volScalarField, scalar>("psi");
lookupPatchField<volScalarField, scalar>("psi");
const fvPatchField<scalar>& pp =
patch().lookupPatchField<volScalarField, scalar>("p");
lookupPatchField<volScalarField, scalar>("p");
operator==(psip*pp);

View file

@ -111,10 +111,10 @@ void gradientRhoFvPatchScalarField::updateCoeffs()
}
const fvPatchField<scalar>& psip =
patch().lookupPatchField<volScalarField, scalar>("psi");
lookupPatchField<volScalarField, scalar>("psi");
const fvPatchField<scalar>& pp =
patch().lookupPatchField<volScalarField, scalar>("p");
lookupPatchField<volScalarField, scalar>("p");
gradient() = psip*pp.snGrad() + psip.snGrad()*pp;

View file

@ -105,13 +105,13 @@ void fixedRhoEFvPatchScalarField::updateCoeffs()
dimensionedScalar Cv(thermodynamicProperties.lookup("Cv"));
const fvPatchScalarField& rhop =
patch().lookupPatchField<volScalarField, scalar>("rho");
lookupPatchField<volScalarField, scalar>("rho");
const fvPatchVectorField& rhoUp =
patch().lookupPatchField<volVectorField, vector>("rhoU");
lookupPatchField<volVectorField, vector>("rhoU");
const fvPatchScalarField& Tp =
patch().lookupPatchField<volScalarField, scalar>("T");
lookupPatchField<volScalarField, scalar>("T");
operator==(rhop*(Cv.value()*Tp + 0.5*magSqr(rhoUp/rhop)));

View file

@ -137,11 +137,11 @@ void mixedRhoEFvPatchScalarField::updateCoeffs()
}
const fvPatchField<scalar>& rhop =
patch().lookupPatchField<volScalarField, scalar>("rho");
lookupPatchField<volScalarField, scalar>("rho");
const fvPatchField<vector>& rhoUp =
patch().lookupPatchField<volVectorField, vector>("rhoU");
lookupPatchField<volVectorField, vector>("rhoU");
// fvPatchField<scalar>& Tp =
// patch().lookupPatchField<volScalarField, scalar>("T");
// lookupPatchField<volScalarField, scalar>("T");
const volScalarField& T = db().lookupObject<volScalarField>("T");
const label patchi = patch().index();

View file

@ -98,10 +98,10 @@ void fixedRhoUFvPatchVectorField::updateCoeffs()
}
const fvPatchScalarField& rhop =
patch().lookupPatchField<volScalarField, scalar>("rho");
lookupPatchField<volScalarField, scalar>("rho");
const fvPatchVectorField& Up =
patch().lookupPatchField<volVectorField, vector>("U");
lookupPatchField<volVectorField, vector>("U");
operator==(rhop*Up);

View file

@ -72,7 +72,7 @@ int main(int argc, char *argv[])
# include "setDeltaT.H"
for (int outerCorr=0; outerCorr<nOuterCorr; outerCorr++)
for (int outerCorr = 0; outerCorr < nOuterCorr; outerCorr++)
{
magRhoU = mag(rhoU);
H = (rhoE + p)/rho;
@ -82,7 +82,7 @@ int main(int argc, char *argv[])
mesh,
fields,
phiv,
mesh.divScheme("div(phiv,rhoUH)")
mesh.schemesDict().divScheme("div(phiv,rhoUH)")
);
solve
@ -118,7 +118,7 @@ int main(int argc, char *argv[])
psi = 1.0/(R*T);
p = rho/psi;
for (int corr=0; corr<nCorr; corr++)
for (int corr = 0; corr < nCorr; corr++)
{
volScalarField rrhoUA = 1.0/rhoUEqn.A();
surfaceScalarField rrhoUAf("rrhoUAf", fvc::interpolate(rrhoUA));

View file

@ -65,7 +65,7 @@ int main(int argc, char *argv[])
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr = 0; corr < nCorr; corr++)
{
# include "pEqn.H"
}

View file

@ -88,7 +88,7 @@ int main(int argc, char *argv[])
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr = 0; corr < nCorr; corr++)
{
U = UEqn.H()/UEqn.A();

View file

@ -70,7 +70,7 @@ int main(int argc, char *argv[])
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr = 0; corr < nCorr; corr++)
{
volScalarField rUA = 1.0/UEqn.A();
U = rUA*UEqn.H();

View file

@ -95,64 +95,44 @@ int main(int argc, char *argv[])
// Prepare block system
BlockLduMatrix<vector2> blockM(mesh);
//- Transfer the coupled interface list for processor/cyclic/etc.
// boundaries
blockM.interfaces() = blockT.boundaryField().blockInterfaces();
// Grab block diagonal and set it to zero
Field<tensor2>& d = blockM.diag().asSquare();
d = tensor2::zero;
// Grab linear off-diagonal and set it to zero
Field<vector2>& u = blockM.upper().asLinear();
Field<vector2>& l = blockM.lower().asLinear();
Field<vector2>& u = blockM.upper().asLinear();
u = vector2::zero;
l = vector2::zero;
vector2Field& blockX = blockT.internalField();
// vector2Field blockX(mesh.nCells(), vector2::zero);
vector2Field blockB(mesh.nCells(), vector2::zero);
//- Inset equations into block Matrix
blockMatrixTools::insertEquation(0, TEqn, blockM, blockX, blockB);
blockMatrixTools::insertEquation(1, TsEqn, blockM, blockX, blockB);
//- Add off-diagonal terms and remove from Block source
//- Add off-diagonal terms and remove from block source
forAll(d, i)
{
d[i](0,1) = -alpha.value()*mesh.V()[i];
d[i](1,0) = -alpha.value()*mesh.V()[i];
d[i](0, 1) = -alpha.value()*mesh.V()[i];
d[i](1, 0) = -alpha.value()*mesh.V()[i];
blockB[i][0] -= alpha.value()*blockX[i][1]*mesh.V()[i];
blockB[i][1] -= alpha.value()*blockX[i][0]*mesh.V()[i];
}
//- Transfer the coupled interface list for processor/cyclic/etc. boundaries
blockM.interfaces() = blockT.boundaryField().blockInterfaces();
//- Transfer the coupled interface coefficients
forAll(mesh.boundaryMesh(), patchI)
{
if (blockM.interfaces().set(patchI))
{
Field<vector2>& coupledLower = blockM.coupleLower()[patchI].asLinear();
Field<vector2>& coupledUpper = blockM.coupleUpper()[patchI].asLinear();
const scalarField& TLower = TEqn.internalCoeffs()[patchI];
const scalarField& TUpper = TEqn.boundaryCoeffs()[patchI];
const scalarField& TsLower = TsEqn.internalCoeffs()[patchI];
const scalarField& TsUpper = TsEqn.boundaryCoeffs()[patchI];
blockMatrixTools::blockInsert(0, TLower, coupledLower);
blockMatrixTools::blockInsert(1, TsLower, coupledLower);
blockMatrixTools::blockInsert(0, TUpper, coupledUpper);
blockMatrixTools::blockInsert(1, TsUpper, coupledUpper);
}
}
//- Block coupled solver call
BlockSolverPerformance<vector2> solverPerf =
BlockLduSolver<vector2>::New
(
word("blockVar"),
blockT.name(),
blockM,
mesh.solver("blockVar")
mesh.solutionDict().solver(blockT.name())
)->solve(blockX, blockB);
solverPerf.print();

View file

@ -1,247 +0,0 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright held by original author
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by the
Free Software Foundation; either version 2 of the License, or (at your
option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM; if not, write to the Free Software Foundation,
Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace blockMatrixTools
{
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class BlockType>
void blockInsert
(
const direction dir,
const scalarField& x,
Field<BlockType>& blockX
)
{
forAll (x, i)
{
blockX[i](dir) = x[i];
}
}
template<class BlockType>
void blockRetrieve
(
const direction dir,
scalarField& x,
const Field<BlockType>& blockX
)
{
forAll (x, i)
{
x[i] = blockX[i](dir);
}
}
template<class BlockType>
void insertDiagSource
(
const direction dir,
const fvScalarMatrix& m,
BlockLduMatrix<BlockType>& blockM,
Field<BlockType>& blockB
)
{
// Prepare the diagonal and source
scalarField diag = m.diag();
scalarField source = m.source();
// Add boundary source contribution
m.addBoundaryDiag(diag, 0);
m.addBoundarySource(source, false);
if (blockM.diag().activeType() == blockCoeffBase::UNALLOCATED)
{
blockM.diag().asScalar() = diag;
}
else if
(
blockM.diag().activeType() == blockCoeffBase::SCALAR
|| blockM.diag().activeType() == blockCoeffBase::LINEAR
)
{
typename CoeffField<BlockType>::linearTypeField& blockDiag =
blockM.diag().asLinear();
forAll (diag, i)
{
blockDiag[i](dir) = diag[i];
}
}
else if (blockM.diag().activeType() == blockCoeffBase::SQUARE)
{
typename CoeffField<BlockType>::squareTypeField& blockDiag =
blockM.diag().asSquare();
forAll (diag, i)
{
blockDiag[i](dir, dir) = diag[i];
}
}
blockInsert(dir, source, blockB);
}
template<class BlockType>
void insertUpperLower
(
const direction dir,
const fvScalarMatrix& m,
BlockLduMatrix<BlockType>& blockM
)
{
if (m.diagonal())
{
// Matrix for insertion is diagonal-only: nothing to do
return;
}
if (m.hasUpper())
{
const scalarField& upper = m.upper();
if (blockM.upper().activeType() == blockCoeffBase::UNALLOCATED)
{
blockM.upper().asScalar() = upper;
}
else if
(
blockM.upper().activeType() == blockCoeffBase::SCALAR
|| blockM.upper().activeType() == blockCoeffBase::LINEAR
)
{
typename CoeffField<BlockType>::linearTypeField& blockUpper =
blockM.upper().asLinear();
forAll (upper, i)
{
blockUpper[i](dir) = upper[i];
}
}
else if (blockM.upper().activeType() == blockCoeffBase::SQUARE)
{
typename CoeffField<BlockType>::squareTypeField& blockUpper =
blockM.upper().asSquare();
forAll (upper, i)
{
blockUpper[i](dir, dir) = upper[i];
}
}
}
else
{
FatalErrorIn
(
"void insertUpperLower\n"
"(\n"
" const direction dir,\n"
" const fvScalarMatrix& m,\n"
" BlockLduMatrix<BlockType>& blockM\n"
")"
) << "Error in matrix insertion: problem with block structure"
<< abort(FatalError);
}
if (m.symmetric() && blockM.symmetric())
{
Info<< "Both m and blockM are symmetric: inserting only upper triangle"
<< endl;
}
else
{
// Either scalar or block matrix is asymmetric: insert lower triangle
const scalarField& lower = m.lower();
if (blockM.lower().activeType() == blockCoeffBase::UNALLOCATED)
{
blockM.lower().asScalar() = lower;
}
else if
(
blockM.lower().activeType() == blockCoeffBase::SCALAR
|| blockM.lower().activeType() == blockCoeffBase::LINEAR
)
{
typename CoeffField<BlockType>::linearTypeField& blockLower =
blockM.lower().asLinear();
forAll (lower, i)
{
blockLower[i](dir) = lower[i];
}
}
else if (blockM.lower().activeType() == blockCoeffBase::SQUARE)
{
typename CoeffField<BlockType>::squareTypeField& blockLower =
blockM.lower().asSquare();
forAll (lower, i)
{
blockLower[i](dir, dir) = lower[i];
}
}
}
}
template<class BlockType>
void insertEquation
(
const direction dir,
const fvScalarMatrix& m,
BlockLduMatrix<BlockType>& blockM,
Field<BlockType>& blockX,
Field<BlockType>& blockB
)
{
insertDiagSource(dir, m, blockM, blockB);
insertUpperLower(dir, m, blockM);
blockInsert(dir, m.psi(), blockX);
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace blockMatrixTools
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// ************************************************************************* //

View file

@ -113,6 +113,7 @@ addSolverToBlockMatrix(Vector2, blockCGSolverVector2, symMatrix);
typedef BlockGaussSeidelSolver<vector2> blockGaussSeidelSolverVector2;
makeBlockSolverTypeName(blockGaussSeidelSolverVector2);
addSolverToBlockMatrix(Vector2, blockGaussSeidelSolverVector2, symMatrix);
addSolverToBlockMatrix(Vector2, blockGaussSeidelSolverVector2, asymMatrix);
typedef BlockGMRESSolver<vector2> blockGMRESSolverVector2;
makeBlockSolverTypeName(blockGMRESSolverVector2);

View file

@ -28,7 +28,7 @@
);
// Working coupled solution field
// Working coupled solution field
Info<< "Creating field blockT\n" << endl;
volVector2Field blockT
(
@ -41,7 +41,7 @@
IOobject::NO_WRITE
),
mesh,
dimensionedVector2(word(), dimless, vector2::zero)
dimensionedVector2("zero", dimless, vector2::zero)
);
{
@ -53,38 +53,6 @@
blockT.write();
// Removed comparison with the reference field. HJ, 17/Jun/2010
#if (0)
Info<< "Reading field Tref\n" << endl;
volScalarField Tref
(
IOobject
(
"Tref",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
Info<< "Reading field Tsref\n" << endl;
volScalarField Tsref
(
IOobject
(
"Tsref",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
),
mesh
);
#endif
Info<< "Reading field U\n" << endl;
volVectorField U

View file

@ -114,7 +114,7 @@ int main(int argc, char *argv[])
(
"HrvsVar",
blockMatrix,
mesh.solver("HrvsVar")
mesh.solutionDict().solver("HrvsVar")
)->solve(psi, source);
Info << "Psi: " << psi << endl;

View file

@ -5,4 +5,5 @@ EXE_INC = \
EXE_LIBS = \
-lcoupledLduMatrix \
-lfiniteVolume
-lfiniteVolume \
-llduSolvers

View file

@ -46,6 +46,7 @@ int main(int argc, char *argv[])
# include "createTime.H"
# include "createFluidMesh.H"
# include "attachPatches.H"
# include "createSolidMesh.H"
# include "createFields.H"
# include "createSolidFields.H"

View file

@ -64,13 +64,10 @@
# include "createPhi.H"
label pRefCell = 0;
scalar pRefValue = 0.0;
setRefCell(p, mesh.solutionDict().subDict("PISO"), pRefCell, pRefValue);
# include "attachPatches.H"
Info<< "Reading field DT\n" << endl;
volScalarField DT
(

View file

@ -1,6 +1,8 @@
Info<< "Create mesh for time = "
<< runTime.timeName() << nl << endl;
Info << "f1" << endl;
fvMesh mesh
(
IOobject
@ -11,3 +13,6 @@
IOobject::MUST_READ
)
);
Info << "f2" << endl;

View file

@ -1,3 +1,5 @@
Info << "s1" << endl;
fvMesh solidMesh
(
IOobject
@ -8,3 +10,6 @@
IOobject::MUST_READ
)
);
Info << "s2" << endl;

View file

@ -92,7 +92,7 @@ int main(int argc, char *argv[])
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr = 0; corr < nCorr; corr++)
{
volScalarField rUA = 1.0/UEqn.A();

View file

@ -14,4 +14,5 @@ EXE_LIBS = \
-lmeshTools \
-lfiniteVolume \
$(WM_DECOMP_LIBS) \
-llduSolvers
-llduSolvers \
-L$(MESQUITE_LIB_DIR) -lmesquite

View file

@ -69,6 +69,7 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl;
bool meshChanged = mesh.update();
reduce(meshChanged, orOp<bool>());
if (meshChanged)
{
@ -89,7 +90,7 @@ int main(int argc, char *argv[])
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr = 0; corr < nCorr; corr++)
{
rUA = 1.0/UEqn.A();
@ -110,11 +111,11 @@ int main(int argc, char *argv[])
if (corr == nCorr - 1 && nonOrth == nNonOrthCorr)
{
pEqn.solve(mesh.solver(p.name() + "Final"));
pEqn.solve(mesh.solutionDict().solver(p.name() + "Final"));
}
else
{
pEqn.solve(mesh.solver(p.name()));
pEqn.solve(mesh.solutionDict().solver(p.name()));
}
if (nonOrth == nNonOrthCorr)

View file

@ -4,10 +4,12 @@ EXE_INC = \
-I$(LIB_SRC)/dynamicMesh/dynamicMesh/lnInclude \
-I$(LIB_SRC)/dynamicMesh/dynamicFvMesh/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel
-I$(LIB_SRC)/turbulenceModels/compressible/turbulenceModel \
-I$(LIB_SRC)/engine/lnInclude
EXE_LIBS = \
-lengine \
-lfiniteVolume \
-ldynamicFvMesh \
-ldynamicMesh \
-ltopoChangerFvMesh \
@ -17,6 +19,6 @@ EXE_LIBS = \
-lbasicThermophysicalModels \
-lspecie \
-lmeshTools \
-lfiniteVolume \
$(WM_DECOMP_LIBS) \
-llduSolvers
-llduSolvers \
-L$(MESQUITE_LIB_DIR) -lmesquite

View file

@ -6,6 +6,13 @@
+ turbulence->divDevRhoReff(U)
);
if (oCorr == nOuterCorr - 1)
{
UEqn.relax(1);
}
else
{
UEqn.relax();
}
solve(UEqn == -fvc::grad(p));

View file

@ -8,6 +8,8 @@
);
basicPsiThermo& thermo = pThermo();
// Make density field with zero gradient boundary conditions to handle
// attach-detach cases. HJ, 20/Mar/2011
volScalarField rho
(
IOobject
@ -18,7 +20,8 @@
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
thermo.rho()
thermo.rho(),
zeroGradientFvPatchScalarField::typeName
);
rho.oldTime();
@ -73,6 +76,7 @@
fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p)
);
volScalarField dpdt = fvc::ddt(p);
volScalarField rUA
(

View file

@ -1,17 +1,17 @@
Pav << runTime.theta() << " " << p.weightedAverage(mesh.V()).value() << endl;
Tav << runTime.theta() << " " << T.weightedAverage(mesh.V()).value() << endl;
Info << "Max T = " << max(T) << " K" << endl;
Info << "Min T = " << min(T) << " K" << endl;
Info << "Max p = " << max(p)/1.0e5 << " bar" << endl;
Info << "Max T = " << max(T).value() << " K" << endl;
Info << "Min T = " << min(T).value() << " K" << endl;
Info << "Max p = " << max(p).value()/1.0e5 << " bar" << endl;
massBal << runTime.theta() << " "
<< fvc::domainIntegrate(rho).value() << endl;
volume << runTime.theta() << " " << sum(mesh.V()) << endl;
debugT << nl << "Crank angle: " << runTime.theta() << endl;
debugT << "Max T = " << max(T) << " K" << endl;
debugT << "Min T = " << min(T) << " K" << endl;
debugT << "Max T = " << max(T).value() << " K" << endl;
debugT << "Min T = " << min(T).value() << " K" << endl;
kav << runTime.theta() << " "
<< (turbulence->k())().weightedAverage(mesh.V()).value() << endl;

View file

@ -2,14 +2,40 @@
rho = thermo.rho();
rUA = 1.0/UEqn.A();
H = UEqn.H();
U = rUA*UEqn.H();
phi = fvc::interpolate(rho)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
// Store pressure for under-relaxation
if (nOuterCorr != 1)
{
p.storePrevIter();
}
if (transonic)
{
surfaceScalarField phid =
fvc::interpolate(thermo.psi())*
((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvm::div(phid, p, "div(phid,p)")
- fvm::laplacian(rho*rUA, p)
);
pEqn.solve();
if (nonOrth == nNonOrthCorr)
{
phi == pEqn.flux();
}
}
}
else
{
phi = fvc::interpolate(rho)*
((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
@ -27,20 +53,20 @@
phi += pEqn.flux();
}
}
}
// Explicitly relax pressure except for last corrector
if (oCorr != nOuterCorr - 1)
{
p.relax();
}
# include "rhoEqn.H"
# include "compressibleContinuityErrs.H"
// Warning:
// rho does not carry working boundary conditions and needs to be updated
// strictly according to the thermodynamics package
// HJ, 22/Aug/2007
thermo.correct();
rho = thermo.rho();
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
U -= rUA*fvc::grad(p);
U.correctBoundaryConditions();
}
DpDt = fvc::DDt(surfaceScalarField("phiU", phi/fvc::interpolate(rho)), p);
dpdt = fvc::ddt(p);
}

View file

@ -1,14 +0,0 @@
# include "readTimeControls.H"
# include "readPISOControls.H"
bool correctPhi = false;
if (piso.found("correctPhi"))
{
correctPhi = Switch(piso.lookup("correctPhi"));
}
bool checkMeshCourantNo = false;
if (piso.found("checkMeshCourantNo"))
{
checkMeshCourantNo = Switch(piso.lookup("checkMeshCourantNo"));
}

View file

@ -49,8 +49,8 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createEngineTime.H"
# include "createDynamicFvMesh.H"
# include "readPISOControls.H"
# include "createEngineDynamicMesh.H"
# include "readPIMPLEControls.H"
# include "createFields.H"
# include "initContinuityErrs.H"
# include "readEngineTimeControls.H"
@ -67,7 +67,9 @@ int main(int argc, char *argv[])
while (runTime.run())
{
# include "readControls.H"
# include "readPIMPLEControls.H"
# include "checkTotalVolume.H"
# include "readEngineTimeControls.H"
# include "compressibleCourantNo.H"
# include "setDeltaT.H"
@ -75,38 +77,48 @@ int main(int argc, char *argv[])
Info<< "Crank angle = " << runTime.theta() << " CA-deg" << endl;
// make phi relative
// Make flux absolute
phi += meshFlux;
bool meshChanged = mesh.update();
if(meshChanged)
# include "volContinuity.H"
mesh.setBoundaryVelocity(U);
if (meshChanged)
{
thermo.correct();
# include "checkTotalVolume.H"
# include "compressibleCorrectPhi.H"
# include "CourantNo.H"
rho = thermo.rho();
rho.correctBoundaryConditions();
}
meshFlux = fvc::interpolate(rho)*fvc::meshPhi(rho, U);
// Make phi absolute
phi = fvc::interpolate(rho)
*((fvc::interpolate(U) & mesh.Sf()) - fvc::meshPhi(rho, U));
phi -= meshFlux;
DpDt = dpdt + fvc::div(phi/fvc::interpolate(rho), p)
- fvc::div(phi/fvc::interpolate(rho) + fvc::meshPhi(U))*p;
# include "rhoEqn.H"
// --- SIMPLE loop
for (int corr=1; corr<=nCorr; corr++)
{
# include "compressibleCourantNo.H"
}
// Pressure-velocity corrector
int oCorr = 0;
do
{
# include "rhoEqn.H"
# include "UEqn.H"
# include "hEqn.H"
// --- PISO loop
for (int corr = 1; corr <= nCorr; corr++)
{
# include "pEqn.H"
# include "hEqn.H"
}
} while (++oCorr < nOuterCorr);
turbulence->correct();

View file

@ -21,4 +21,5 @@ EXE_LIBS = \
-lincompressibleTransportModels \
-lfiniteVolume \
$(WM_DECOMP_LIBS) \
-llduSolvers
-llduSolvers \
-L$(MESQUITE_LIB_DIR) -lmesquite

View file

@ -69,6 +69,7 @@ int main(int argc, char *argv[])
Info<< "Time = " << runTime.timeName() << nl << endl;
bool meshChanged = mesh.update();
reduce(meshChanged, orOp<bool>());
if (meshChanged)
{
@ -88,7 +89,7 @@ int main(int argc, char *argv[])
# include "UEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr = 0; corr < nCorr; corr++)
{
rUA = 1.0/UEqn.A();
@ -109,11 +110,11 @@ int main(int argc, char *argv[])
if (corr == nCorr - 1 && nonOrth == nNonOrthCorr)
{
pEqn.solve(mesh.solver(p.name() + "Final"));
pEqn.solve(mesh.solutionDict().solver(p.name() + "Final"));
}
else
{
pEqn.solve(mesh.solver(p.name()));
pEqn.solve(mesh.solutionDict().solver(p.name()));
}
if (nonOrth == nNonOrthCorr)

View file

@ -71,7 +71,7 @@ int main(int argc, char *argv[])
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr = 0; corr < nCorr; corr++)
{
volScalarField rUA = 1.0/UEqn.A();

View file

@ -81,7 +81,7 @@ int main(int argc, char *argv[])
# include "TEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr = 0; corr < nCorr; corr++)
{
# include "pEqn.H"
}

View file

@ -19,13 +19,13 @@
fvm::laplacian(rUAf, p) == fvc::div(phi)
);
if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
if (corr == nCorr - 1 && nonOrth == nNonOrthCorr)
{
pEqn.solve(mesh.solver(p.name() + "Final"));
pEqn.solve(mesh.solutionDict().solver(p.name() + "Final"));
}
else
{
pEqn.solve(mesh.solver(p.name()));
pEqn.solve(mesh.solutionDict().solver(p.name()));
}
if (nonOrth == nNonOrthCorr)

View file

@ -76,7 +76,7 @@ int main(int argc, char *argv[])
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr = 0; corr < nCorr; corr++)
{
# include "pEqn.H"
}

View file

@ -32,13 +32,13 @@
- fvm::laplacian(rhorUAf, p)
);
if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
if (corr == nCorr - 1 && nonOrth == nNonOrthCorr)
{
pEqn.solve(mesh.solver(p.name() + "Final"));
pEqn.solve(mesh.solutionDict().solver(p.name() + "Final"));
}
else
{
pEqn.solve(mesh.solver(p.name()));
pEqn.solve(mesh.solutionDict().solver(p.name()));
}
if (nonOrth == nNonOrthCorr)

View file

@ -132,12 +132,12 @@ Foam::solidWallHeatFluxTemperatureFvPatchScalarField::K() const
if (mesh.objectRegistry::foundObject<volScalarField>(KName_))
{
return patch().lookupPatchField<volScalarField, scalar>(KName_);
return lookupPatchField<volScalarField, scalar>(KName_);
}
else if (mesh.objectRegistry::foundObject<volSymmTensorField>(KName_))
{
const symmTensorField& KWall =
patch().lookupPatchField<volSymmTensorField, scalar>(KName_);
lookupPatchField<volSymmTensorField, scalar>(KName_);
vectorField n = patch().nf();

View file

@ -133,7 +133,7 @@ solidWallMixedTemperatureCoupledFvPatchScalarField
const Foam::fvPatchScalarField&
Foam::solidWallMixedTemperatureCoupledFvPatchScalarField::K() const
{
return this->patch().lookupPatchField<volScalarField, scalar>(KName_);
return this->lookupPatchField<volScalarField, scalar>(KName_);
}

View file

@ -10,7 +10,7 @@
if (oCorr == nOuterCorr-1)
{
hEqn.relax();
hEqn.solve(mesh.solver("hFinal"));
hEqn.solve(mesh.solutionDict().solver("hFinal"));
}
else
{

View file

@ -31,15 +31,15 @@
if
(
oCorr == nOuterCorr-1
&& corr == nCorr-1
&& corr == nCorr - 1
&& nonOrth == nNonOrthCorr
)
{
pEqn.solve(mesh.solver(p.name() + "Final"));
pEqn.solve(mesh.solutionDict().solver(p.name() + "Final"));
}
else
{
pEqn.solve(mesh.solver(p.name()));
pEqn.solve(mesh.solutionDict().solver(p.name()));
}
if (nonOrth == nNonOrthCorr)

View file

@ -8,7 +8,7 @@ if (oCorr == 0)
#include "hEqn.H"
// --- PISO loop
for (int corr=0; corr<nCorr; corr++)
for (int corr = 0; corr < nCorr; corr++)
{
#include "pEqn.H"
}

View file

@ -132,7 +132,7 @@ void Foam::solidWallHeatFluxTemperatureFvPatchScalarField::updateCoeffs()
return;
}
const scalarField& Kw = patch().lookupPatchField<volScalarField, scalar>
const scalarField& Kw = lookupPatchField<volScalarField, scalar>
(
KName_
);

View file

@ -80,7 +80,7 @@ int main(int argc, char *argv[])
volScalarField rUA = 1.0/UEqn.A();
for (int corr=0; corr<nCorr; corr++)
for (int corr = 0; corr < nCorr; corr++)
{
U = rUA*UEqn.H();
phi = (fvc::interpolate(U) & mesh.Sf())
@ -99,11 +99,11 @@ int main(int argc, char *argv[])
if (corr == nCorr-1 && nonOrth == nNonOrthCorr)
{
pEqn.solve(mesh.solver(p.name() + "Final"));
pEqn.solve(mesh.solutionDict().solver(p.name() + "Final"));
}
else
{
pEqn.solve(mesh.solver(p.name()));
pEqn.solve(mesh.solutionDict().solver(p.name()));
}
if (nonOrth == nNonOrthCorr)

Some files were not shown because too many files have changed in this diff Show more