diff --git a/ThirdParty/AllMake.stage2 b/ThirdParty/AllMake.stage2
index 44613e46c..b8d04fdeb 100755
--- a/ThirdParty/AllMake.stage2
+++ b/ThirdParty/AllMake.stage2
@@ -40,8 +40,8 @@
# Requirements:
# 1: Your foam-extend environment must be properly initialized
# 2: AllMake.stage1 if you are overriding your system compiler
-# 3: The file etc/prefs.sh should be used for setting the variables enabling
-# the compilation of the various packages
+# 3: The file etc/prefs.sh should be used for setting the variables
+# enabling the compilation of the various packages
#
# Author:
# Martin Beaudoin, Hydro-Quebec, (2015)
@@ -104,6 +104,13 @@ then
( rpm_make -p openmpi-1.8.8 -s openmpi-1.8.8.spec -u http://www.open-mpi.org/software/ompi/v1.8/downloads/openmpi-1.8.8.tar.gz \
-f --define '_configureAdditionalArgs "$WM_THIRD_PARTY_USE_OPENMPI_188_ConfigureAdditionalArgs"')
}
+ # mvipich2-2.2
+ #
+ [ ! -z "$WM_THIRD_PARTY_USE_MVAPICH2_22" ] && {
+ echo "Building mvapich2 2.2"
+ ( rpm_make -p mvapich2-2.2 -s mvapich2-2.2.spec -u http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/mvapich2-2.2.tar.gz \
+ -f --define '_configureAdditionalArgs "$WM_THIRD_PARTY_USE_MVAPICH2_22_ConfigureAdditionalArgs"')
+ }
else
echo "Using system installed OpenMPI"
echo ""
diff --git a/ThirdParty/rpmBuild/SPECS/mvapich2-2.2.spec b/ThirdParty/rpmBuild/SPECS/mvapich2-2.2.spec
new file mode 100644
index 000000000..fed9345c4
--- /dev/null
+++ b/ThirdParty/rpmBuild/SPECS/mvapich2-2.2.spec
@@ -0,0 +1,268 @@
+#------------------------------------------------------------------------------
+# ========= |
+# \\ / F ield | foam-extend: Open Source CFD
+# \\ / O peration |
+# \\ / A nd | For copyright notice see file Copyright
+# \\/ M anipulation |
+#------------------------------------------------------------------------------
+# License
+# This file is part of foam-extend.
+#
+# foam-extend 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.
+#
+# foam-extend 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 foam-extend. If not, see .
+#
+# Script
+# RPM spec file for mvapich2-2.2
+#
+# Description
+# RPM spec file for creating a relocatable RPM
+#
+# Author:
+# Martin Beaudoin, Hydro-Quebec, (2015)
+#
+#------------------------------------------------------------------------------
+
+# 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 this 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 mvapich2
+%define release %{_WM_OPTIONS}
+%define version 2.2
+
+%define buildroot %{_topdir}/BUILD/%{name}-%{version}-root
+
+BuildRoot: %{buildroot}
+Summary: mvapich2
+License: BSD
+Name: %{name}
+Version: %{version}
+Release: %{release}
+URL: http://mvapich.cse.ohio-state.edu/download/mvapich/mv2/
+Source: %url/%{name}-%{version}.tar.gz
+Prefix: %{_prefix}
+Group: Development/Tools
+
+
+%define _installPrefix %{_prefix}/packages/%{name}-%{version}/platforms/%{_WM_OPTIONS}
+
+#--------------------------------------------------------------------------
+#
+# Here, we define default compiling options for mvapich2
+#
+# One can override the option on the commande line : --define='MACRO EXPR'
+#
+%{!?_configureAdditionalArgs: %define _configureAdditionalArgs Undefined}
+
+
+%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"
+
+ set +x
+ echo ""
+ echo "Compilation options:"
+ echo " _configureAdditionalArgs : %{_configureAdditionalArgs}"
+ echo ""
+ set -x
+
+ unset mpiWith
+ # Enable GridEngine if it appears to be in use
+ # If you don't want any integration with SGE, simply unset the SGE
+ # environment variable
+ if [ -n "$SGE_ROOT" ]
+ then
+ mpiWith="$mpiWith --with-sge"
+ else
+ mpiWith="$mpiWith --without-sge"
+ mpiWith="$mpiWith --enable-mca-no-build=ras-gridengine,pls-gridengine"
+ fi
+
+ # Infiniband support
+ # Adjust according to your local paths
+ # if [ -d /usr/local/ofed -a -d /usr/local/ofed/lib64 ]
+ # then
+ # mpiWith="$mpiWith --with-openib=/usr/local/ofed"
+ # mpiWith="$mpiWith --with-openib-libdir=/usr/local/ofed/lib64"
+ # fi
+
+ # NOTE. Option --disable-mcast disables Infiniband when libs are not present
+
+ ./configure \
+ --prefix=%{_installPrefix} \
+ --exec_prefix=%{_installPrefix} \
+ --enable-mpirun-prefix-by-default \
+ --enable-orterun-prefix-by-default \
+ --enable-shared \
+ --enable-mpi-cxx \
+ --disable-static \
+ --disable-mpi-f77 \
+ --disable-mpi-f90 \
+ --without-slurm \
+ --enable-mpi-profile $mpiWith \
+ --disable-vt \
+ echo %{?_configureAdditionalArgs}`
+
+ [ -z "$WM_NCOMPPROCS" ] && WM_NCOMPPROCS=1
+ make -j $WM_NCOMPPROCS
+
+%install
+ make install DESTDIR=$RPM_BUILD_ROOT
+
+ # Creation of foam-extend specific .csh and .sh files"
+
+ echo ""
+ echo "Generating foam-extend specific .csh and .sh files for the package %{name}-%{version}"
+ echo ""
+ #
+ # Generate package specific .sh file for foam-extend
+ #
+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
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+export MVAPICH2_DIR=\$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
+export MVAPICH2_BIN_DIR=\$MVAPICH2_DIR/bin
+export MVAPICH2_LIB_DIR=\$MVAPICH2_DIR/lib
+
+# Enable access to the package runtime applications and libraries
+[ -d \$MVAPICH2_BIN_DIR ] && _foamAddPath \$MVAPICH2_BIN_DIR
+[ -d \$MVAPICH2_LIB_DIR ] && _foamAddLib \$MVAPICH2_LIB_DIR
+
+export MPI_HOME=\$MVAPICH2_DIR
+export MPI_ARCH_PATH=\$MPI_HOME
+export OPAL_PREFIX=\$MPI_ARCH_PATH
+
+# We initialize the rest of the environment using mpicc --showme:
+# This does not work with MVAPICH2
+#export MVAPICH2_INCLUDE_DIR="\`mpicc --showme:incdirs\`"
+#export MVAPICH2_COMPILE_FLAGS="\`mpicc --showme:compile\`"
+#export MVAPICH2_LINK_FLAGS="\`mpicc --showme:link\`"
+
+# Set the foam-extend compilation flags
+export PINC=\$MVAPICH2_COMPILE_FLAGS
+export PLIBS=\$MVAPICH2_LINK_FLAGS
+
+
+if [ "\$FOAM_VERBOSE" -a "\$PS1" ]
+then
+ echo " Environment variables defined for OpenMPI:"
+ echo " MVAPICH2_BIN_DIR : \$MVAPICH2_BIN_DIR"
+ echo " MVAPICH2_LIB_DIR : \$MVAPICH2_LIB_DIR"
+ echo " MVAPICH2_INCLUDE_DIR : \$MVAPICH2_INCLUDE_DIR"
+ echo " MVAPICH2_COMPILE_FLAGS : \$MVAPICH2_COMPILE_FLAGS"
+ echo " MVAPICH2_LINK_FLAGS : \$MVAPICH2_LINK_FLAGS"
+ echo ""
+ echo " MPI_HOME : \$MPI_HOME"
+ echo " MPI_ARCH_PATH : \$MPI_ARCH_PATH"
+ echo " OPAL_PREFIX : \$OPAL_PREFIX"
+ echo " PINC : \$PINC"
+ echo " PLIBS : \$PLIBS"
+fi
+DOT_SH_EOF
+
+ #
+ # Generate package specific .csh file for foam-extend
+ #
+cat << DOT_CSH_EOF > $RPM_BUILD_ROOT/%{_installPrefix}/etc/%{name}-%{version}.csh
+# Load %{name}-%{version} libraries and binaries
+# ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+setenv MVAPICH2_DIR \$WM_THIRD_PARTY_DIR/packages/%{name}-%{version}/platforms/\$WM_OPTIONS
+setenv MVAPICH2_BIN_DIR \$MVAPICH2_DIR/bin
+setenv MVAPICH2_LIB_DIR \$MVAPICH2_DIR/lib
+
+# Enable access to the package runtime applications and libraries
+if ( -e \$MVAPICH2_BIN_DIR ) then
+ _foamAddPath \$MVAPICH2_BIN_DIR
+endif
+
+if ( -e \$MVAPICH2_LIB_DIR ) then
+ _foamAddLib \$MVAPICH2_LIB_DIR
+endif
+
+setenv MPI_HOME \$MVAPICH2_DIR
+setenv MPI_ARCH_PATH \$MPI_HOME
+setenv OPAL_PREFIX \$MPI_ARCH_PATH
+
+# We initialize the rest of the environment using mpicc --showme:
+setenv MVAPICH2_INCLUDE_DIR "\`mpicc --showme:incdirs\`"
+setenv MVAPICH2_COMPILE_FLAGS "\`mpicc --showme:compile\`"
+setenv MVAPICH2_LINK_FLAGS "\`mpicc --showme:link\`"
+
+# Set the foam-extend compilation flags
+setenv PINC "\$MVAPICH2_COMPILE_FLAGS"
+setenv PLIBS "\$MVAPICH2_LINK_FLAGS"
+
+
+if (\$?FOAM_VERBOSE && \$?prompt) then
+ echo " Environment variables defined for OpenMPI:"
+ echo " MVAPICH2_BIN_DIR : \$MVAPICH2_BIN_DIR"
+ echo " MVAPICH2_LIB_DIR : \$MVAPICH2_LIB_DIR"
+ echo " MVAPICH2_INCLUDE_DIR : \$MVAPICH2_INCLUDE_DIR"
+ echo " MVAPICH2_COMPILE_FLAGS : \$MVAPICH2_COMPILE_FLAGS"
+ echo " MVAPICH2_LINK_FLAGS : \$MVAPICH2_LINK_FLAGS"
+ echo ""
+ echo " MPI_HOME : \$MPI_HOME"
+ echo " MPI_ARCH_PATH : \$MPI_ARCH_PATH"
+ echo " OPAL_PREFIX : \$OPAL_PREFIX"
+ echo " PINC : \$PINC"
+ echo " PLIBS : \$PLIBS"
+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}
diff --git a/ThirdParty/rpmBuild/SPECS/openmpi-1.8.8.spec b/ThirdParty/rpmBuild/SPECS/openmpi-1.8.8.spec
index 78530a615..913d2e1cc 100644
--- a/ThirdParty/rpmBuild/SPECS/openmpi-1.8.8.spec
+++ b/ThirdParty/rpmBuild/SPECS/openmpi-1.8.8.spec
@@ -138,7 +138,7 @@ Group: Development/Tools
--enable-orterun-prefix-by-default \
--enable-shared \
--enable-mpi-cxx \
- --disable-static \
+ --disable-static \
--disable-mpi-f77 \
--disable-mpi-f90 \
--without-slurm \
diff --git a/ThirdParty/tools/makeThirdPartyFunctionsForRPM b/ThirdParty/tools/makeThirdPartyFunctionsForRPM
index b256f3944..f2308f4e0 100755
--- a/ThirdParty/tools/makeThirdPartyFunctionsForRPM
+++ b/ThirdParty/tools/makeThirdPartyFunctionsForRPM
@@ -82,6 +82,7 @@ rpm_make()
echo "Package name : $_PACKAGE"
echo "Package URL : $_PACKAGE_URL"
echo "RPM spec file name: $_SPECFILE"
+ echo "RPM file name : $_RPMFILENAME"
echo "Additional flags : $_ADDITIONALFLAGS"
# Shift options
diff --git a/applications/solvers/coupled/MRFPorousFoam/UEqn.H b/applications/solvers/coupled/MRFPorousFoam/UEqn.H
index 80e70f3a5..c40bb8ef2 100644
--- a/applications/solvers/coupled/MRFPorousFoam/UEqn.H
+++ b/applications/solvers/coupled/MRFPorousFoam/UEqn.H
@@ -5,6 +5,9 @@
fvc::div(phi)
);
+ // Update boundary velocity for consistency with the flux
+ mrfZones.correctBoundaryVelocity(U);
+
// Momentum equation
fvVectorMatrix UEqn
(
@@ -67,28 +70,38 @@
const scalarField& V = mesh.V().field();
- // Note: this insertion should only happen in porous cell zones
- // A rewrite of the porousZones class interface is needed.
+ // Note: insertion should only happen in porous cell zones
// HJ, 14/Mar/2016
- forAll (TUIn, cellI)
+
+ register label cellI;
+
+ forAll (pZones, pZoneI)
{
- const scalar& cellV = V[cellI];
+ const labelList& curZoneCells = pZones[pZoneI].zone();
- const tensor& cellTU = TUIn[cellI];
+ // Loop over all cells in the zone
+ forAll (curZoneCells, zcI)
+ {
+ cellI = curZoneCells[zcI];
- CoeffField::squareType& cellDD = DD[cellI];
+ const scalar& cellV = V[cellI];
- cellDD(0, 0) += cellV*cellTU.xx();
- cellDD(0, 1) += cellV*cellTU.xy();
- cellDD(0, 2) += cellV*cellTU.xz();
+ const tensor& cellTU = TUIn[cellI];
- cellDD(1, 0) += cellV*cellTU.yx();
- cellDD(1, 1) += cellV*cellTU.yy();
- cellDD(2, 2) += cellV*cellTU.yz();
+ CoeffField::squareType& cellDD = DD[cellI];
- cellDD(2, 0) += cellV*cellTU.zx();
- cellDD(2, 1) += cellV*cellTU.zy();
- cellDD(2, 2) += cellV*cellTU.zz();
+ cellDD(0, 0) += cellV*cellTU.xx();
+ cellDD(0, 1) += cellV*cellTU.xy();
+ cellDD(0, 2) += cellV*cellTU.xz();
+
+ cellDD(1, 0) += cellV*cellTU.yx();
+ cellDD(1, 1) += cellV*cellTU.yy();
+ cellDD(2, 2) += cellV*cellTU.yz();
+
+ cellDD(2, 0) += cellV*cellTU.zx();
+ cellDD(2, 1) += cellV*cellTU.zy();
+ cellDD(2, 2) += cellV*cellTU.zz();
+ }
}
}
}
diff --git a/applications/solvers/incompressible/MRFSimpleFoam/MRFSimpleFoam.C b/applications/solvers/incompressible/MRFSimpleFoam/MRFSimpleFoam.C
index a17092cad..996fb9631 100644
--- a/applications/solvers/incompressible/MRFSimpleFoam/MRFSimpleFoam.C
+++ b/applications/solvers/incompressible/MRFSimpleFoam/MRFSimpleFoam.C
@@ -61,54 +61,14 @@ int main(int argc, char *argv[])
// Pressure-velocity SIMPLE corrector
{
- // Momentum predictor
-
- tmp UEqn
- (
- fvm::div(phi, U)
- + turbulence->divDevReff()
- );
- mrfZones.addCoriolis(UEqn());
-
- UEqn().relax();
-
- solve(UEqn() == -fvc::grad(p));
-
- volScalarField rAU = 1.0/UEqn().A();
- U = rAU*UEqn().H();
- UEqn.clear();
-
- phi = fvc::interpolate(U, "interpolate(HbyA)") & mesh.Sf();
- mrfZones.relativeFlux(phi);
- adjustPhi(phi, U, p);
-
- // Non-orthogonal pressure corrector loop
- while (simple.correctNonOrthogonal())
- {
- fvScalarMatrix pEqn
- (
- fvm::laplacian(rAU, p) == fvc::div(phi)
- );
-
- pEqn.setReference(pRefCell, pRefValue);
- pEqn.solve();
-
- if (simple.finalNonOrthogonalIter())
- {
- phi -= pEqn.flux();
- }
- }
-
-# include "continuityErrs.H"
-
- // Explicitly relax pressure for momentum corrector
- p.relax();
-
- // Momentum corrector
- U -= rAU*fvc::grad(p);
- U.correctBoundaryConditions();
+# include "UEqn.H"
+# include "pEqn.H"
}
+ // Calculate relative velocity
+ Urel == U;
+ mrfZones.relativeVelocity(Urel);
+
turbulence->correct();
runTime.write();
diff --git a/applications/solvers/incompressible/MRFSimpleFoam/UEqn.H b/applications/solvers/incompressible/MRFSimpleFoam/UEqn.H
new file mode 100644
index 000000000..db0cdfb73
--- /dev/null
+++ b/applications/solvers/incompressible/MRFSimpleFoam/UEqn.H
@@ -0,0 +1,19 @@
+ // Solve the momentum equation
+
+ tmp HUEqn
+ (
+ fvm::div(phi, U)
+ + turbulence->divDevReff()
+ );
+ mrfZones.addCoriolis(HUEqn());
+
+ // Get under-relaxation factor
+ const scalar UUrf = mesh.solutionDict().equationRelaxationFactor(U.name());
+
+ // Momentum solution
+ solve
+ (
+ relax(HUEqn(), UUrf)
+ ==
+ -fvc::grad(p)
+ );
diff --git a/applications/solvers/incompressible/MRFSimpleFoam/createFields.H b/applications/solvers/incompressible/MRFSimpleFoam/createFields.H
index 8ae490c37..e43f40963 100644
--- a/applications/solvers/incompressible/MRFSimpleFoam/createFields.H
+++ b/applications/solvers/incompressible/MRFSimpleFoam/createFields.H
@@ -44,3 +44,19 @@
MRFZones mrfZones(mesh);
mrfZones.correctBoundaryVelocity(U);
+
+ // Create Urel as a permanent field to make it available for on-the-fly
+ // post-processing operations
+ volVectorField Urel
+ (
+ IOobject
+ (
+ "Urel",
+ runTime.timeName(),
+ mesh,
+ IOobject::NO_READ,
+ IOobject::AUTO_WRITE
+ ),
+ U
+ );
+ mrfZones.relativeVelocity(Urel);
diff --git a/applications/solvers/incompressible/MRFSimpleFoam/pEqn.H b/applications/solvers/incompressible/MRFSimpleFoam/pEqn.H
new file mode 100644
index 000000000..1752fc663
--- /dev/null
+++ b/applications/solvers/incompressible/MRFSimpleFoam/pEqn.H
@@ -0,0 +1,50 @@
+{
+ p.boundaryField().updateCoeffs();
+
+ // Prepare clean 1/Ap without contribution from under-relaxation
+ // HJ, 26/Oct/2015
+ volScalarField rAU
+ (
+ "(1|A(U))",
+ 1/HUEqn().A()
+ );
+
+ // Store velocity under-relaxation point before using U for
+ // the flux precursor
+ U.storePrevIter();
+
+ U = rAU*HUEqn().H();
+ HUEqn.clear();
+
+ phi = fvc::interpolate(U) & mesh.Sf();
+ mrfZones.relativeFlux(phi);
+ adjustPhi(phi, U, p);
+
+ // Non-orthogonal pressure corrector loop
+ while (simple.correctNonOrthogonal())
+ {
+ fvScalarMatrix pEqn
+ (
+ fvm::laplacian(rAU, p) == fvc::div(phi)
+ );
+
+ pEqn.setReference(pRefCell, pRefValue);
+ pEqn.solve();
+
+ if (simple.finalNonOrthogonalIter())
+ {
+ phi -= pEqn.flux();
+ }
+ }
+
+# include "continuityErrs.H"
+
+ // Explicitly relax pressure for momentum corrector
+ p.relax();
+
+ // Momentum corrector
+ // Note: since under-relaxation does not change aU, H/a in U can be
+ // re-used. HJ, 22/Jan/2016
+ U = UUrf*(U - rAU*fvc::grad(p)) + (1 - UUrf)*U.prevIter();
+ U.correctBoundaryConditions();
+}
diff --git a/applications/solvers/incompressible/simpleFoam/pEqn.H b/applications/solvers/incompressible/simpleFoam/pEqn.H
index 9a1c0a4ef..aede8a3ba 100644
--- a/applications/solvers/incompressible/simpleFoam/pEqn.H
+++ b/applications/solvers/incompressible/simpleFoam/pEqn.H
@@ -1,3 +1,4 @@
+{
p.boundaryField().updateCoeffs();
// Prepare clean 1/Ap without contribution from under-relaxation
@@ -14,6 +15,7 @@
U = rUA*HUEqn().H();
HUEqn.clear();
+
phi = fvc::interpolate(U) & mesh.Sf();
adjustPhi(phi, U, p);
@@ -22,7 +24,7 @@
{
fvScalarMatrix pEqn
(
- fvm::laplacian(rUA, p) == fvc::div(phi)
+ fvm::laplacian(rAU, p) == fvc::div(phi)
);
pEqn.setReference(pRefCell, pRefValue);
@@ -43,6 +45,6 @@
// Momentum corrector
// Note: since under-relaxation does not change aU, H/a in U can be
// re-used. HJ, 22/Jan/2016
- U = UUrf*(U - rUA*fvc::grad(p)) + (1 - UUrf)*U.prevIter();
+ U = UUrf*(U - rAU*fvc::grad(p)) + (1 - UUrf)*U.prevIter();
U.correctBoundaryConditions();
-
+}
diff --git a/bin/plotForces.py b/bin/plotForces.py
index ff59ca41a..a7d779848 100755
--- a/bin/plotForces.py
+++ b/bin/plotForces.py
@@ -53,6 +53,19 @@ for i in range(1,len(t)):
my[i] += mvy[i]
mz[i] += mvz[i]
+# write clean data file
+outForces=open('forces.dat','w')
+
+for data in zip(t,fx,fy,fz):
+ outForces.write(' '.join([str(d) for d in data])+'\n')
+outForces.close()
+
+outMoments=open('moments.dat','w')
+
+for data in zip(t,mx,my,mz):
+ outMoments.write(' '.join([str(d) for d in data])+'\n')
+outMoments.close()
+
# plot forces
import pylab
pylab.xlabel('iteration')
diff --git a/bin/plotResidual.py b/bin/plotResidual.py
index 22149b34e..5122812d4 100755
--- a/bin/plotResidual.py
+++ b/bin/plotResidual.py
@@ -62,6 +62,7 @@ for line in lines:
tepsilon.append(iepsilon)
epsilon.append(float(matchepsilon.group(2)))
+# write clean data file
outfile=open('residual.dat','w')
if iomega > 0:
diff --git a/etc/settings.csh b/etc/settings.csh
index fd84b9d46..7ef3dce6e 100644
--- a/etc/settings.csh
+++ b/etc/settings.csh
@@ -300,12 +300,17 @@ case SYSTEMOPENMPI:
breaksw
case MVAPICH2:
- set mpi_version=mvapich2-2.2
- if ($?WM_THIRD_PARTY_USE_MVAPICH2_22 != 0 && -d $WM_THIRD_PARTY_DIR/packages/mvapich2-2.2/platforms/$WM_OPTIONS ) then
- if ($?FOAM_VERBOSE && $?prompt) then
- echo "Using mvapich2-2.2 from the ThirdParty package: $WM_THIRD_PARTY_DIR/packages/$mpi_version"
+ set mpi_version=mvapich2
+
+ if ($?MVAPICH2_BIN_DIR != 0) then
+ if (-d "${MVAPICH2_BIN_DIR}" ) then
+ _foamAddPath $MVAPICH2_BIN_DIR
endif
- _foamSource $WM_THIRD_PARTY_DIR/packages/$mpi_version/platforms/$WM_OPTIONS/etc/$mpi_version.csh
+ else
+ set mpicc_cmd=`which mpicc`
+ setenv MVAPICH2_BIN_DIR `dirname $mpicc_cmd`
+ unset mpicc_cmd
+ endif
setenv MPI_HOME `dirname $MVAPICH2_BIN_DIR`
setenv MPI_ARCH_PATH $MPI_HOME
@@ -571,8 +576,8 @@ endif
# zoltan
# ~~~~~
-if ( $?ZOLTAN_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_ZOLTAN_36 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/zoltan-3.6/platforms/$WM_OPTIONS ) then
- _foamSource $WM_THIRD_PARTY_DIR/packages/zoltan-3.6/platforms/$WM_OPTIONS/etc/zoltan-3.6.csh
+if ( $?ZOLTAN_SYSTEM == 0 && $?WM_THIRD_PARTY_USE_ZOLTAN_35 != 0 && -e "$WM_THIRD_PARTY_DIR"/packages/zoltan-3.5/platforms/$WM_OPTIONS ) then
+ _foamSource $WM_THIRD_PARTY_DIR/packages/zoltan-3.5/platforms/$WM_OPTIONS/etc/zoltan-3.5.csh
endif
# Python
diff --git a/etc/settings.sh b/etc/settings.sh
index eb59fa877..32c636fc8 100755
--- a/etc/settings.sh
+++ b/etc/settings.sh
@@ -375,22 +375,16 @@ SYSTEMOPENMPI)
unset mpi_version
;;
+
MVAPICH2)
- mpi_version=mvapich2
-
- if [ -n "${MVAPICH2_BIN_DIR}" ] && [ -d "${MVAPICH2_BIN_DIR}" ]
- then
- _foamAddPath $MVAPICH2_BIN_DIR
- else
- MVAPICH2_BIN_DIR=$(dirname `which mpicc`)
- fi
-
- if which mpicc >/dev/null
- then
- mpicc -v 2>/dev/null | grep -q "mpicc for MVAPICH2" ||
- echo "Warning: `which mpicc` does not appear to be for MVAPICH2"
- else
- echo "Warning: mpicc not available"
+ mpi_version=mvapich2-2.2
+ if [ ! -z $WM_THIRD_PARTY_USE_MVAPICH2_20 ] && [ -e $WM_THIRD_PARTY_DIR/packages/mvapich2-2.2/platforms/$WM_OPTIONS ]
+ then
+ if [ "$FOAM_VERBOSE" -a "$PS1" ]
+ then
+ echo "Using mvapich2 from the ThirdParty package: $WM_THIRD_PARTY_DIR/packages/$mpi_version"
+ fi
+ _foamSource $WM_THIRD_PARTY_DIR/packages/$mpi_version/platforms/$WM_OPTIONS/etc/$mpi_version.sh
fi
export MPI_HOME=`dirname $MVAPICH2_BIN_DIR`
diff --git a/src/finiteArea/Make/files b/src/finiteArea/Make/files
index 6cd6d6288..9e8ffce86 100644
--- a/src/finiteArea/Make/files
+++ b/src/finiteArea/Make/files
@@ -48,6 +48,8 @@ derivedFaPatchFields = $(faPatchFields)/derived
$(derivedFaPatchFields)/fixedValueOutflow/fixedValueOutflowFaPatchFields.C
$(derivedFaPatchFields)/inletOutlet/inletOutletFaPatchFields.C
$(derivedFaPatchFields)/slip/slipFaPatchFields.C
+$(derivedFaPatchFields)/edgeNormalFixedValue/edgeNormalFixedValueFaPatchVectorField.C
+$(derivedFaPatchFields)/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchFields.C
faePatchFields = fields/faePatchFields
$(faePatchFields)/faePatchField/faePatchFields.C
@@ -92,6 +94,7 @@ $(ddtSchemes)/backwardFaDdtScheme/backwardFaDdtSchemes.C
$(ddtSchemes)/boundedBackwardFaDdtScheme/boundedBackwardFaDdtScheme.C
divSchemes = finiteArea/divSchemes
+finiteArea/fam/vectorFamDiv.C
$(divSchemes)/faDivScheme/faDivSchemes.C
$(divSchemes)/gaussFaDivScheme/gaussFaDivSchemes.C
diff --git a/src/finiteArea/faMesh/faMesh.C b/src/finiteArea/faMesh/faMesh.C
index 481ccaf35..1c1ab187b 100644
--- a/src/finiteArea/faMesh/faMesh.C
+++ b/src/finiteArea/faMesh/faMesh.C
@@ -1047,6 +1047,18 @@ void Foam::faMesh::addFaPatches(const List& p)
}
+Foam::label Foam::faMesh::comm() const
+{
+ return comm_;
+}
+
+
+Foam::label& Foam::faMesh::comm()
+{
+ return comm_;
+}
+
+
const Foam::objectRegistry& Foam::faMesh::thisDb() const
{
return mesh().thisDb();
diff --git a/src/finiteArea/faMesh/faMesh.H b/src/finiteArea/faMesh/faMesh.H
index 8f340701b..89f81abec 100644
--- a/src/finiteArea/faMesh/faMesh.H
+++ b/src/finiteArea/faMesh/faMesh.H
@@ -110,6 +110,12 @@ class faMesh
mutable label nFaces_;
+ // Communication support
+
+ //- Communicator used for parallel communication
+ label comm_;
+
+
// Demand-driven data
//- Primitive patch
@@ -287,9 +293,8 @@ public:
);
- // Destructor
-
- virtual ~faMesh();
+ //- Destructor
+ virtual ~faMesh();
// Member Functions
@@ -369,6 +374,15 @@ public:
}
+ // Communication support
+
+ //- Return communicator used for parallel communication
+ label comm() const;
+
+ //- Return communicator used for parallel communication
+ label& comm();
+
+
// Access
//- Return reference to the mesh database
diff --git a/src/finiteArea/faMesh/faPatches/constraint/processor/processorFaPatch.C b/src/finiteArea/faMesh/faPatches/constraint/processor/processorFaPatch.C
index 050f763d1..08c4809bb 100644
--- a/src/finiteArea/faMesh/faPatches/constraint/processor/processorFaPatch.C
+++ b/src/finiteArea/faMesh/faPatches/constraint/processor/processorFaPatch.C
@@ -55,6 +55,18 @@ processorFaPatch::~processorFaPatch()
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
+Foam::label Foam::processorFaPatch::comm() const
+{
+ return boundaryMesh().mesh().comm();
+}
+
+
+int Foam::processorFaPatch::tag() const
+{
+ return Pstream::msgType();
+}
+
+
void processorFaPatch::makeNonGlobalPatchPoints() const
{
// If it is not runing parallel or there are no global points
diff --git a/src/finiteArea/faMesh/faPatches/constraint/processor/processorFaPatch.H b/src/finiteArea/faMesh/faPatches/constraint/processor/processorFaPatch.H
index 6939342aa..0f0c96d81 100644
--- a/src/finiteArea/faMesh/faPatches/constraint/processor/processorFaPatch.H
+++ b/src/finiteArea/faMesh/faPatches/constraint/processor/processorFaPatch.H
@@ -37,7 +37,6 @@ SourceFiles
#include "coupledFaPatch.H"
#include "processorLduInterface.H"
-// #include "processorPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -55,7 +54,10 @@ class processorFaPatch
{
// Private data
+ //- My processro number
int myProcNo_;
+
+ //- Neighbour processor number
int neighbProcNo_;
//- Processor-neighbbour patch edge centres
@@ -75,6 +77,7 @@ class processorFaPatch
// non-global, i.e. present in this processor patch
mutable labelList* nonGlobalPatchPointsPtr_;
+
protected:
// Protected Member functions
@@ -88,27 +91,27 @@ protected:
//- Find non-globa patch points
void makeNonGlobalPatchPoints() const;
-protected:
- // Protected Member functions
+ // Geometry functions
- //- Initialise the calculation of the patch geometry
- void initGeometry();
+ //- Initialise the calculation of the patch geometry
+ void initGeometry();
- //- Calculate the patch geometry
- void calcGeometry();
+ //- Calculate the patch geometry
+ void calcGeometry();
- //- Initialise the patches for moving points
- void initMovePoints(const pointField&);
+ //- Initialise the patches for moving points
+ void initMovePoints(const pointField&);
- //- Correct patches after moving points
- void movePoints(const pointField&);
+ //- Correct patches after moving points
+ void movePoints(const pointField&);
- //- Initialise the update of the patch topology
- virtual void initUpdateMesh();
+ //- Initialise the update of the patch topology
+ virtual void initUpdateMesh();
+
+ //- Update of the patch topology
+ virtual void updateMesh();
- //- Update of the patch topology
- virtual void updateMesh();
public:
@@ -160,9 +163,9 @@ public:
nonGlobalPatchPointsPtr_(NULL)
{}
- // Destructor
- virtual ~processorFaPatch();
+ //- Destructor
+ virtual ~processorFaPatch();
// Member functions
@@ -192,6 +195,16 @@ public:
}
}
+
+ // Communications support
+
+ //- Return communicator used for communication
+ virtual label comm() const;
+
+ //- Return message tag to use for communication
+ virtual int tag() const;
+
+
//- Return face transformation tensor
virtual const tensorField& forwardT() const
{
diff --git a/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchFields.C b/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchFields.C
index 2c808f7bd..24e9fbfc8 100644
--- a/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchFields.C
+++ b/src/finiteArea/fields/faPatchFields/basic/transform/transformFaPatchFields.C
@@ -28,7 +28,6 @@ Description
#include "faPatchFields.H"
#include "transformFaPatchFields.H"
#include "addToRunTimeSelectionTable.H"
-// #include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -37,10 +36,6 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
-// defineNamedTemplateTypeNameAndDebug(transformFaPatchScalarField, 0);
-// defineNamedTemplateTypeNameAndDebug(transformFaPatchVectorField, 0);
-// defineNamedTemplateTypeNameAndDebug(transformFaPatchTensorField, 0);
-
makeFaPatchFieldsTypeName(transform);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.C b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.C
index 4e155a0a6..3537b4c27 100644
--- a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.C
+++ b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchField.C
@@ -176,7 +176,7 @@ void processorFaPatchField::initEvaluate
{
if (Pstream::parRun())
{
- procPatch_.compressedSend(commsType, this->patchInternalField()());
+ procPatch_.send(commsType, this->patchInternalField()());
}
}
@@ -189,7 +189,7 @@ void processorFaPatchField::evaluate
{
if (Pstream::parRun())
{
- procPatch_.compressedReceive(commsType, *this);
+ procPatch_.receive(commsType, *this);
if (doTransform())
{
@@ -218,7 +218,7 @@ void processorFaPatchField::initInterfaceMatrixUpdate
const bool switchToLhs
) const
{
- procPatch_.compressedSend
+ procPatch_.send
(
commsType,
this->patch().patchInternalField(psiInternal)()
@@ -240,7 +240,7 @@ void processorFaPatchField::updateInterfaceMatrix
{
scalarField pnf
(
- procPatch_.compressedReceive(commsType, this->size())()
+ procPatch_.receive(commsType, this->size())()
);
// Transform according to the transformation tensor
diff --git a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchScalarField.C b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchScalarField.C
index 11be0915b..fe5b4dc27 100644
--- a/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchScalarField.C
+++ b/src/finiteArea/fields/faPatchFields/constraint/processor/processorFaPatchScalarField.C
@@ -52,7 +52,7 @@ void processorFaPatchField::initInterfaceMatrixUpdate
const bool switchToLhs
) const
{
- procPatch_.compressedSend
+ procPatch_.send
(
commsType,
patch().patchInternalField(psiInternal)()
@@ -74,7 +74,7 @@ void processorFaPatchField::updateInterfaceMatrix
{
scalarField pnf
(
- procPatch_.compressedReceive(commsType, this->size())()
+ procPatch_.receive(commsType, this->size())()
);
const unallocLabelList& edgeFaces = patch().edgeFaces();
diff --git a/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchFields.C b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchFields.C
index b67ab97c2..be4183c9a 100644
--- a/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchFields.C
+++ b/src/finiteArea/fields/faPatchFields/constraint/wedge/wedgeFaPatchFields.C
@@ -28,7 +28,6 @@ Description
#include "faPatchFields.H"
#include "wedgeFaPatchFields.H"
#include "addToRunTimeSelectionTable.H"
-// #include "volFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -37,10 +36,6 @@ namespace Foam
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
-// defineNamedTemplateTypeNameAndDebug(wedgeFaPatchScalarField, 0);
-// defineNamedTemplateTypeNameAndDebug(wedgeFaPatchVectorField, 0);
-// defineNamedTemplateTypeNameAndDebug(wedgeFaPatchTensorField, 0);
-
makeFaPatchFields(wedge);
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/finiteArea/fields/faPatchFields/derived/edgeNormalFixedValue/edgeNormalFixedValueFaPatchVectorField.C b/src/finiteArea/fields/faPatchFields/derived/edgeNormalFixedValue/edgeNormalFixedValueFaPatchVectorField.C
new file mode 100644
index 000000000..bc0a93108
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/derived/edgeNormalFixedValue/edgeNormalFixedValueFaPatchVectorField.C
@@ -0,0 +1,155 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "edgeNormalFixedValueFaPatchVectorField.H"
+#include "addToRunTimeSelectionTable.H"
+#include "areaFields.H"
+#include "faPatchFieldMapper.H"
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+Foam::edgeNormalFixedValueFaPatchVectorField::
+edgeNormalFixedValueFaPatchVectorField
+(
+ const faPatch& p,
+ const DimensionedField& iF
+)
+:
+ fixedValueFaPatchVectorField(p, iF),
+ refValue_(p.size(), 0)
+{}
+
+
+Foam::edgeNormalFixedValueFaPatchVectorField::
+edgeNormalFixedValueFaPatchVectorField
+(
+ const edgeNormalFixedValueFaPatchVectorField& ptf,
+ const faPatch& p,
+ const DimensionedField& iF,
+ const faPatchFieldMapper& mapper
+)
+:
+ fixedValueFaPatchVectorField(ptf, p, iF, mapper),
+ refValue_(ptf.refValue_, mapper)
+{}
+
+
+Foam::edgeNormalFixedValueFaPatchVectorField::
+edgeNormalFixedValueFaPatchVectorField
+(
+ const faPatch& p,
+ const DimensionedField& iF,
+ const dictionary& dict
+)
+:
+ fixedValueFaPatchVectorField(p, iF, dict),
+ refValue_("refValue", dict, p.size())
+{}
+
+
+Foam::edgeNormalFixedValueFaPatchVectorField::
+edgeNormalFixedValueFaPatchVectorField
+(
+ const edgeNormalFixedValueFaPatchVectorField& pivpvf
+)
+:
+ fixedValueFaPatchVectorField(pivpvf),
+ refValue_(pivpvf.refValue_)
+{}
+
+
+Foam::edgeNormalFixedValueFaPatchVectorField::
+edgeNormalFixedValueFaPatchVectorField
+(
+ const edgeNormalFixedValueFaPatchVectorField& pivpvf,
+ const DimensionedField& iF
+)
+:
+ fixedValueFaPatchVectorField(pivpvf, iF),
+ refValue_(pivpvf.refValue_)
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+void Foam::edgeNormalFixedValueFaPatchVectorField::autoMap
+(
+ const faPatchFieldMapper& m
+)
+{
+ fixedValueFaPatchVectorField::autoMap(m);
+ refValue_.autoMap(m);
+}
+
+
+void Foam::edgeNormalFixedValueFaPatchVectorField::rmap
+(
+ const faPatchVectorField& ptf,
+ const labelList& addr
+)
+{
+ fixedValueFaPatchVectorField::rmap(ptf, addr);
+
+ const edgeNormalFixedValueFaPatchVectorField& tiptf =
+ refCast(ptf);
+
+ refValue_.rmap(tiptf.refValue_, addr);
+}
+
+
+void Foam::edgeNormalFixedValueFaPatchVectorField::updateCoeffs()
+{
+ if (updated())
+ {
+ return;
+ }
+
+ // Bug fix: update for moving mesh. HJ, 15/Oct/2010
+ operator==(refValue_*patch().edgeNormals());
+}
+
+
+void Foam::edgeNormalFixedValueFaPatchVectorField::write(Ostream& os) const
+{
+ fixedValueFaPatchVectorField::write(os);
+ refValue_.writeEntry("refValue", os);
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+makeFaPatchTypeField
+(
+ faPatchVectorField,
+ edgeNormalFixedValueFaPatchVectorField
+);
+
+} // End namespace Foam
+
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/derived/edgeNormalFixedValue/edgeNormalFixedValueFaPatchVectorField.H b/src/finiteArea/fields/faPatchFields/derived/edgeNormalFixedValue/edgeNormalFixedValueFaPatchVectorField.H
new file mode 100644
index 000000000..0cf215d73
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/derived/edgeNormalFixedValue/edgeNormalFixedValueFaPatchVectorField.H
@@ -0,0 +1,173 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+Class
+ Foam::edgeNormalFixedValueFaPatchVectorField
+
+Description
+ Edge normal fixed value vector field finite area boundary condition
+
+ Describes a surface normal vector boundary condition by its magnitude.
+ Note: The value is positive for outward-pointing vectors
+
+SourceFiles
+ edgeNormalFixedValueFaPatchVectorField.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef edgeNormalFixedValueFaPatchVectorField_H
+#define edgeNormalFixedValueFaPatchVectorField_H
+
+#include "faPatchFields.H"
+#include "fixedValueFaPatchFields.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class edgeNormalFixedValueFaPatch Declaration
+\*---------------------------------------------------------------------------*/
+
+class edgeNormalFixedValueFaPatchVectorField
+:
+ public fixedValueFaPatchVectorField
+{
+ // Private data
+
+ //- Surface-normal velocity value
+ scalarField refValue_;
+
+
+public:
+
+ //- Runtime type information
+ TypeName("edgeNormalFixedValue");
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ edgeNormalFixedValueFaPatchVectorField
+ (
+ const faPatch&,
+ const DimensionedField&
+ );
+
+ //- Construct from patch, internal field and dictionary
+ edgeNormalFixedValueFaPatchVectorField
+ (
+ const faPatch&,
+ const DimensionedField&,
+ const dictionary&
+ );
+
+ //- Construct by mapping given
+ // edgeNormalFixedValueFaPatchVectorField
+ // onto a new patch
+ edgeNormalFixedValueFaPatchVectorField
+ (
+ const edgeNormalFixedValueFaPatchVectorField&,
+ const faPatch&,
+ const DimensionedField&,
+ const faPatchFieldMapper&
+ );
+
+ //- Construct as copy
+ edgeNormalFixedValueFaPatchVectorField
+ (
+ const edgeNormalFixedValueFaPatchVectorField&
+ );
+
+ //- Construct and return a clone
+ virtual tmp clone() const
+ {
+ return tmp
+ (
+ new edgeNormalFixedValueFaPatchVectorField(*this)
+ );
+ }
+
+ //- Construct as copy setting internal field reference
+ edgeNormalFixedValueFaPatchVectorField
+ (
+ const edgeNormalFixedValueFaPatchVectorField&,
+ const DimensionedField&
+ );
+
+ //- Construct and return a clone setting internal field reference
+ virtual tmp clone
+ (
+ const DimensionedField& iF
+ ) const
+ {
+ return tmp
+ (
+ new edgeNormalFixedValueFaPatchVectorField
+ (
+ *this,
+ iF
+ )
+ );
+ }
+
+
+
+ // Member functions
+
+ // Mapping functions
+
+ //- Map (and resize as needed) from self given a mapping object
+ virtual void autoMap
+ (
+ const faPatchFieldMapper&
+ );
+
+ //- Reverse map the given faPatchField onto this faPatchField
+ virtual void rmap
+ (
+ const faPatchVectorField&,
+ const labelList&
+ );
+
+
+ // Member functions
+
+ //- Update the coefficients associated with the patch field
+ virtual void updateCoeffs();
+
+ //- Write
+ virtual void write(Ostream&) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchField.C b/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchField.C
new file mode 100644
index 000000000..cb2b83c26
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchField.C
@@ -0,0 +1,137 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "timeVaryingUniformFixedValueFaPatchField.H"
+#include "foamTime.H"
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+template
+Foam::timeVaryingUniformFixedValueFaPatchField::
+timeVaryingUniformFixedValueFaPatchField
+(
+ const faPatch& p,
+ const DimensionedField& iF
+)
+:
+ fixedValueFaPatchField(p, iF),
+ timeSeries_()
+{}
+
+
+template
+Foam::timeVaryingUniformFixedValueFaPatchField::
+timeVaryingUniformFixedValueFaPatchField
+(
+ const faPatch& p,
+ const DimensionedField& iF,
+ const dictionary& dict
+)
+:
+ fixedValueFaPatchField(p, iF),
+ timeSeries_(dict)
+{
+ if (dict.found("value"))
+ {
+ faPatchField::operator==(Field("value", dict, p.size()));
+ }
+ else
+ {
+ updateCoeffs();
+ }
+}
+
+
+template
+Foam::timeVaryingUniformFixedValueFaPatchField::
+timeVaryingUniformFixedValueFaPatchField
+(
+ const timeVaryingUniformFixedValueFaPatchField& ptf,
+ const faPatch& p,
+ const DimensionedField& iF,
+ const faPatchFieldMapper& mapper
+)
+:
+ fixedValueFaPatchField(ptf, p, iF, mapper),
+ timeSeries_(ptf.timeSeries_)
+{}
+
+
+template
+Foam::timeVaryingUniformFixedValueFaPatchField::
+timeVaryingUniformFixedValueFaPatchField
+(
+ const timeVaryingUniformFixedValueFaPatchField& ptf
+)
+:
+ fixedValueFaPatchField(ptf),
+ timeSeries_(ptf.timeSeries_)
+{}
+
+
+template
+Foam::timeVaryingUniformFixedValueFaPatchField::
+timeVaryingUniformFixedValueFaPatchField
+(
+ const timeVaryingUniformFixedValueFaPatchField& ptf,
+ const DimensionedField& iF
+)
+:
+ fixedValueFaPatchField(ptf, iF),
+ timeSeries_(ptf.timeSeries_)
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+template
+void Foam::timeVaryingUniformFixedValueFaPatchField::updateCoeffs()
+{
+ if (this->updated())
+ {
+ return;
+ }
+
+ faPatchField::operator==
+ (
+ timeSeries_(this->db().time().timeOutputValue())
+ );
+ fixedValueFaPatchField::updateCoeffs();
+}
+
+
+template
+void Foam::timeVaryingUniformFixedValueFaPatchField::write
+(
+ Ostream& os
+) const
+{
+ faPatchField::write(os);
+ timeSeries_.write(os);
+ this->writeEntry("value", os);
+}
+
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchField.H b/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchField.H
new file mode 100644
index 000000000..b59f386c4
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchField.H
@@ -0,0 +1,182 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+Class
+ Foam::timeVaryingUniformFixedValueFaPatchField
+
+Description
+ A time-varying form of a uniform fixed value finite area
+ boundary condition.
+
+ Example of the boundary condition specification:
+ @verbatim
+ inlet
+ {
+ type timeVaryingUniformFixedValue;
+ fileName "$FOAM_CASE/time-series";
+ outOfBounds clamp; // (error|warn|clamp|repeat)
+ }
+ @endverbatim
+
+Note
+ This class is derived directly from a fixedValue patch rather than from
+ a uniformFixedValue patch.
+
+See Also
+ Foam::interpolationTable and Foam::fixedValueFaPatchField
+
+SourceFiles
+ timeVaryingUniformFixedValueFaPatchField.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef timeVaryingUniformFixedValueFaPatchField_H
+#define timeVaryingUniformFixedValueFaPatchField_H
+
+#include "fixedValueFaPatchField.H"
+#include "interpolationTable.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Class timeVaryingUniformFixedValueFaPatch Declaration
+\*---------------------------------------------------------------------------*/
+
+template
+class timeVaryingUniformFixedValueFaPatchField
+:
+ public fixedValueFaPatchField
+{
+ // Private data
+
+ //- The time series being used, including the bounding treatment
+ interpolationTable timeSeries_;
+
+
+public:
+
+ //- Runtime type information
+ TypeName("timeVaryingUniformFixedValue");
+
+
+ // Constructors
+
+ //- Construct from patch and internal field
+ timeVaryingUniformFixedValueFaPatchField
+ (
+ const faPatch&,
+ const DimensionedField&
+ );
+
+ //- Construct from patch, internal field and dictionary
+ timeVaryingUniformFixedValueFaPatchField
+ (
+ const faPatch&,
+ const DimensionedField&,
+ const dictionary&
+ );
+
+ //- Construct by mapping given patch field onto a new patch
+ timeVaryingUniformFixedValueFaPatchField
+ (
+ const timeVaryingUniformFixedValueFaPatchField&,
+ const faPatch&,
+ const DimensionedField&,
+ const faPatchFieldMapper&
+ );
+
+ //- Construct as copy
+ timeVaryingUniformFixedValueFaPatchField
+ (
+ const timeVaryingUniformFixedValueFaPatchField&
+ );
+
+ //- Construct and return a clone
+ virtual tmp > clone() const
+ {
+ return tmp >
+ (
+ new timeVaryingUniformFixedValueFaPatchField(*this)
+ );
+ }
+
+ //- Construct as copy setting internal field reference
+ timeVaryingUniformFixedValueFaPatchField
+ (
+ const timeVaryingUniformFixedValueFaPatchField&,
+ const DimensionedField&
+ );
+
+ //- Construct and return a clone setting internal field reference
+ virtual tmp > clone
+ (
+ const DimensionedField& iF
+ ) const
+ {
+ return tmp >
+ (
+ new timeVaryingUniformFixedValueFaPatchField(*this, iF)
+ );
+ }
+
+
+ // Member functions
+
+ // Access
+
+ //- Return the time series used
+ const interpolationTable& timeSeries() const
+ {
+ return timeSeries_;
+ }
+
+
+ // Evaluation functions
+
+ //- Update the coefficients associated with the patch field
+ virtual void updateCoeffs();
+
+
+ //- Write
+ virtual void write(Ostream&) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+# include "timeVaryingUniformFixedValueFaPatchField.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/foam/db/IOstreams/Pstreams/PstreamsPrint.C b/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchFields.C
similarity index 76%
rename from src/foam/db/IOstreams/Pstreams/PstreamsPrint.C
rename to src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchFields.C
index ac0fdf58c..0610f7e76 100644
--- a/src/foam/db/IOstreams/Pstreams/PstreamsPrint.C
+++ b/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchFields.C
@@ -21,28 +21,23 @@ License
You should have received a copy of the GNU General Public License
along with foam-extend. If not, see .
-Description
- Prints out a description of the streams
-
\*---------------------------------------------------------------------------*/
-#include "IPstream.H"
-#include "OPstream.H"
+#include "timeVaryingUniformFixedValueFaPatchFields.H"
+#include "addToRunTimeSelectionTable.H"
+#include "areaFields.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
-void Foam::IPstream::print(Ostream& os) const
+namespace Foam
{
- os << "Reading from processor " << fromProcNo_
- << " to processor " << myProcNo() << Foam::endl;
-}
+// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
-void Foam::OPstream::print(Ostream& os) const
-{
- os << "Writing from processor " << toProcNo_
- << " to processor " << myProcNo() << Foam::endl;
-}
+makeFaPatchFields(timeVaryingUniformFixedValue);
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchFields.H b/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchFields.H
new file mode 100644
index 000000000..71f70dd63
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchFields.H
@@ -0,0 +1,49 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef timeVaryingUniformFixedValueFaPatchFields_H
+#define timeVaryingUniformFixedValueFaPatchFields_H
+
+#include "timeVaryingUniformFixedValueFaPatchField.H"
+#include "fieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+makeFaPatchTypeFieldTypedefs(timeVaryingUniformFixedValue)
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchFieldsFwd.H b/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchFieldsFwd.H
new file mode 100644
index 000000000..2a8360f27
--- /dev/null
+++ b/src/finiteArea/fields/faPatchFields/derived/timeVaryingUniformFixedValue/timeVaryingUniformFixedValueFaPatchFieldsFwd.H
@@ -0,0 +1,51 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 4.0
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef timeVaryingUniformFixedValueFaPatchFieldsFwd_H
+#define timeVaryingUniformFixedValueFaPatchFieldsFwd_H
+
+#include "faPatchField.H"
+#include "fieldTypes.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template class timeVaryingUniformFixedValueFaPatchField;
+
+makeFaPatchTypeFieldTypedefs(timeVaryingUniformFixedValue);
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchField.H b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchField.H
index dc8fefadd..018b276ac 100644
--- a/src/finiteArea/fields/faPatchFields/faPatchField/faPatchField.H
+++ b/src/finiteArea/fields/faPatchFields/faPatchField/faPatchField.H
@@ -468,60 +468,87 @@ public:
#endif
-#define makeFaPatchTypeFieldTypeName(typePatchTypeField) \
- \
-defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0);
-
-#define makeFaPatchFieldsTypeName(typePatchField) \
- \
-makeFaPatchTypeFieldTypeName(typePatchField##FaPatchScalarField); \
-makeFaPatchTypeFieldTypeName(typePatchField##FaPatchVectorField); \
-makeFaPatchTypeFieldTypeName(typePatchField##FaPatchSphericalTensorField); \
-makeFaPatchTypeFieldTypeName(typePatchField##FaPatchSymmTensorField); \
-makeFaPatchTypeFieldTypeName(typePatchField##FaPatchTensorField);
-
-#define makeFaPatchTypeField(PatchTypeField, typePatchTypeField) \
- \
-defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \
- \
-addToRunTimeSelectionTable \
-( \
- PatchTypeField, typePatchTypeField, patch \
-); \
- \
-addToRunTimeSelectionTable \
-( \
- PatchTypeField, \
- typePatchTypeField, \
- patchMapper \
-); \
- \
-addToRunTimeSelectionTable \
-( \
- PatchTypeField, typePatchTypeField, dictionary \
+#define addToFaPatchFieldRunTimeSelection(PatchTypeField, typePatchTypeField) \
+ \
+addToRunTimeSelectionTable \
+( \
+ PatchTypeField, typePatchTypeField, patch \
+); \
+ \
+addToRunTimeSelectionTable \
+( \
+ PatchTypeField, \
+ typePatchTypeField, \
+ patchMapper \
+); \
+ \
+addToRunTimeSelectionTable \
+( \
+ PatchTypeField, typePatchTypeField, dictionary \
);
-#define makeFaPatchFields(type) \
- \
-makeFaPatchTypeField(faPatchScalarField, type##FaPatchScalarField); \
-makeFaPatchTypeField(faPatchVectorField, type##FaPatchVectorField); \
-makeFaPatchTypeField \
-( \
- faPatchSphericalTensorField, \
- type##FaPatchSphericalTensorField \
-); \
-makeFaPatchTypeField(faPatchSymmTensorField, type##FaPatchSymmTensorField);\
-makeFaPatchTypeField(faPatchTensorField, type##FaPatchTensorField);
+#define makeFaPatchTypeFieldTypeName(typePatchTypeField) \
+ \
+defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0);
-#define makeFaPatchTypeFieldTypedefs(type) \
- \
-typedef type##FaPatchField type##FaPatchScalarField; \
-typedef type##FaPatchField type##FaPatchVectorField; \
-typedef type##FaPatchField \
- type##FaPatchSphericalTensorField; \
-typedef type##FaPatchField type##FaPatchSymmTensorField; \
+#define makeFaPatchFieldsTypeName(typePatchField) \
+ \
+makeFaPatchTypeFieldTypeName(typePatchField##FaPatchScalarField); \
+makeFaPatchTypeFieldTypeName(typePatchField##FaPatchVectorField); \
+makeFaPatchTypeFieldTypeName(typePatchField##FaPatchSphericalTensorField); \
+makeFaPatchTypeFieldTypeName(typePatchField##FaPatchSymmTensorField); \
+makeFaPatchTypeFieldTypeName(typePatchField##FaPatchTensorField);
+
+
+#define makeFaPatchTypeField(PatchTypeField, typePatchTypeField) \
+ \
+defineTypeNameAndDebug(typePatchTypeField, 0); \
+ \
+addToFaPatchFieldRunTimeSelection \
+( \
+ PatchTypeField, typePatchTypeField \
+);
+
+#define makeTemplateFaPatchTypeField(PatchTypeField, typePatchTypeField) \
+ \
+defineNamedTemplateTypeNameAndDebug(typePatchTypeField, 0); \
+ \
+addToFaPatchFieldRunTimeSelection \
+( \
+ PatchTypeField, typePatchTypeField \
+);
+
+
+#define makeFaPatchFields(type) \
+ \
+makeTemplateFaPatchTypeField(faPatchScalarField, type##FaPatchScalarField); \
+makeTemplateFaPatchTypeField(faPatchVectorField, type##FaPatchVectorField); \
+makeTemplateFaPatchTypeField \
+( \
+ faPatchSphericalTensorField, \
+ type##FaPatchSphericalTensorField \
+); \
+makeTemplateFaPatchTypeField \
+( \
+ faPatchSymmTensorField, \
+ type##FaPatchSymmTensorField \
+); \
+makeTemplateFaPatchTypeField \
+( \
+ faPatchTensorField, \
+ type##FaPatchTensorField \
+);
+
+
+#define makeFaPatchTypeFieldTypedefs(type) \
+ \
+typedef type##FaPatchField type##FaPatchScalarField; \
+typedef type##FaPatchField type##FaPatchVectorField; \
+typedef type##FaPatchField \
+ type##FaPatchSphericalTensorField; \
+typedef type##FaPatchField type##FaPatchSymmTensorField; \
typedef type##FaPatchField type##FaPatchTensorField;
diff --git a/src/finiteArea/finiteArea/divSchemes/gaussFaDivScheme/gaussFaDivScheme.C b/src/finiteArea/finiteArea/divSchemes/gaussFaDivScheme/gaussFaDivScheme.C
index c4d43aefc..802b543e0 100644
--- a/src/finiteArea/finiteArea/divSchemes/gaussFaDivScheme/gaussFaDivScheme.C
+++ b/src/finiteArea/finiteArea/divSchemes/gaussFaDivScheme/gaussFaDivScheme.C
@@ -62,7 +62,7 @@ gaussDivScheme::facDiv
(
this->mesh_.Le() & this->tinterpScheme_().interpolate(vf)
)
- - this->mesh_.faceCurvatures()*(this->mesh_.faceAreaNormals()&vf)
+ // Removed for consistencty. Matthias Rauter, 6/Dec/2016
);
tDiv().rename("div(" + vf.name() + ')');
diff --git a/src/finiteArea/finiteArea/fac/fac.H b/src/finiteArea/finiteArea/fac/fac.H
index ce5e382b9..2b17490bc 100644
--- a/src/finiteArea/finiteArea/fac/fac.H
+++ b/src/finiteArea/finiteArea/fac/fac.H
@@ -43,6 +43,8 @@ Description
#include "facAverage.H"
#include "facLnGrad.H"
#include "facDdt.H"
+#include "facNGrad.H"
+#include "facNDiv.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
diff --git a/src/finiteArea/finiteArea/fac/facDiv.C b/src/finiteArea/finiteArea/fac/facDiv.C
index cc72a13d9..e5f04f9d9 100644
--- a/src/finiteArea/finiteArea/fac/facDiv.C
+++ b/src/finiteArea/finiteArea/fac/facDiv.C
@@ -28,6 +28,7 @@ License
#include "facEdgeIntegrate.H"
#include "faDivScheme.H"
#include "faConvectionScheme.H"
+#include "transformField.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@@ -48,7 +49,17 @@ div
const GeometricField& ssf
)
{
- return fac::edgeIntegrate(ssf);
+ const areaVectorField& n = ssf.mesh().faceAreaNormals();
+
+ tmp > tDiv =
+ fac::edgeIntegrate(ssf);
+
+ GeometricField& Div = tDiv();
+
+ Div.internalField() = transform(tensor::I - sqr(n), Div.internalField());
+ Div.correctBoundaryConditions();
+
+ return tDiv;
}
@@ -79,10 +90,34 @@ div
const word& name
)
{
- return fa::divScheme::New
+ const areaVectorField& n = vf.mesh().faceAreaNormals();
+
+ tmp
+ <
+ GeometricField
+ <
+ typename innerProduct::type,
+ faPatchField,
+ areaMesh
+ >
+ > tDiv
(
- vf.mesh(), vf.mesh().schemesDict().divScheme(name)
- )().facDiv(vf);
+ fa::divScheme::New
+ (
+ vf.mesh(), vf.mesh().schemesDict().divScheme(name)
+ )().facDiv(vf)
+ );
+ GeometricField
+ <
+ typename innerProduct::type,
+ faPatchField,
+ areaMesh
+ >& Div = tDiv();
+
+ Div.internalField() = transform(tensor::I - sqr(n), Div.internalField());
+ Div.correctBoundaryConditions();
+
+ return tDiv;
}
@@ -159,12 +194,24 @@ div
const word& name
)
{
- return fa::convectionScheme::New
+ const areaVectorField& n = vf.mesh().faceAreaNormals();
+
+ tmp > tDiv
(
- vf.mesh(),
- flux,
- vf.mesh().schemesDict().divScheme(name)
- )().facDiv(flux, vf);
+ fa::convectionScheme::New
+ (
+ vf.mesh(),
+ flux,
+ vf.mesh().schemesDict().divScheme(name)
+ )().facDiv(flux, vf)
+ );
+ GeometricField& Div = tDiv();
+
+ Div.internalField() = transform(tensor::I - sqr(n), Div.internalField());
+ Div.correctBoundaryConditions();
+
+ return tDiv;
+
}
diff --git a/src/finiteArea/finiteArea/fac/facGrad.C b/src/finiteArea/finiteArea/fac/facGrad.C
index e7c3b5e88..568f4c2b6 100644
--- a/src/finiteArea/finiteArea/fac/facGrad.C
+++ b/src/finiteArea/finiteArea/fac/facGrad.C
@@ -55,7 +55,18 @@ grad
const GeometricField& ssf
)
{
- return fac::edgeIntegrate(ssf.mesh().Sf() * ssf);
+ const areaVectorField &n = ssf.mesh().faceAreaNormals();
+ typedef typename outerProduct::type GradType;
+
+ tmp > tgGrad =
+ fac::edgeIntegrate(ssf.mesh().Sf()*ssf);
+
+ GeometricField& gGrad = tgGrad();
+
+ gGrad -= (gGrad & n)*n;
+ gGrad.correctBoundaryConditions();
+
+ return tgGrad;
}
template
@@ -95,11 +106,22 @@ grad
const word& name
)
{
- return fa::gradScheme::New
- (
- vf.mesh(),
- vf.mesh().schemesDict().gradScheme(name)
- )().grad(vf);
+ const areaVectorField &n = vf.mesh().faceAreaNormals();
+ typedef typename outerProduct::type GradType;
+
+ tmp > tgGrad =
+ fa::gradScheme::New
+ (
+ vf.mesh(),
+ vf.mesh().schemesDict().gradScheme(name)
+ )().grad(vf);
+
+ GeometricField& gGrad = tgGrad();
+
+ gGrad -= (gGrad & n)*n;
+ gGrad.correctBoundaryConditions();
+
+ return tgGrad;
}
diff --git a/src/finiteArea/finiteArea/fac/facNDiv.C b/src/finiteArea/finiteArea/fac/facNDiv.C
new file mode 100644
index 000000000..6a1953961
--- /dev/null
+++ b/src/finiteArea/finiteArea/fac/facNDiv.C
@@ -0,0 +1,333 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 3.2
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "facNDiv.H"
+#include "faMesh.H"
+#include "facEdgeIntegrate.H"
+#include "faDivScheme.H"
+#include "faConvectionScheme.H"
+#include "transformField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace fac
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template
+tmp >
+ndiv
+(
+ const GeometricField& ssf
+)
+{
+ const areaVectorField &n = ssf.mesh().faceAreaNormals();
+
+ tmp > v = fac::edgeIntegrate(ssf);
+
+ //v.internalField() = transform(n*n, v.internalField());
+ v.internalField() = (v.internalField()&n)*n;
+
+ return v;
+}
+
+
+template
+tmp >
+ndiv
+(
+ const tmp >& tssf
+)
+{
+ tmp > Div(fac::ndiv(tssf()));
+ tssf.clear();
+ return Div;
+}
+
+
+template
+tmp
+<
+ GeometricField
+ <
+ typename innerProduct::type, faPatchField, areaMesh
+ >
+>
+ndiv
+(
+ const GeometricField& vf,
+ const word& name
+)
+{
+ const areaVectorField &n = vf.mesh().faceAreaNormals();
+
+ tmp > tDiv
+ (
+ fa::divScheme::New
+ (
+ vf.mesh(), vf.mesh().schemesDict().divScheme(name)
+ )().facDiv(vf)
+ );
+
+ GeometricField& Div = tDiv();
+
+ //Div.internalField() = transform(n*n, Div.internalField());
+ Div.internalField() = (Div.internalField()&n)*n;
+ return tDiv;
+}
+
+
+template
+tmp
+<
+ GeometricField
+ <
+ typename innerProduct::type, faPatchField, areaMesh
+ >
+>
+ndiv
+(
+ const tmp >& tvvf,
+ const word& name
+)
+{
+ typedef typename innerProduct::type DivType;
+ tmp > Div
+ (
+ fac::ndiv(tvvf(), name)
+ );
+ tvvf.clear();
+ return Div;
+}
+
+template
+tmp
+<
+ GeometricField
+ <
+ typename innerProduct::type, faPatchField, areaMesh
+ >
+>
+ndiv
+(
+ const GeometricField& vf
+)
+{
+ return fac::ndiv(vf, "div("+vf.name()+')');
+}
+
+
+template
+tmp
+<
+ GeometricField
+ <
+ typename innerProduct::type, faPatchField, areaMesh
+ >
+>
+ndiv
+(
+ const tmp >& tvvf
+)
+{
+ typedef typename innerProduct::type DivType;
+ tmp > Div
+ (
+ fac::ndiv(tvvf())
+ );
+
+ tvvf.clear();
+ return Div;
+}
+
+
+template
+tmp >
+ndiv
+(
+ const edgeScalarField& flux,
+ const GeometricField& vf,
+ const word& name
+)
+{
+ const areaVectorField &n = vf.mesh().faceAreaNormals();
+
+ tmp > tDiv
+ (
+ fa::convectionScheme::New
+ (
+ vf.mesh(),
+ flux,
+ vf.mesh().schemesDict().divScheme(name)
+ )().facDiv(flux, vf)
+ );
+
+ GeometricField& Div = tDiv();
+
+ //Div.internalField() = transform(n*n, Div.internalField());
+ Div.internalField() = (Div.internalField()&n)*n;
+
+ return tDiv;
+
+}
+
+
+template
+tmp >
+ndiv
+(
+ const tmp& tflux,
+ const GeometricField& vf,
+ const word& name
+)
+{
+ tmp > Div
+ (
+ fac::ndiv(tflux(), vf, name)
+ );
+ tflux.clear();
+ return Div;
+}
+
+
+template
+tmp >
+ndiv
+(
+ const edgeScalarField& flux,
+ const tmp >& tvf,
+ const word& name
+)
+{
+ tmp > Div
+ (
+ fac::ndiv(flux, tvf(), name)
+ );
+ tvf.clear();
+ return Div;
+}
+
+
+template
+tmp >
+ndiv
+(
+ const tmp& tflux,
+ const tmp >& tvf,
+ const word& name
+)
+{
+ tmp > Div
+ (
+ fac::ndiv(tflux(), tvf(), name)
+ );
+ tflux.clear();
+ tvf.clear();
+ return Div;
+}
+
+
+template
+tmp >
+ndiv
+(
+ const edgeScalarField& flux,
+ const GeometricField& vf
+)
+{
+ return fac::ndiv
+ (
+ flux, vf, "div("+flux.name()+','+vf.name()+')'
+ );
+}
+
+
+template
+tmp >
+ndiv
+(
+ const tmp& tflux,
+ const GeometricField& vf
+)
+{
+ tmp > Div
+ (
+ fac::ndiv(tflux(), vf)
+ );
+ tflux.clear();
+ return Div;
+}
+
+
+template
+tmp >
+ndiv
+(
+ const edgeScalarField& flux,
+ const tmp >& tvf
+)
+{
+ tmp > Div
+ (
+ fac::ndiv(flux, tvf())
+ );
+ tvf.clear();
+ return Div;
+}
+
+
+template
+tmp >
+ndiv
+(
+ const tmp& tflux,
+ const tmp >& tvf
+)
+{
+ tmp > Div
+ (
+ fac::ndiv(tflux(), tvf())
+ );
+ tflux.clear();
+ tvf.clear();
+ return Div;
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace fac
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteArea/finiteArea/fac/facNDiv.H b/src/finiteArea/finiteArea/fac/facNDiv.H
new file mode 100644
index 000000000..7aab1da79
--- /dev/null
+++ b/src/finiteArea/finiteArea/fac/facNDiv.H
@@ -0,0 +1,187 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 3.2
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+Namespace
+ fac
+
+Description
+ Calculate the divergence of the given field.
+
+SourceFiles
+ facDiv.C
+
+\*---------------------------------------------------------------------------*/
+
+
+#ifndef facNDiv_H
+#define facNDiv_H
+
+#include "areaFieldsFwd.H"
+#include "edgeFieldsFwd.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Namespace fac functions Declaration
+\*---------------------------------------------------------------------------*/
+
+namespace fac
+{
+ template
+ tmp > ndiv
+ (
+ const GeometricField&
+ );
+
+ template
+ tmp > ndiv
+ (
+ const tmp >&
+ );
+
+
+ template
+ tmp
+ <
+ GeometricField
+ ::type, faPatchField, areaMesh>
+ > ndiv
+ (
+ const GeometricField&,
+ const word& name
+ );
+
+ template
+ tmp
+ <
+ GeometricField
+ ::type, faPatchField, areaMesh>
+ > ndiv
+ (
+ const tmp >&,
+ const word& name
+ );
+
+
+ template
+ tmp
+ <
+ GeometricField
+ ::type, faPatchField, areaMesh>
+ > ndiv
+ (
+ const GeometricField&
+ );
+
+ template
+ tmp
+ <
+ GeometricField
+ ::type, faPatchField, areaMesh>
+ > ndiv
+ (
+ const tmp >&
+ );
+
+
+ template
+ tmp > ndiv
+ (
+ const edgeScalarField&,
+ const GeometricField&,
+ const word& name
+ );
+
+ template
+ tmp > ndiv
+ (
+ const tmp&,
+ const GeometricField&,
+ const word& name
+ );
+
+ template
+ tmp > ndiv
+ (
+ const edgeScalarField&,
+ const tmp >&,
+ const word& name
+ );
+
+ template
+ tmp > ndiv
+ (
+ const tmp&,
+ const tmp >&,
+ const word& name
+ );
+
+
+ template
+ tmp > ndiv
+ (
+ const edgeScalarField&,
+ const GeometricField&
+ );
+
+ template
+ tmp > ndiv
+ (
+ const tmp&,
+ const GeometricField&
+ );
+
+ template
+ tmp > ndiv
+ (
+ const edgeScalarField&,
+ const tmp >&
+ );
+
+ template
+ tmp > ndiv
+ (
+ const tmp&,
+ const tmp >&
+ );
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+# include "facNDiv.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/finiteArea/finiteArea/fac/facNGrad.C b/src/finiteArea/finiteArea/fac/facNGrad.C
new file mode 100644
index 000000000..9d4d96070
--- /dev/null
+++ b/src/finiteArea/finiteArea/fac/facNGrad.C
@@ -0,0 +1,202 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 3.2
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+\*---------------------------------------------------------------------------*/
+
+#include "facNGrad.H"
+#include "areaFields.H"
+#include "edgeFields.H"
+#include "facEdgeIntegrate.H"
+#include "faMesh.H"
+#include "faGradScheme.H"
+#include "transformField.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace fac
+{
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+template
+tmp
+<
+ GeometricField
+ <
+ typename outerProduct::type, faPatchField, areaMesh
+ >
+>
+ngrad
+(
+ const GeometricField& ssf
+)
+{
+ const areaVectorField &n = ssf.mesh().faceAreaNormals();
+ typedef typename outerProduct::type GradType;
+
+ tmp > tgGrad = fac::edgeIntegrate(ssf.mesh().Sf() * ssf);
+
+ GeometricField& grad = tgGrad();
+
+ grad = (grad&n)*n;
+
+ return tgGrad;
+}
+
+template
+tmp
+<
+ GeometricField
+ <
+ typename outerProduct::type, faPatchField, areaMesh
+ >
+>
+ngrad
+(
+ const tmp >& tssf
+)
+{
+ typedef typename outerProduct::type GradType;
+ tmp > Grad
+ (
+ fac::ngrad(tssf())
+ );
+ tssf.clear();
+ return Grad;
+}
+
+
+template
+tmp
+<
+ GeometricField
+ <
+ typename outerProduct::type, faPatchField, areaMesh
+ >
+>
+ngrad
+(
+ const GeometricField& vf,
+ const word& name
+)
+{
+ const areaVectorField &n = vf.mesh().faceAreaNormals();
+ typedef typename outerProduct::type GradType;
+
+ tmp > tgGrad = fa::gradScheme::New
+ (
+ vf.mesh(),
+ vf.mesh().schemesDict().gradScheme(name)
+ )().grad(vf);
+
+ GeometricField& grad = tgGrad();
+
+ grad = (grad&n)*n;
+
+ return tgGrad;
+}
+
+
+template
+tmp
+<
+ GeometricField
+ <
+ typename outerProduct::type, faPatchField, areaMesh
+ >
+>
+ngrad
+(
+ const tmp >& tvf,
+ const word& name
+)
+{
+ tmp
+ <
+ GeometricField
+ <
+ typename outerProduct::type, faPatchField, areaMesh
+ >
+ > tGrad
+ (
+ fac::ngrad(tvf(), name)
+ );
+ tvf.clear();
+ return tGrad;
+}
+
+
+template
+tmp
+<
+ GeometricField
+ <
+ typename outerProduct::type, faPatchField, areaMesh
+ >
+>
+ngrad
+(
+ const GeometricField& vf
+)
+{
+ return fac::ngrad(vf, "grad(" + vf.name() + ')');
+}
+
+
+template
+tmp
+<
+ GeometricField
+ <
+ typename outerProduct::type, faPatchField, areaMesh
+ >
+>
+ngrad
+(
+ const tmp >& tvf
+)
+{
+ typedef typename outerProduct::type GradType;
+ tmp > Grad
+ (
+ fac::ngrad(tvf())
+ );
+ tvf.clear();
+ return Grad;
+}
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace fac
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace Foam
+
+// ************************************************************************* //
diff --git a/src/finiteArea/finiteArea/fac/facNGrad.H b/src/finiteArea/finiteArea/fac/facNGrad.H
new file mode 100644
index 000000000..0375202bd
--- /dev/null
+++ b/src/finiteArea/finiteArea/fac/facNGrad.H
@@ -0,0 +1,131 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / F ield | foam-extend: Open Source CFD
+ \\ / O peration | Version: 3.2
+ \\ / A nd | Web: http://www.foam-extend.org
+ \\/ M anipulation | For copyright notice see file Copyright
+-------------------------------------------------------------------------------
+License
+ This file is part of foam-extend.
+
+ foam-extend 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.
+
+ foam-extend 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 foam-extend. If not, see .
+
+Namespace
+ fac
+
+Description
+ Calculate the gradient normal to the surface of the given field.
+
+SourceFiles
+ facGrad.C
+
+\*---------------------------------------------------------------------------*/
+
+
+#ifndef facNGrad_H
+#define facNGrad_H
+
+#include "areaFieldsFwd.H"
+#include "edgeFieldsFwd.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+/*---------------------------------------------------------------------------*\
+ Namespace fac functions Declaration
+\*---------------------------------------------------------------------------*/
+
+namespace fac
+{
+ template
+ tmp
+ <
+ GeometricField
+ ::type, faPatchField, areaMesh>
+ > ngrad
+ (
+ const GeometricField