Merge branch 'nextRelease' of git://git.code.sf.net/p/foam-extend/foam-extend-3.2 into nextRelease
This commit is contained in:
commit
2812bab769
517 changed files with 13126 additions and 2310 deletions
7
DraftReleaseNotes-nextRelease
Normal file
7
DraftReleaseNotes-nextRelease
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
New features:
|
||||||
|
- merged cfMesh contribution: Franjo Juretic
|
||||||
|
|
||||||
|
|
||||||
|
Bug fixes:
|
||||||
|
- fixed precunfigured mixing plane boundary files
|
||||||
|
- added 0 directories to cfMesh tutorials
|
|
@ -85,3 +85,4 @@ Contents:
|
||||||
Alexander Vakhrushev
|
Alexander Vakhrushev
|
||||||
Inno Gatin
|
Inno Gatin
|
||||||
Alexey Matveichev
|
Alexey Matveichev
|
||||||
|
Vuko Vukcevic
|
||||||
|
|
20
ThirdParty/AllMake.stage1
vendored
20
ThirdParty/AllMake.stage1
vendored
|
@ -90,6 +90,26 @@ echo
|
||||||
( rpm_make -p gcc-4.6.3 -s gcc-4.6.3.spec -u http://ftpmirror.gnu.org/gcc/gcc-4.6.3/gcc-4.6.3.tar.gz )
|
( rpm_make -p gcc-4.6.3 -s gcc-4.6.3.spec -u http://ftpmirror.gnu.org/gcc/gcc-4.6.3/gcc-4.6.3.tar.gz )
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Gcc 4.7.4 and companion libraries
|
||||||
|
#
|
||||||
|
[ ! -z "$WM_THIRD_PARTY_USE_GCC_474" ] && {
|
||||||
|
echo "Building gmp-5.0.5 mpfr-3.1.0 mpc-0.9 gcc-4.6.3"
|
||||||
|
( rpm_make -p gmp-5.1.2 -s gmp-5.1.2.spec -u ftp://ftp.gnu.org/gnu/gmp/gmp-5.1.2.tar.bz2 )
|
||||||
|
( rpm_make -p mpfr-3.1.2 -s mpfr-3.1.2.spec -u ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.1.2.tar.gz )
|
||||||
|
( rpm_make -p mpc-1.0.1 -s mpc-1.0.1.spec -u http://www.multiprecision.org/mpc/download/mpc-1.0.1.tar.gz )
|
||||||
|
( rpm_make -p gcc-4.7.4 -s gcc-4.7.4.spec -u ftp://ftp.gnu.org/gnu/gcc/gcc-4.7.4/gcc-4.7.4.tar.gz )
|
||||||
|
}
|
||||||
|
|
||||||
|
# Gcc 4.7.4 and companion libraries
|
||||||
|
#
|
||||||
|
[ ! -z "$WM_THIRD_PARTY_USE_GCC_474" ] && {
|
||||||
|
echo "Building gmp-5.0.5 mpfr-3.1.0 mpc-0.9 gcc-4.6.3"
|
||||||
|
( rpm_make -p gmp-5.1.2 -s gmp-5.1.2.spec -u ftp://ftp.gnu.org/gnu/gmp/gmp-5.1.2.tar.bz2 )
|
||||||
|
( rpm_make -p mpfr-3.1.2 -s mpfr-3.1.2.spec -u ftp://ftp.gnu.org/gnu/mpfr/mpfr-3.1.2.tar.gz )
|
||||||
|
( rpm_make -p mpc-1.0.1 -s mpc-1.0.1.spec -u http://www.multiprecision.org/mpc/download/mpc-1.0.1.tar.gz )
|
||||||
|
( rpm_make -p gcc-4.7.4 -s gcc-4.7.4.spec -u ftp://ftp.gnu.org/gnu/gcc/gcc-4.7.4/gcc-4.7.4.tar.gz )
|
||||||
|
}
|
||||||
|
|
||||||
# Gcc 4.8.4 and companion libraries
|
# Gcc 4.8.4 and companion libraries
|
||||||
#
|
#
|
||||||
[ ! -z "$WM_THIRD_PARTY_USE_GCC_484" ] && {
|
[ ! -z "$WM_THIRD_PARTY_USE_GCC_484" ] && {
|
||||||
|
|
5
ThirdParty/mingwBuild/build.sh
vendored
5
ThirdParty/mingwBuild/build.sh
vendored
|
@ -151,13 +151,14 @@ build_library() {
|
||||||
|
|
||||||
system)
|
system)
|
||||||
cd $INSTALL_DIR
|
cd $INSTALL_DIR
|
||||||
patch system
|
patch $PACKAGE
|
||||||
;;
|
;;
|
||||||
|
|
||||||
pthreads-w32-2-9-1-release)
|
pthreads-w32-2-9-1-release)
|
||||||
download $PACKAGE.zip ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.zip > $LOG_FILE 2>&1
|
download $PACKAGE.zip ftp://sourceware.org/pub/pthreads-win32/pthreads-w32-2-9-1-release.zip > $LOG_FILE 2>&1
|
||||||
unzip_dir $PACKAGE >> $LOG_FILE 2>&1
|
unzip_dir $PACKAGE >> $LOG_FILE 2>&1
|
||||||
patch $PACKAGE
|
patch $PACKAGE
|
||||||
|
mv $PACKAGE $INSTALL_DIR
|
||||||
;;
|
;;
|
||||||
|
|
||||||
metis-5.1.0)
|
metis-5.1.0)
|
||||||
|
@ -222,7 +223,7 @@ build_library() {
|
||||||
;;
|
;;
|
||||||
|
|
||||||
scotch_6.0.4)
|
scotch_6.0.4)
|
||||||
export PTHREADS_HOME=$BUILD_DIR/pthreads-w32-2-9-1-release
|
export PTHREADS_HOME=$INSTALL_DIR/pthreads-w32-2-9-1-release
|
||||||
download $PACKAGE.tar.gz https://gforge.inria.fr/frs/download.php/34618 > $LOG_FILE 2>&1
|
download $PACKAGE.tar.gz https://gforge.inria.fr/frs/download.php/34618 > $LOG_FILE 2>&1
|
||||||
extract "$PACKAGE.tar.gz" gzip >> $LOG_FILE 2>&1
|
extract "$PACKAGE.tar.gz" gzip >> $LOG_FILE 2>&1
|
||||||
patch $PACKAGE
|
patch $PACKAGE
|
||||||
|
|
|
@ -46,7 +46,7 @@ LDFLAGS += -L$(MPI_ROOTDIR)/bin -lm -lmpi -lmpid
|
||||||
#PTHREAD_ROOTDIR = $(PGMFILES)/pthread-win32
|
#PTHREAD_ROOTDIR = $(PGMFILES)/pthread-win32
|
||||||
#CFLAGS_INC += -I$(PTHREAD_ROOTDIR)/include
|
#CFLAGS_INC += -I$(PTHREAD_ROOTDIR)/include
|
||||||
#CLIBFLAGS =
|
#CLIBFLAGS =
|
||||||
LDFLAGS += -L$(PTHREADS_HOME)/Pre-built.2/lib/x64 -lpthread
|
LDFLAGS += -L$(PTHREADS_HOME)/Pre-built.2/lib/x64 -lpthreadGC2
|
||||||
|
|
||||||
#--- zlib: Uncomment for compressed files
|
#--- zlib: Uncomment for compressed files
|
||||||
#ZLIB_ROOTDIR = $(PGMFILES)/zlib-1.2.3
|
#ZLIB_ROOTDIR = $(PGMFILES)/zlib-1.2.3
|
||||||
|
|
|
@ -7,7 +7,7 @@ diff -ruN libccmio-2.6.1_orig/config/config.gnu.to.star libccmio-2.6.1/config/co
|
||||||
|
|
||||||
# $Id: config.gnu.to.star,v 1.4 2006/06/05 21:12:16 geoffp Exp $
|
# $Id: config.gnu.to.star,v 1.4 2006/06/05 21:12:16 geoffp Exp $
|
||||||
|
|
||||||
@@ -34,6 +34,11 @@
|
@@ -34,6 +34,12 @@
|
||||||
x86_64-unknown-linux-gnu-null) echo linux64_2.4-x86-glibc_2.2.5 ;;
|
x86_64-unknown-linux-gnu-null) echo linux64_2.4-x86-glibc_2.2.5 ;;
|
||||||
ppc64-unknown-linux-gnu-null) echo linux64_2.6-pwr4-glibc_2.3.3 ;;
|
ppc64-unknown-linux-gnu-null) echo linux64_2.6-pwr4-glibc_2.3.3 ;;
|
||||||
i386-apple-darwin8-null) echo i386-apple-darwin8 ;;
|
i386-apple-darwin8-null) echo i386-apple-darwin8 ;;
|
||||||
|
@ -16,6 +16,7 @@ diff -ruN libccmio-2.6.1_orig/config/config.gnu.to.star libccmio-2.6.1/config/co
|
||||||
+ i386-apple-darwin12-null) echo i386-apple-darwin12 ;;
|
+ i386-apple-darwin12-null) echo i386-apple-darwin12 ;;
|
||||||
+ i386-apple-darwin13-null) echo i386-apple-darwin13 ;;
|
+ i386-apple-darwin13-null) echo i386-apple-darwin13 ;;
|
||||||
+ i386-apple-darwin14-null) echo i386-apple-darwin14 ;;
|
+ i386-apple-darwin14-null) echo i386-apple-darwin14 ;;
|
||||||
|
+ i386-apple-darwin15-null) echo i386-apple-darwin15 ;;
|
||||||
*) echo unknown ;;
|
*) echo unknown ;;
|
||||||
esac
|
esac
|
||||||
|
|
||||||
|
@ -37,7 +38,7 @@ diff -ruN libccmio-2.6.1_orig/config/config.system libccmio-2.6.1/config/config.
|
||||||
|
|
||||||
# $Id: config.system,v 1.2 2005/09/29 22:19:19 geoffp Exp $
|
# $Id: config.system,v 1.2 2005/09/29 22:19:19 geoffp Exp $
|
||||||
|
|
||||||
@@ -87,6 +87,24 @@
|
@@ -87,6 +87,27 @@
|
||||||
i386-apple-darwin8.11.1)
|
i386-apple-darwin8.11.1)
|
||||||
echo i386-apple-darwin8 ;;
|
echo i386-apple-darwin8 ;;
|
||||||
|
|
||||||
|
@ -58,6 +59,9 @@ diff -ruN libccmio-2.6.1_orig/config/config.system libccmio-2.6.1/config/config.
|
||||||
+
|
+
|
||||||
+ i386-apple-darwin14.* )
|
+ i386-apple-darwin14.* )
|
||||||
+ echo i386-apple-darwin14 ;;
|
+ echo i386-apple-darwin14 ;;
|
||||||
|
+
|
||||||
|
+ i386-apple-darwin15.* )
|
||||||
|
+ echo i386-apple-darwin15 ;;
|
||||||
+
|
+
|
||||||
*)
|
*)
|
||||||
echo unknown
|
echo unknown
|
||||||
|
|
|
@ -115,6 +115,14 @@ Patch1: ParMGridGen-1.0.patch
|
||||||
cp ./MGridGen/IMlib/libIMlib.* $RPM_BUILD_ROOT/%{_installPrefix}/lib
|
cp ./MGridGen/IMlib/libIMlib.* $RPM_BUILD_ROOT/%{_installPrefix}/lib
|
||||||
cp ./MGridGen/Lib/libMGridGen.* $RPM_BUILD_ROOT/%{_installPrefix}/lib
|
cp ./MGridGen/Lib/libMGridGen.* $RPM_BUILD_ROOT/%{_installPrefix}/lib
|
||||||
|
|
||||||
|
%ifos darwin
|
||||||
|
# Making sure to set the shared library identification name to the full path
|
||||||
|
# System Integrity Protection (SIP) enabled systems (OS X El Capitan)
|
||||||
|
# require this
|
||||||
|
install_name_tool -id %{_installPrefix}/lib/libIMlib.dylib $RPM_BUILD_ROOT/%{_installPrefix}/lib/libIMlib.dylib
|
||||||
|
install_name_tool -id %{_installPrefix}/lib/libMGridGen.dylib $RPM_BUILD_ROOT/%{_installPrefix}/lib/libMGridGen.dylib
|
||||||
|
%endif
|
||||||
|
|
||||||
# Creation of foam-extend specific .csh and .sh files"
|
# Creation of foam-extend specific .csh and .sh files"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
|
@ -104,6 +104,7 @@ Patch0: libccmio-2.6.1.patch_0
|
||||||
[ ! -d config/i386-apple-darwin12 ] && cp -r config/i386-apple-darwin8 config/i386-apple-darwin12
|
[ ! -d config/i386-apple-darwin12 ] && cp -r config/i386-apple-darwin8 config/i386-apple-darwin12
|
||||||
[ ! -d config/i386-apple-darwin13 ] && cp -r config/i386-apple-darwin8 config/i386-apple-darwin13
|
[ ! -d config/i386-apple-darwin13 ] && cp -r config/i386-apple-darwin8 config/i386-apple-darwin13
|
||||||
[ ! -d config/i386-apple-darwin14 ] && cp -r config/i386-apple-darwin8 config/i386-apple-darwin14
|
[ ! -d config/i386-apple-darwin14 ] && cp -r config/i386-apple-darwin8 config/i386-apple-darwin14
|
||||||
|
[ ! -d config/i386-apple-darwin15 ] && cp -r config/i386-apple-darwin8 config/i386-apple-darwin15
|
||||||
%endif
|
%endif
|
||||||
# Warning:
|
# Warning:
|
||||||
# 1: The name of the ADF library will be renamed to libadf_ccmio since this
|
# 1: The name of the ADF library will be renamed to libadf_ccmio since this
|
||||||
|
@ -133,6 +134,14 @@ Patch0: libccmio-2.6.1.patch_0
|
||||||
mv ${libsdir}/* $RPM_BUILD_ROOT/%{_installPrefix}/lib
|
mv ${libsdir}/* $RPM_BUILD_ROOT/%{_installPrefix}/lib
|
||||||
cp libccmio/*.h $RPM_BUILD_ROOT/%{_installPrefix}/include/libccmio
|
cp libccmio/*.h $RPM_BUILD_ROOT/%{_installPrefix}/include/libccmio
|
||||||
|
|
||||||
|
%ifos darwin
|
||||||
|
# Making sure to set the shared library identification name to the full path
|
||||||
|
# System Integrity Protection (SIP) enabled systems (OS X El Capitan)
|
||||||
|
# require this
|
||||||
|
install_name_tool -id %{_installPrefix}/lib/libadf_ccmio.dylib $RPM_BUILD_ROOT/%{_installPrefix}/lib/libadf_ccmio.dylib
|
||||||
|
install_name_tool -id %{_installPrefix}/lib/libccmio.dylib $RPM_BUILD_ROOT/%{_installPrefix}/lib/libccmio.dylib
|
||||||
|
%endif
|
||||||
|
|
||||||
# Creation of foam-extend specific .csh and .sh files"
|
# Creation of foam-extend specific .csh and .sh files"
|
||||||
|
|
||||||
echo ""
|
echo ""
|
||||||
|
|
6
ThirdParty/rpmBuild/SPECS/scotch-6.0.4.spec
vendored
6
ThirdParty/rpmBuild/SPECS/scotch-6.0.4.spec
vendored
|
@ -113,6 +113,12 @@ Patch1: scotch-6.0.4_patch_darwin
|
||||||
make -j $WM_NCOMPPROCS ptscotch AR="$WM_CC"
|
make -j $WM_NCOMPPROCS ptscotch AR="$WM_CC"
|
||||||
|
|
||||||
%install
|
%install
|
||||||
|
%ifos darwin
|
||||||
|
# Making sure to set the shared library identification name to the full path
|
||||||
|
# System Integrity Protection (SIP) enabled systems (OS X El Capitan)
|
||||||
|
# require this
|
||||||
|
find . -name \*.dylib | xargs -I{} -n 1 bash -c 'bn=$(basename $1) ; install_name_tool -id %{_installPrefix}/lib/${bn} $1' -- {}
|
||||||
|
%endif
|
||||||
cd src
|
cd src
|
||||||
mkdir -p $RPM_BUILD_ROOT%{_installPrefix}
|
mkdir -p $RPM_BUILD_ROOT%{_installPrefix}
|
||||||
make install prefix=$RPM_BUILD_ROOT%{_installPrefix}
|
make install prefix=$RPM_BUILD_ROOT%{_installPrefix}
|
||||||
|
|
|
@ -52,17 +52,17 @@ int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
#include "readSIMPLEControls.H"
|
# include "readSIMPLEControls.H"
|
||||||
#include "initConvergenceCheck.H"
|
# include "initConvergenceCheck.H"
|
||||||
|
|
||||||
p.storePrevIter();
|
p.storePrevIter();
|
||||||
rho.storePrevIter();
|
rho.storePrevIter();
|
||||||
|
|
||||||
// Pressure-velocity SIMPLE corrector
|
// Pressure-velocity SIMPLE corrector
|
||||||
{
|
{
|
||||||
#include "UEqn.H"
|
# include "UEqn.H"
|
||||||
#include "hEqn.H"
|
# include "hEqn.H"
|
||||||
#include "pEqn.H"
|
# include "pEqn.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
turbulence->correct();
|
turbulence->correct();
|
||||||
|
|
|
@ -1,20 +0,0 @@
|
||||||
{
|
|
||||||
# include "rhoEqn.H"
|
|
||||||
}
|
|
||||||
{
|
|
||||||
scalar sumLocalContErr =
|
|
||||||
sum
|
|
||||||
(
|
|
||||||
mag(rho.internalField() - (psi*p)().internalField())
|
|
||||||
)/sum(rho.internalField());
|
|
||||||
|
|
||||||
scalar globalContErr =
|
|
||||||
sum(rho.internalField() - (psi*p)().internalField())
|
|
||||||
/sum(rho.internalField());
|
|
||||||
|
|
||||||
cumulativeContErr += globalContErr;
|
|
||||||
|
|
||||||
Info<< "time step continuity errors : sum local = " << sumLocalContErr
|
|
||||||
<< ", global = " << globalContErr
|
|
||||||
<< ", cumulative = " << cumulativeContErr << endl;
|
|
||||||
}
|
|
|
@ -9,7 +9,9 @@
|
||||||
volScalarField& T = const_cast<volScalarField&>(thermo.T());
|
volScalarField& T = const_cast<volScalarField&>(thermo.T());
|
||||||
volScalarField& p = thermo.p();
|
volScalarField& p = thermo.p();
|
||||||
volScalarField& e = thermo.e();
|
volScalarField& e = thermo.e();
|
||||||
const volScalarField& psi = thermo.psi();
|
|
||||||
|
volScalarField psis("psi", thermo.psi()/thermo.Cp()*thermo.Cv());
|
||||||
|
psis.oldTime();
|
||||||
|
|
||||||
volScalarField rho
|
volScalarField rho
|
||||||
(
|
(
|
||||||
|
@ -38,20 +40,6 @@
|
||||||
|
|
||||||
# include "compressibleCreatePhi.H"
|
# include "compressibleCreatePhi.H"
|
||||||
|
|
||||||
// Store energy source term for under-relaxation
|
|
||||||
volScalarField pDivU
|
|
||||||
(
|
|
||||||
IOobject
|
|
||||||
(
|
|
||||||
"pDivU",
|
|
||||||
runTime.timeName(),
|
|
||||||
mesh,
|
|
||||||
IOobject::NO_READ,
|
|
||||||
IOobject::NO_WRITE
|
|
||||||
),
|
|
||||||
p*fvc::div(phi/fvc::interpolate(rho))
|
|
||||||
);
|
|
||||||
|
|
||||||
Info<< "Creating turbulence model\n" << endl;
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
autoPtr<compressible::turbulenceModel> turbulence
|
autoPtr<compressible::turbulenceModel> turbulence
|
||||||
(
|
(
|
||||||
|
|
|
@ -5,7 +5,15 @@
|
||||||
+ fvm::div(phi, e)
|
+ fvm::div(phi, e)
|
||||||
- fvm::laplacian(turbulence->alphaEff(), e)
|
- fvm::laplacian(turbulence->alphaEff(), e)
|
||||||
==
|
==
|
||||||
- fvm::SuSp(pDivU/e, e)
|
- fvm::SuSp
|
||||||
|
(
|
||||||
|
p*fvc::div
|
||||||
|
(
|
||||||
|
phi/fvc::interpolate(rho)
|
||||||
|
+ fvc::meshPhi(rho, U)
|
||||||
|
)/e,
|
||||||
|
e
|
||||||
|
)
|
||||||
// viscous heating?
|
// viscous heating?
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -40,4 +48,10 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
thermo.correct();
|
thermo.correct();
|
||||||
|
|
||||||
|
// Recalculate compressibility
|
||||||
|
psis = thermo.psi()/thermo.Cp()*thermo.Cv();
|
||||||
|
|
||||||
|
// Recalculate density
|
||||||
|
rho = thermo.rho();
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,26 +3,37 @@
|
||||||
|
|
||||||
# include "limitU.H"
|
# include "limitU.H"
|
||||||
|
|
||||||
surfaceScalarField phid
|
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
|
||||||
(
|
{
|
||||||
"phid",
|
// Calculate phi for boundary conditions
|
||||||
fvc::interpolate(psi)*
|
phi = rhof*
|
||||||
(
|
(
|
||||||
(fvc::interpolate(U) & mesh.Sf())
|
(fvc::interpolate(U) & mesh.Sf())
|
||||||
- fvc::meshPhi(rho, U)
|
- fvc::meshPhi(rho, U)
|
||||||
)
|
|
||||||
);
|
);
|
||||||
|
|
||||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
surfaceScalarField phid2 = rhoReff/rhof*phi;
|
||||||
{
|
|
||||||
|
surfaceScalarField phid("phid", psisf/rhof*phi);
|
||||||
|
|
||||||
// Store pressure for under-relaxation
|
// Store pressure for under-relaxation
|
||||||
p.storePrevIter();
|
p.storePrevIter();
|
||||||
|
|
||||||
|
volScalarField divPhid
|
||||||
|
(
|
||||||
|
"divPhid",
|
||||||
|
fvc::div(phid)
|
||||||
|
);
|
||||||
|
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psis, p)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
- fvm::laplacian(rho/UEqn.A(), p)
|
// Convective flux relaxation terms
|
||||||
|
+ fvm::SuSp(-divPhid, p)
|
||||||
|
+ divPhid*p
|
||||||
|
+ fvc::div(phid2)
|
||||||
|
- fvm::laplacian(rho*rUA, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
if
|
if
|
||||||
|
@ -42,9 +53,10 @@
|
||||||
pEqn.solve(mesh.solutionDict().solver(p.name()));
|
pEqn.solve(mesh.solutionDict().solver(p.name()));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Calculate the flux
|
||||||
if (nonOrth == nNonOrthCorr)
|
if (nonOrth == nNonOrthCorr)
|
||||||
{
|
{
|
||||||
phi = pEqn.flux();
|
phi = phid2 + pEqn.flux();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -27,10 +27,11 @@ Application
|
||||||
Description
|
Description
|
||||||
Transient solver for trans-sonic/supersonic for laminar or turbulent
|
Transient solver for trans-sonic/supersonic for laminar or turbulent
|
||||||
flow of a compressible gas with support for mesh motion and
|
flow of a compressible gas with support for mesh motion and
|
||||||
topological changes
|
topological changes.
|
||||||
|
|
||||||
Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
|
Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
|
||||||
pseudo-transient simulations.
|
pseudo-transient simulations. The pressure-energy coupling is done
|
||||||
|
using the Rusche manoeuvre (isentropic compression/expansion).
|
||||||
|
|
||||||
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
|
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
|
||||||
|
|
||||||
|
@ -70,7 +71,7 @@ int main(int argc, char *argv[])
|
||||||
# include "setDeltaT.H"
|
# include "setDeltaT.H"
|
||||||
|
|
||||||
runTime++;
|
runTime++;
|
||||||
|
Info<< "deltaT = " << runTime.deltaT().value() << nl << endl;
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
bool meshChanged = mesh.update();
|
bool meshChanged = mesh.update();
|
||||||
|
@ -107,31 +108,25 @@ int main(int argc, char *argv[])
|
||||||
label oCorr = 0;
|
label oCorr = 0;
|
||||||
do
|
do
|
||||||
{
|
{
|
||||||
// Under-relax pDivU term
|
|
||||||
pDivU.storePrevIter();
|
|
||||||
|
|
||||||
pDivU =
|
|
||||||
p*fvc::div
|
|
||||||
(
|
|
||||||
phi/fvc::interpolate(rho)
|
|
||||||
+ fvc::meshPhi(rho, U)
|
|
||||||
);
|
|
||||||
|
|
||||||
pDivU.relax();
|
|
||||||
|
|
||||||
# include "rhoEqn.H"
|
# include "rhoEqn.H"
|
||||||
# include "eEqn.H"
|
# include "eEqn.H"
|
||||||
# include "UEqn.H"
|
# include "UEqn.H"
|
||||||
|
|
||||||
// --- PISO loop
|
// --- PISO loop
|
||||||
|
volScalarField rUA = 1.0/UEqn.A();
|
||||||
|
|
||||||
|
surfaceScalarField psisf = fvc::interpolate(psis);
|
||||||
|
surfaceScalarField rhof = fvc::interpolate(rho);
|
||||||
|
|
||||||
|
// Needs to be outside of loop since p is changing,
|
||||||
|
// but psi and rho are not
|
||||||
|
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
|
||||||
|
|
||||||
for (int corr = 0; corr < nCorr; corr++)
|
for (int corr = 0; corr < nCorr; corr++)
|
||||||
{
|
{
|
||||||
# include "pEqn.H"
|
# include "pEqn.H"
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recalculate density
|
|
||||||
rho = thermo.rho();
|
|
||||||
|
|
||||||
turbulence->correct();
|
turbulence->correct();
|
||||||
} while (++oCorr < nOuterCorr);
|
} while (++oCorr < nOuterCorr);
|
||||||
|
|
||||||
|
|
|
@ -1,8 +1,24 @@
|
||||||
fvVectorMatrix UEqn
|
fvVectorMatrix UEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(rho, U)
|
fvm::ddt(rho, U)
|
||||||
+ fvm::div(phi, U)
|
+ fvm::div(phi, U)
|
||||||
+ turbulence->divDevRhoReff(U)
|
+ turbulence->divDevRhoReff(U)
|
||||||
);
|
);
|
||||||
|
|
||||||
solve(UEqn == -fvc::grad(p));
|
if (oCorr == nOuterCorr - 1)
|
||||||
|
{
|
||||||
|
if (mesh.solutionDict().relax("UFinal"))
|
||||||
|
{
|
||||||
|
UEqn.relax(mesh.solutionDict().relaxationFactor("UFinal"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UEqn.relax(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
UEqn.relax();
|
||||||
|
}
|
||||||
|
|
||||||
|
solve(UEqn == -fvc::grad(p));
|
||||||
|
|
|
@ -8,7 +8,9 @@
|
||||||
|
|
||||||
volScalarField& p = thermo.p();
|
volScalarField& p = thermo.p();
|
||||||
volScalarField& e = thermo.e();
|
volScalarField& e = thermo.e();
|
||||||
const volScalarField& psi = thermo.psi();
|
|
||||||
|
volScalarField psis("psi", thermo.psi()/thermo.Cp()*thermo.Cv());
|
||||||
|
psis.oldTime();
|
||||||
|
|
||||||
volScalarField rho
|
volScalarField rho
|
||||||
(
|
(
|
||||||
|
@ -35,8 +37,7 @@
|
||||||
mesh
|
mesh
|
||||||
);
|
);
|
||||||
|
|
||||||
#include "compressibleCreatePhi.H"
|
# include "compressibleCreatePhi.H"
|
||||||
|
|
||||||
|
|
||||||
Info<< "Creating turbulence model\n" << endl;
|
Info<< "Creating turbulence model\n" << endl;
|
||||||
autoPtr<compressible::turbulenceModel> turbulence
|
autoPtr<compressible::turbulenceModel> turbulence
|
||||||
|
|
|
@ -1,12 +1,42 @@
|
||||||
{
|
{
|
||||||
solve
|
fvScalarMatrix eEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(rho, e)
|
fvm::ddt(rho, e)
|
||||||
+ fvm::div(phi, e)
|
+ fvm::div(phi, e)
|
||||||
- fvm::laplacian(turbulence->alphaEff(), e)
|
- fvm::laplacian(turbulence->alphaEff(), e)
|
||||||
==
|
==
|
||||||
- p*fvc::div(phi/fvc::interpolate(rho))
|
- p*fvc::div(phi/fvc::interpolate(rho))
|
||||||
|
// - fvm::SuSp
|
||||||
|
// (
|
||||||
|
// p*fvc::div(phi/fvc::interpolate(rho))/e,
|
||||||
|
// e
|
||||||
|
// )
|
||||||
|
// viscous heating?
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (oCorr == nOuterCorr - 1)
|
||||||
|
{
|
||||||
|
if (mesh.solutionDict().relax("eFinal"))
|
||||||
|
{
|
||||||
|
eEqn.relax(mesh.solutionDict().relaxationFactor("eFinal"));
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
eEqn.relax(1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
eEqn.relax();
|
||||||
|
}
|
||||||
|
|
||||||
|
eEqn.solve();
|
||||||
|
|
||||||
thermo.correct();
|
thermo.correct();
|
||||||
|
|
||||||
|
// Recalculate compressibility
|
||||||
|
psis = thermo.psi()/thermo.Cp()*thermo.Cv();
|
||||||
|
|
||||||
|
// Recalculate density
|
||||||
|
rho = thermo.rho();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,37 +1,52 @@
|
||||||
rho = thermo.rho();
|
|
||||||
|
|
||||||
volScalarField rUA = 1.0/UEqn.A();
|
|
||||||
U = rUA*UEqn.H();
|
|
||||||
|
|
||||||
surfaceScalarField phid
|
|
||||||
(
|
|
||||||
"phid",
|
|
||||||
fvc::interpolate(psi)
|
|
||||||
*(
|
|
||||||
(fvc::interpolate(U) & mesh.Sf())
|
|
||||||
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
|
|
||||||
{
|
{
|
||||||
|
U = UEqn.H()/UEqn.A();
|
||||||
|
|
||||||
|
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
|
||||||
|
{
|
||||||
|
// Calculate phi for boundary conditions
|
||||||
|
phi = rhof*
|
||||||
|
(
|
||||||
|
(fvc::interpolate(U) & mesh.Sf())
|
||||||
|
);
|
||||||
|
|
||||||
|
surfaceScalarField phid2 = rhoReff/rhof*phi;
|
||||||
|
|
||||||
|
surfaceScalarField phid("phid", psisf/rhof*phi);
|
||||||
|
|
||||||
|
// Store pressure for under-relaxation
|
||||||
|
p.storePrevIter();
|
||||||
|
|
||||||
|
volScalarField divPhid
|
||||||
|
(
|
||||||
|
"divPhid",
|
||||||
|
fvc::div(phid)
|
||||||
|
);
|
||||||
|
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psis, p)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
|
// Convective flux relaxation terms
|
||||||
|
+ fvm::SuSp(-divPhid, p)
|
||||||
|
+ divPhid*p
|
||||||
|
+ fvc::div(phid2)
|
||||||
- fvm::laplacian(rho*rUA, p)
|
- fvm::laplacian(rho*rUA, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
pEqn.solve();
|
pEqn.solve();
|
||||||
|
|
||||||
|
// Calculate the flux
|
||||||
if (nonOrth == nNonOrthCorr)
|
if (nonOrth == nNonOrthCorr)
|
||||||
{
|
{
|
||||||
phi = pEqn.flux();
|
phi = phid2 + pEqn.flux();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Relax the pressure
|
||||||
|
p.relax();
|
||||||
|
}
|
||||||
|
|
||||||
|
# include "compressibleContinuityErrs.H"
|
||||||
|
|
||||||
|
U -= fvc::grad(p)/UEqn.A();
|
||||||
|
U.correctBoundaryConditions();
|
||||||
}
|
}
|
||||||
|
|
||||||
#include "rhoEqn.H"
|
|
||||||
#include "compressibleContinuityErrs.H"
|
|
||||||
|
|
||||||
U -= rUA*fvc::grad(p);
|
|
||||||
U.correctBoundaryConditions();
|
|
||||||
|
|
|
@ -25,8 +25,17 @@ Application
|
||||||
sonicFoam
|
sonicFoam
|
||||||
|
|
||||||
Description
|
Description
|
||||||
Transient solver for trans-sonic/supersonic, laminar or turbulent flow
|
Transient solver for trans-sonic/supersonic for laminar or turbulent
|
||||||
of a compressible gas.
|
flow of a compressible gas.
|
||||||
|
|
||||||
|
Uses the flexible PIMPLE (PISO-SIMPLE) solution for time-resolved and
|
||||||
|
pseudo-transient simulations. The pressure-energy coupling is done
|
||||||
|
using the Rusche manoeuvre (isentropic compression/expansion).
|
||||||
|
|
||||||
|
Turbulence modelling is generic, i.e. laminar, RAS or LES may be selected.
|
||||||
|
|
||||||
|
Author
|
||||||
|
Hrvoje Jasak, Wikki Ltd. All rights reserved.
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
@ -48,21 +57,34 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
Info<< "\nStarting time loop\n" << endl;
|
Info<< "\nStarting time loop\n" << endl;
|
||||||
|
|
||||||
while (runTime.loop())
|
while (runTime.run())
|
||||||
{
|
{
|
||||||
|
# include "readTimeControls.H"
|
||||||
|
# include "readPIMPLEControls.H"
|
||||||
|
# include "compressibleCourantNo.H"
|
||||||
|
# include "setDeltaT.H"
|
||||||
|
|
||||||
|
runTime++;
|
||||||
|
Info<< "deltaT = " << runTime.deltaT().value() << nl << endl;
|
||||||
Info<< "Time = " << runTime.timeName() << nl << endl;
|
Info<< "Time = " << runTime.timeName() << nl << endl;
|
||||||
|
|
||||||
# include "readPISOControls.H"
|
// --- PIMPLE loop
|
||||||
# include "compressibleCourantNo.H"
|
label oCorr = 0;
|
||||||
|
do
|
||||||
|
{
|
||||||
# include "rhoEqn.H"
|
# include "rhoEqn.H"
|
||||||
|
# include "eEqn.H"
|
||||||
# include "UEqn.H"
|
# include "UEqn.H"
|
||||||
|
|
||||||
# include "eEqn.H"
|
|
||||||
|
|
||||||
|
|
||||||
// --- PISO loop
|
// --- PISO loop
|
||||||
|
volScalarField rUA = 1.0/UEqn.A();
|
||||||
|
|
||||||
|
surfaceScalarField psisf = fvc::interpolate(psis);
|
||||||
|
surfaceScalarField rhof = fvc::interpolate(rho);
|
||||||
|
|
||||||
|
// Needs to be outside of loop since p is changing,
|
||||||
|
// but psi and rho are not
|
||||||
|
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
|
||||||
|
|
||||||
for (int corr = 0; corr < nCorr; corr++)
|
for (int corr = 0; corr < nCorr; corr++)
|
||||||
{
|
{
|
||||||
|
@ -70,8 +92,7 @@ int main(int argc, char *argv[])
|
||||||
}
|
}
|
||||||
|
|
||||||
turbulence->correct();
|
turbulence->correct();
|
||||||
|
} while (++oCorr < nOuterCorr);
|
||||||
rho = thermo.rho();
|
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
|
|
||||||
|
@ -82,7 +103,7 @@ int main(int argc, char *argv[])
|
||||||
|
|
||||||
Info<< "End\n" << endl;
|
Info<< "End\n" << endl;
|
||||||
|
|
||||||
return 0;
|
return(0);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,7 @@ EXE_INC = \
|
||||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||||
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
|
||||||
-I$(LIB_SRC)/turbulenceModels \
|
-I$(LIB_SRC)/turbulenceModels \
|
||||||
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
|
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel
|
||||||
|
|
||||||
EXE_LIBS = \
|
EXE_LIBS = \
|
||||||
-lfiniteVolume \
|
-lfiniteVolume \
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
volScalarField& p = thermo.p();
|
volScalarField& p = thermo.p();
|
||||||
volScalarField& h = thermo.h();
|
volScalarField& h = thermo.h();
|
||||||
const volScalarField& T = thermo.T();
|
const volScalarField& T = thermo.T();
|
||||||
const volScalarField& psi = thermo.psi();
|
volScalarField psis("psi", thermo.psi()/thermo.Cp()*thermo.Cv());
|
||||||
|
psis.oldTime();
|
||||||
|
|
||||||
volScalarField rho
|
volScalarField rho
|
||||||
(
|
(
|
||||||
|
|
|
@ -14,9 +14,10 @@
|
||||||
fvm::ddt(rho, h)
|
fvm::ddt(rho, h)
|
||||||
+ fvm::div(phi, h)
|
+ fvm::div(phi, h)
|
||||||
- fvm::laplacian(turbulence->alphaEff(), h)
|
- fvm::laplacian(turbulence->alphaEff(), h)
|
||||||
+ fvm::SuSp((fvc::div(faceU, p, "div(U,p)") - p*fvc::div(faceU))/h, h)
|
|
||||||
==
|
==
|
||||||
// ddt(p) term removed: steady-state. HJ, 27/Apr/2010
|
// ddt(p) term removed: steady-state. HJ, 27/Apr/2010
|
||||||
|
fvc::div(faceU, p, "div(U,p)")
|
||||||
|
- p*fvc::div(faceU)
|
||||||
// Viscous heating: note sign (devRhoReff has a minus in it)
|
// Viscous heating: note sign (devRhoReff has a minus in it)
|
||||||
- (turbulence->devRhoReff() && fvc::grad(U))
|
- (turbulence->devRhoReff() && fvc::grad(U))
|
||||||
);
|
);
|
||||||
|
@ -26,12 +27,7 @@
|
||||||
eqnResidual = hEqn.solve().initialResidual();
|
eqnResidual = hEqn.solve().initialResidual();
|
||||||
maxResidual = max(eqnResidual, maxResidual);
|
maxResidual = max(eqnResidual, maxResidual);
|
||||||
|
|
||||||
// Bound the enthalpy using TMin and TMax
|
// Bounding of enthalpy taken out
|
||||||
volScalarField Cp = thermo.Cp();
|
|
||||||
|
|
||||||
h = Foam::min(h, TMax*Cp);
|
|
||||||
h = Foam::max(h, TMin*Cp);
|
|
||||||
h.correctBoundaryConditions();
|
|
||||||
|
|
||||||
thermo.correct();
|
thermo.correct();
|
||||||
|
psis = thermo.psi()/thermo.Cp()*thermo.Cv();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,24 +1,23 @@
|
||||||
{
|
{
|
||||||
volScalarField rUA = 1.0/UEqn.A();
|
volScalarField rUA = 1.0/UEqn.A();
|
||||||
|
|
||||||
|
surfaceScalarField psisf = fvc::interpolate(psis);
|
||||||
|
surfaceScalarField rhof = fvc::interpolate(rho);
|
||||||
|
|
||||||
|
// Needs to be outside of loop since p is changing, but psi and rho are not
|
||||||
|
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
|
||||||
|
|
||||||
|
// --- PISO loop
|
||||||
for (int corr = 0; corr < nCorr; corr++)
|
for (int corr = 0; corr < nCorr; corr++)
|
||||||
{
|
{
|
||||||
U = rUA*UEqn.H();
|
U = rUA*UEqn.H();
|
||||||
|
|
||||||
// Execute ddtPhiCorr before recalculating flux
|
|
||||||
// HJ, 27/Apr/2010
|
|
||||||
surfaceScalarField phid
|
|
||||||
(
|
|
||||||
"phid",
|
|
||||||
fvc::interpolate(psi)*
|
|
||||||
(
|
|
||||||
(fvc::interpolate(U) & mesh.Sf())
|
|
||||||
+ fvc::ddtPhiCorr(rUA, rho, U, phi)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Calculate phi for boundary conditions
|
// Calculate phi for boundary conditions
|
||||||
phi = fvc::interpolate(rho*U) & mesh.Sf();
|
phi = rhof*fvc::interpolate(U) & mesh.Sf();
|
||||||
|
|
||||||
|
surfaceScalarField phid2 = rhoReff/rhof*phi;
|
||||||
|
|
||||||
|
surfaceScalarField phid("phid", psisf/rhof*phi);
|
||||||
|
|
||||||
p.storePrevIter();
|
p.storePrevIter();
|
||||||
|
|
||||||
|
@ -26,8 +25,9 @@
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psis, p)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
|
+ fvc::div(phid2)
|
||||||
- fvm::laplacian(rho*rUA, p)
|
- fvm::laplacian(rho*rUA, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -42,7 +42,7 @@
|
||||||
// Calculate the flux
|
// Calculate the flux
|
||||||
if (nonOrth == nNonOrthCorr)
|
if (nonOrth == nNonOrthCorr)
|
||||||
{
|
{
|
||||||
phi = pEqn.flux();
|
phi = phid2 + pEqn.flux();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -2,19 +2,19 @@
|
||||||
dictionary fieldBounds = mesh.solutionDict().subDict("fieldBounds");
|
dictionary fieldBounds = mesh.solutionDict().subDict("fieldBounds");
|
||||||
|
|
||||||
// Pressure bounds
|
// Pressure bounds
|
||||||
dimensionedScalar pMin("pMin", dimPressure, 0);
|
dimensionedScalar pMin("pMin", p.dimensions(), 0);
|
||||||
dimensionedScalar pMax("pMax", dimPressure, GREAT);
|
dimensionedScalar pMax("pMax", p.dimensions(), GREAT);
|
||||||
|
|
||||||
fieldBounds.lookup("p") >> pMin.value() >> pMax.value();
|
fieldBounds.lookup(p.name()) >> pMin.value() >> pMax.value();
|
||||||
|
|
||||||
// Temperature bounds
|
// Temperature bounds
|
||||||
dimensionedScalar TMin("TMin", dimTemperature, 0);
|
dimensionedScalar TMin("TMin", T.dimensions(), 0);
|
||||||
dimensionedScalar TMax("TMax", dimTemperature, GREAT);
|
dimensionedScalar TMax("TMax", T.dimensions(), GREAT);
|
||||||
|
|
||||||
fieldBounds.lookup("T") >> TMin.value() >> TMax.value();
|
fieldBounds.lookup(T.name()) >> TMin.value() >> TMax.value();
|
||||||
|
|
||||||
// Velocity bound
|
// Velocity bound
|
||||||
dimensionedScalar UMax("UMax", dimVelocity, GREAT);
|
dimensionedScalar UMax("UMax", U.dimensions(), GREAT);
|
||||||
|
|
||||||
fieldBounds.lookup(U.name()) >> UMax.value();
|
fieldBounds.lookup(U.name()) >> UMax.value();
|
||||||
dimensionedScalar smallU("smallU", dimVelocity, 1e-10);
|
dimensionedScalar smallU("smallU", dimVelocity, 1e-10);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
// Calculate density from pressure
|
// Calculate density from pressure
|
||||||
rho.storePrevIter();
|
rho.storePrevIter();
|
||||||
rho = thermo.rho();
|
rho = thermo.rho()();
|
||||||
|
|
||||||
// Bound rho
|
// Bound rho
|
||||||
volScalarField R = thermo.Cp() - thermo.Cv();
|
volScalarField R = thermo.Cp() - thermo.Cv();
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
volScalarField& p = thermo.p();
|
volScalarField& p = thermo.p();
|
||||||
volScalarField& h = thermo.h();
|
volScalarField& h = thermo.h();
|
||||||
const volScalarField& T = thermo.T();
|
const volScalarField& T = thermo.T();
|
||||||
const volScalarField& psi = thermo.psi();
|
volScalarField psis("psi", thermo.psi()/thermo.Cp()*thermo.Cv());
|
||||||
|
psis.oldTime();
|
||||||
|
|
||||||
volScalarField rho
|
volScalarField rho
|
||||||
(
|
(
|
||||||
|
|
|
@ -10,10 +10,9 @@
|
||||||
+ fvm::div(phi, h)
|
+ fvm::div(phi, h)
|
||||||
- fvm::laplacian(turbulence->alphaEff(), h)
|
- fvm::laplacian(turbulence->alphaEff(), h)
|
||||||
==
|
==
|
||||||
// Note: potential issue with reconstructed relative velocity.
|
|
||||||
// HJ, 12/Dec/2009
|
|
||||||
// fvc::div(faceU, p, "div(U,p)")
|
|
||||||
fvc::div(faceU + mrfZones.fluxCorrection(), p, "div(U,p)")
|
fvc::div(faceU + mrfZones.fluxCorrection(), p, "div(U,p)")
|
||||||
|
// Note: div flux correction is zero so there is no need to
|
||||||
|
// carry it. HJ, 4/Dec/2015
|
||||||
- p*fvc::div(faceU)
|
- p*fvc::div(faceU)
|
||||||
// Viscous heating: note sign (devRhoReff has a minus in it)
|
// Viscous heating: note sign (devRhoReff has a minus in it)
|
||||||
- (turbulence->devRhoReff() && fvc::grad(U))
|
- (turbulence->devRhoReff() && fvc::grad(U))
|
||||||
|
@ -24,12 +23,7 @@
|
||||||
eqnResidual = hEqn.solve().initialResidual();
|
eqnResidual = hEqn.solve().initialResidual();
|
||||||
maxResidual = max(eqnResidual, maxResidual);
|
maxResidual = max(eqnResidual, maxResidual);
|
||||||
|
|
||||||
// Bound the enthalpy using TMin and TMax
|
// Bounding of enthalpy taken out
|
||||||
volScalarField Cp = thermo.Cp();
|
|
||||||
|
|
||||||
h = Foam::min(h, TMax*Cp);
|
|
||||||
h = Foam::max(h, TMin*Cp);
|
|
||||||
h.correctBoundaryConditions();
|
|
||||||
|
|
||||||
thermo.correct();
|
thermo.correct();
|
||||||
|
psis = thermo.psi()/thermo.Cp()*thermo.Cv();
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,4 +53,5 @@
|
||||||
i = h - 0.5*magSqr(Urot);
|
i = h - 0.5*magSqr(Urot);
|
||||||
|
|
||||||
thermo.correct();
|
thermo.correct();
|
||||||
|
psis = thermo.psi()/thermo.Cp()*thermo.Cv();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,29 +1,27 @@
|
||||||
{
|
{
|
||||||
volScalarField rUA = 1.0/UEqn.A();
|
volScalarField rUA = 1.0/UEqn.A();
|
||||||
|
|
||||||
|
surfaceScalarField psisf = fvc::interpolate(psis);
|
||||||
|
surfaceScalarField rhof = fvc::interpolate(rho);
|
||||||
|
|
||||||
|
// Needs to be outside of loop since p is changing, but psi and rho are not.
|
||||||
|
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
|
||||||
|
|
||||||
for (int corr = 0; corr < nCorr; corr++)
|
for (int corr = 0; corr < nCorr; corr++)
|
||||||
{
|
{
|
||||||
U = rUA*UEqn.H();
|
U = rUA*UEqn.H();
|
||||||
|
|
||||||
surfaceScalarField psif = fvc::interpolate(psi);
|
|
||||||
surfaceScalarField rhof = fvc::interpolate(rho);
|
|
||||||
|
|
||||||
// Execute ddtPhiCorr before recalculating flux
|
|
||||||
// HJ, 27/Apr/2010
|
|
||||||
surfaceScalarField phid
|
|
||||||
(
|
|
||||||
"phid",
|
|
||||||
psif*(fvc::interpolate(U) & mesh.Sf())
|
|
||||||
);
|
|
||||||
|
|
||||||
// Make flux relative within the MRF zone
|
|
||||||
mrfZones.relativeFlux(psif, phid);
|
|
||||||
|
|
||||||
// Calculate phi for boundary conditions
|
// Calculate phi for boundary conditions
|
||||||
phi = fvc::interpolate(rho*U) & mesh.Sf();
|
phi = rhof*fvc::interpolate(U) & mesh.Sf();
|
||||||
|
|
||||||
// Make flux relative within the MRF zone
|
surfaceScalarField phid2 = rhoReff/rhof*phi;
|
||||||
mrfZones.relativeFlux(rhof, phi);
|
|
||||||
|
surfaceScalarField phid("phid", psisf/rhof*phi);
|
||||||
|
|
||||||
|
// Make fluxes relative within the MRF zone
|
||||||
|
mrfZones.relativeFlux(rhoReff, phi);
|
||||||
|
mrfZones.relativeFlux(psisf, phid);
|
||||||
|
mrfZones.relativeFlux(rhoReff, phid2);
|
||||||
|
|
||||||
p.storePrevIter();
|
p.storePrevIter();
|
||||||
|
|
||||||
|
@ -31,8 +29,9 @@
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psis, p)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
|
+ fvc::div(phid2)
|
||||||
- fvm::laplacian(rho*rUA, p)
|
- fvm::laplacian(rho*rUA, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -47,13 +46,13 @@
|
||||||
// Calculate the flux
|
// Calculate the flux
|
||||||
if (nonOrth == nNonOrthCorr)
|
if (nonOrth == nNonOrthCorr)
|
||||||
{
|
{
|
||||||
phi = pEqn.flux();
|
phi = phid2 + pEqn.flux();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# include "compressibleContinuityErrs.H"
|
# include "compressibleContinuityErrs.H"
|
||||||
|
|
||||||
// Explicitly relax the pressure for momentum corrector
|
// Relax the pressure
|
||||||
p.relax();
|
p.relax();
|
||||||
|
|
||||||
U -= rUA*fvc::grad(p);
|
U -= rUA*fvc::grad(p);
|
||||||
|
|
|
@ -2,19 +2,19 @@
|
||||||
dictionary fieldBounds = mesh.solutionDict().subDict("fieldBounds");
|
dictionary fieldBounds = mesh.solutionDict().subDict("fieldBounds");
|
||||||
|
|
||||||
// Pressure bounds
|
// Pressure bounds
|
||||||
dimensionedScalar pMin("pMin", dimPressure, 0);
|
dimensionedScalar pMin("pMin", p.dimensions(), 0);
|
||||||
dimensionedScalar pMax("pMax", dimPressure, GREAT);
|
dimensionedScalar pMax("pMax", p.dimensions(), GREAT);
|
||||||
|
|
||||||
fieldBounds.lookup("p") >> pMin.value() >> pMax.value();
|
fieldBounds.lookup(p.name()) >> pMin.value() >> pMax.value();
|
||||||
|
|
||||||
// Temperature bounds
|
// Temperature bounds
|
||||||
dimensionedScalar TMin("TMin", dimTemperature, 0);
|
dimensionedScalar TMin("TMin", T.dimensions(), 0);
|
||||||
dimensionedScalar TMax("TMax", dimTemperature, GREAT);
|
dimensionedScalar TMax("TMax", T.dimensions(), GREAT);
|
||||||
|
|
||||||
fieldBounds.lookup("T") >> TMin.value() >> TMax.value();
|
fieldBounds.lookup(T.name()) >> TMin.value() >> TMax.value();
|
||||||
|
|
||||||
// Velocity bound
|
// Velocity bound
|
||||||
dimensionedScalar UMax("UMax", dimVelocity, GREAT);
|
dimensionedScalar UMax("UMax", U.dimensions(), GREAT);
|
||||||
|
|
||||||
fieldBounds.lookup(U.name()) >> UMax.value();
|
fieldBounds.lookup(U.name()) >> UMax.value();
|
||||||
dimensionedScalar smallU("smallU", dimVelocity, 1e-10);
|
dimensionedScalar smallU("smallU", dimVelocity, 1e-10);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
// Calculate density from pressure
|
// Calculate density from pressure
|
||||||
rho.storePrevIter();
|
rho.storePrevIter();
|
||||||
rho = thermo.rho();
|
rho = thermo.rho()();
|
||||||
|
|
||||||
// Bound rho
|
// Bound rho
|
||||||
volScalarField R = thermo.Cp() - thermo.Cv();
|
volScalarField R = thermo.Cp() - thermo.Cv();
|
||||||
|
|
|
@ -9,7 +9,8 @@
|
||||||
volScalarField& p = thermo.p();
|
volScalarField& p = thermo.p();
|
||||||
volScalarField& h = thermo.h();
|
volScalarField& h = thermo.h();
|
||||||
const volScalarField& T = thermo.T();
|
const volScalarField& T = thermo.T();
|
||||||
const volScalarField& psi = thermo.psi();
|
volScalarField psis("psi", thermo.psi()/thermo.Cp()*thermo.Cv());
|
||||||
|
psis.oldTime();
|
||||||
|
|
||||||
volScalarField rho
|
volScalarField rho
|
||||||
(
|
(
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
{
|
{
|
||||||
// Solve the enthalpy equation
|
// Solve the rothalpy equation
|
||||||
T.storePrevIter();
|
T.storePrevIter();
|
||||||
|
|
||||||
// Calculate face velocity from flux
|
// Calculate face velocity from flux
|
||||||
|
@ -14,10 +14,10 @@
|
||||||
fvm::ddt(rho, i)
|
fvm::ddt(rho, i)
|
||||||
+ fvm::div(phi, i)
|
+ fvm::div(phi, i)
|
||||||
- fvm::laplacian(turbulence->alphaEff(), i)
|
- fvm::laplacian(turbulence->alphaEff(), i)
|
||||||
// u & gradP term (steady-state formulation)
|
|
||||||
+ fvm::SuSp((fvc::div(faceU, p, "div(U,p)") - p*fvc::div(faceU))/i, i)
|
|
||||||
==
|
==
|
||||||
// ddt(p) term removed: steady-state. HJ, 27/Apr/2010
|
// ddt(p) term removed: steady-state. HJ, 27/Apr/2010
|
||||||
|
fvc::div(faceU, p, "div(U,p)")
|
||||||
|
- p*fvc::div(faceU)
|
||||||
// Viscous heating: note sign (devRhoReff has a minus in it)
|
// Viscous heating: note sign (devRhoReff has a minus in it)
|
||||||
- (turbulence->devRhoReff() && fvc::grad(Urel))
|
- (turbulence->devRhoReff() && fvc::grad(Urel))
|
||||||
);
|
);
|
||||||
|
@ -33,15 +33,10 @@
|
||||||
h = i + 0.5*magSqr(Urot);
|
h = i + 0.5*magSqr(Urot);
|
||||||
h.correctBoundaryConditions();
|
h.correctBoundaryConditions();
|
||||||
|
|
||||||
// Bound the enthalpy using TMin and TMax
|
|
||||||
volScalarField Cp = thermo.Cp();
|
|
||||||
|
|
||||||
h = Foam::min(h, TMax*Cp);
|
|
||||||
h = Foam::max(h, TMin*Cp);
|
|
||||||
h.correctBoundaryConditions();
|
|
||||||
|
|
||||||
// Re-initialise rothalpy based on limited enthalpy
|
// Re-initialise rothalpy based on limited enthalpy
|
||||||
i = h - 0.5*magSqr(Urot);
|
i = h - 0.5*magSqr(Urot);
|
||||||
|
|
||||||
|
// Bounding of enthalpy taken out
|
||||||
thermo.correct();
|
thermo.correct();
|
||||||
|
psis = thermo.psi()/thermo.Cp()*thermo.Cv();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,24 +1,22 @@
|
||||||
{
|
{
|
||||||
volScalarField rUrelA = 1.0/UrelEqn.A();
|
volScalarField rUrelA = 1.0/UrelEqn.A();
|
||||||
|
|
||||||
|
surfaceScalarField psisf = fvc::interpolate(psis);
|
||||||
|
surfaceScalarField rhof = fvc::interpolate(rho);
|
||||||
|
|
||||||
|
// Needs to be outside of loop since p is changing, but psi and rho are not.
|
||||||
|
surfaceScalarField rhoReff = rhof - psisf*fvc::interpolate(p);
|
||||||
|
|
||||||
for (int corr = 0; corr < nCorr; corr++)
|
for (int corr = 0; corr < nCorr; corr++)
|
||||||
{
|
{
|
||||||
Urel = rUrelA*UrelEqn.H();
|
Urel = rUrelA*UrelEqn.H();
|
||||||
|
|
||||||
// Execute ddtPhiCorr before recalculating flux
|
|
||||||
// HJ, 27/Apr/2010
|
|
||||||
surfaceScalarField phid
|
|
||||||
(
|
|
||||||
"phid",
|
|
||||||
fvc::interpolate(thermo.psi())*
|
|
||||||
(
|
|
||||||
(fvc::interpolate(Urel) & mesh.Sf())
|
|
||||||
+ fvc::ddtPhiCorr(rUrelA, rho, Urel, phi)
|
|
||||||
)
|
|
||||||
);
|
|
||||||
|
|
||||||
// Calculate phi for boundary conditions
|
// Calculate phi for boundary conditions
|
||||||
phi = fvc::interpolate(rho*Urel) & mesh.Sf();
|
phi = rhof*fvc::interpolate(Urel) & mesh.Sf();
|
||||||
|
|
||||||
|
surfaceScalarField phid2 = rhoReff/rhof*phi;
|
||||||
|
|
||||||
|
surfaceScalarField phid("phid", psisf/rhof*phi);
|
||||||
|
|
||||||
p.storePrevIter();
|
p.storePrevIter();
|
||||||
|
|
||||||
|
@ -26,8 +24,9 @@
|
||||||
{
|
{
|
||||||
fvScalarMatrix pEqn
|
fvScalarMatrix pEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(psi, p)
|
fvm::ddt(psis, p)
|
||||||
+ fvm::div(phid, p)
|
+ fvm::div(phid, p)
|
||||||
|
+ fvc::div(phid2)
|
||||||
- fvm::laplacian(rho*rUrelA, p)
|
- fvm::laplacian(rho*rUrelA, p)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -42,14 +41,13 @@
|
||||||
// Calculate the flux
|
// Calculate the flux
|
||||||
if (nonOrth == nNonOrthCorr)
|
if (nonOrth == nNonOrthCorr)
|
||||||
{
|
{
|
||||||
phi = pEqn.flux();
|
phi = phid2 + pEqn.flux();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
# include "compressibleContinuityErrs.H"
|
# include "compressibleContinuityErrs.H"
|
||||||
|
|
||||||
|
// Relax the pressure
|
||||||
// Explicitly relax the pressure for momentum corrector
|
|
||||||
p.relax();
|
p.relax();
|
||||||
|
|
||||||
Urel -= rUrelA*fvc::grad(p);
|
Urel -= rUrelA*fvc::grad(p);
|
||||||
|
|
|
@ -2,19 +2,19 @@
|
||||||
dictionary fieldBounds = mesh.solutionDict().subDict("fieldBounds");
|
dictionary fieldBounds = mesh.solutionDict().subDict("fieldBounds");
|
||||||
|
|
||||||
// Pressure bounds
|
// Pressure bounds
|
||||||
dimensionedScalar pMin("pMin", dimPressure, 0);
|
dimensionedScalar pMin("pMin", p.dimensions(), 0);
|
||||||
dimensionedScalar pMax("pMax", dimPressure, GREAT);
|
dimensionedScalar pMax("pMax", p.dimensions(), GREAT);
|
||||||
|
|
||||||
fieldBounds.lookup("p") >> pMin.value() >> pMax.value();
|
fieldBounds.lookup(p.name()) >> pMin.value() >> pMax.value();
|
||||||
|
|
||||||
// Temperature bounds
|
// Temperature bounds
|
||||||
dimensionedScalar TMin("TMin", dimTemperature, 0);
|
dimensionedScalar TMin("TMin", T.dimensions(), 0);
|
||||||
dimensionedScalar TMax("TMax", dimTemperature, GREAT);
|
dimensionedScalar TMax("TMax", T.dimensions(), GREAT);
|
||||||
|
|
||||||
fieldBounds.lookup("T") >> TMin.value() >> TMax.value();
|
fieldBounds.lookup(T.name()) >> TMin.value() >> TMax.value();
|
||||||
|
|
||||||
// Velocity bound
|
// Velocity bound
|
||||||
dimensionedScalar UrelMax("UrelMax", dimVelocity, GREAT);
|
dimensionedScalar UrelMax("UrelMax", Urel.dimensions(), GREAT);
|
||||||
|
|
||||||
fieldBounds.lookup(Urel.name()) >> UrelMax.value();
|
fieldBounds.lookup(Urel.name()) >> UrelMax.value();
|
||||||
dimensionedScalar smallUrel("smallUrel", dimVelocity, 1e-10);
|
dimensionedScalar smallUrel("smallUrel", dimVelocity, 1e-10);
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
// Calculate density from pressure
|
// Calculate density from pressure
|
||||||
rho.storePrevIter();
|
rho.storePrevIter();
|
||||||
rho = thermo.rho();
|
rho = thermo.rho()();
|
||||||
|
|
||||||
// Bound rho
|
// Bound rho
|
||||||
volScalarField R = thermo.Cp() - thermo.Cv();
|
volScalarField R = thermo.Cp() - thermo.Cv();
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
// Momentum equation
|
// Momentum equation
|
||||||
fvVectorMatrix UEqn
|
tmp<fvVectorMatrix> UEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(U)
|
fvm::ddt(U)
|
||||||
+ fvm::div(phi, U)
|
+ fvm::div(phi, U)
|
||||||
|
@ -7,9 +7,9 @@
|
||||||
);
|
);
|
||||||
|
|
||||||
// Add MRF and porous sources
|
// Add MRF and porous sources
|
||||||
mrfZones.addCoriolis(UEqn);
|
mrfZones.addCoriolis(UEqn());
|
||||||
pZones.addResistance(UEqn);
|
pZones.addResistance(UEqn());
|
||||||
|
|
||||||
UEqn.relax();
|
UEqn().relax();
|
||||||
|
|
||||||
UpEqn.insertEquation(0, UEqn);
|
UpEqn.insertEquation(0, UEqn());
|
||||||
|
|
|
@ -2,9 +2,11 @@
|
||||||
surfaceScalarField rUAf
|
surfaceScalarField rUAf
|
||||||
(
|
(
|
||||||
"rUAf",
|
"rUAf",
|
||||||
fvc::interpolate(1.0/UEqn.A())
|
fvc::interpolate(1.0/UEqn().A())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
UEqn.clear();
|
||||||
|
|
||||||
surfaceScalarField presSource
|
surfaceScalarField presSource
|
||||||
(
|
(
|
||||||
"presSource",
|
"presSource",
|
||||||
|
|
|
@ -1,11 +1,11 @@
|
||||||
// Momentum equation
|
// Momentum equation
|
||||||
fvVectorMatrix UEqn
|
tmp<fvVectorMatrix> UEqn
|
||||||
(
|
(
|
||||||
fvm::ddt(U)
|
fvm::ddt(U)
|
||||||
+ fvm::div(phi, U)
|
+ fvm::div(phi, U)
|
||||||
+ turbulence->divDevReff(U)
|
+ turbulence->divDevReff(U)
|
||||||
);
|
);
|
||||||
|
|
||||||
UEqn.relax();
|
UEqn().relax();
|
||||||
|
|
||||||
UpEqn.insertEquation(0, UEqn);
|
UpEqn.insertEquation(0, UEqn());
|
||||||
|
|
|
@ -2,9 +2,11 @@
|
||||||
surfaceScalarField rUAf
|
surfaceScalarField rUAf
|
||||||
(
|
(
|
||||||
"rUAf",
|
"rUAf",
|
||||||
fvc::interpolate(1.0/UEqn.A())
|
fvc::interpolate(1.0/UEqn().A())
|
||||||
);
|
);
|
||||||
|
|
||||||
|
UEqn.clear();
|
||||||
|
|
||||||
surfaceScalarField presSource
|
surfaceScalarField presSource
|
||||||
(
|
(
|
||||||
"presSource",
|
"presSource",
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
// Solve the Momentum equation
|
// Solve the momentum equation
|
||||||
|
|
||||||
tmp<fvVectorMatrix> UEqn
|
tmp<fvVectorMatrix> UEqn
|
||||||
(
|
(
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
if(divSigmaExpMethod == "standard")
|
if (divSigmaExpMethod == "standard")
|
||||||
{
|
{
|
||||||
divSigmaExp = fvc::div
|
divSigmaExp = fvc::div
|
||||||
(
|
(
|
||||||
|
|
|
@ -52,6 +52,7 @@ int main(int argc, char *argv[])
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createMesh.H"
|
# include "createMesh.H"
|
||||||
|
# include "readGravitationalAcceleration.H"
|
||||||
# include "createFields.H"
|
# include "createFields.H"
|
||||||
# include "createHistory.H"
|
# include "createHistory.H"
|
||||||
# include "readDivSigmaExpMethod.H"
|
# include "readDivSigmaExpMethod.H"
|
||||||
|
@ -71,7 +72,7 @@ int main(int argc, char *argv[])
|
||||||
lduMatrix::solverPerformance solverPerf;
|
lduMatrix::solverPerformance solverPerf;
|
||||||
scalar initialResidual = 1.0;
|
scalar initialResidual = 1.0;
|
||||||
scalar relativeResidual = 1.0;
|
scalar relativeResidual = 1.0;
|
||||||
lduMatrix::debug = 0;
|
// lduMatrix::debug = 0;
|
||||||
|
|
||||||
if (predictor)
|
if (predictor)
|
||||||
{
|
{
|
||||||
|
@ -95,6 +96,7 @@ int main(int argc, char *argv[])
|
||||||
==
|
==
|
||||||
fvm::laplacian(2*muf + lambdaf, U, "laplacian(DU,U)")
|
fvm::laplacian(2*muf + lambdaf, U, "laplacian(DU,U)")
|
||||||
+ divSigmaExp
|
+ divSigmaExp
|
||||||
|
+ rho*g
|
||||||
);
|
);
|
||||||
|
|
||||||
if (solidInterfaceCorr)
|
if (solidInterfaceCorr)
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
if (runTime.outputTime())
|
if (runTime.outputTime())
|
||||||
{
|
{
|
||||||
volScalarField epsilonEq
|
volScalarField epsilonEq
|
||||||
(
|
(
|
||||||
IOobject
|
IOobject
|
||||||
|
@ -32,79 +32,5 @@ if (runTime.outputTime())
|
||||||
Info<< "Max sigmaEq = " << max(sigmaEq).value()
|
Info<< "Max sigmaEq = " << max(sigmaEq).value()
|
||||||
<< endl;
|
<< endl;
|
||||||
|
|
||||||
//- boundary traction
|
|
||||||
// volVectorField traction
|
|
||||||
// (
|
|
||||||
// IOobject
|
|
||||||
// (
|
|
||||||
// "traction",
|
|
||||||
// runTime.timeName(),
|
|
||||||
// mesh,
|
|
||||||
// IOobject::NO_READ,
|
|
||||||
// IOobject::AUTO_WRITE
|
|
||||||
// ),
|
|
||||||
// mesh,
|
|
||||||
// dimensionedVector("zero", dimForce/dimArea, vector::zero)
|
|
||||||
// );
|
|
||||||
// forAll(traction.boundaryField(), patchi)
|
|
||||||
// {
|
|
||||||
// traction.boundaryField()[patchi] =
|
|
||||||
// n.boundaryField()[patchi] & sigma.boundaryField()[patchi];
|
|
||||||
// }
|
|
||||||
|
|
||||||
// contact fields
|
|
||||||
// if(contactBoundaries)
|
|
||||||
// {
|
|
||||||
// volScalarField stickSlipFaces
|
|
||||||
// (
|
|
||||||
// IOobject
|
|
||||||
// (
|
|
||||||
// "stickSlipFaces",
|
|
||||||
// runTime.timeName(),
|
|
||||||
// mesh,
|
|
||||||
// IOobject::NO_READ,
|
|
||||||
// IOobject::AUTO_WRITE
|
|
||||||
// ),
|
|
||||||
// mesh,
|
|
||||||
// dimensionedScalar("zero", dimless, 0.0)
|
|
||||||
// );
|
|
||||||
// forAll(stickSlipFaces.boundaryField(), patchi)
|
|
||||||
// {
|
|
||||||
// if(U.boundaryField()[patchi].type()
|
|
||||||
// ==
|
|
||||||
// solidContactFvPatchVectorField::typeName)
|
|
||||||
// {
|
|
||||||
// const solidContactFvPatchVectorField& Upatch =
|
|
||||||
// refCast<const solidContactFvPatchVectorField>
|
|
||||||
// (U.boundaryField()[patchi]);
|
|
||||||
|
|
||||||
// if(!Upatch.master())
|
|
||||||
// {
|
|
||||||
// stickSlipFaces.boundaryField()[patchi] =
|
|
||||||
// Upatch.frictionContactModelPtr()->stickSlipFaces();
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// stickSlipFaces.write();
|
|
||||||
// }
|
|
||||||
|
|
||||||
|
|
||||||
//- boundary forces
|
|
||||||
// Info << nl;
|
|
||||||
// forAll(mesh.boundary(), patchi)
|
|
||||||
// {
|
|
||||||
// Info << "Patch " << mesh.boundary()[patchi].name() << endl;
|
|
||||||
// vectorField totalForce = mesh.Sf().boundaryField()[patchi] & sigma.boundaryField()[patchi];
|
|
||||||
|
|
||||||
// vector force = sum( totalForce );
|
|
||||||
// Info << "\ttotal force is " << force << " N" << endl;
|
|
||||||
|
|
||||||
// const vectorField& nb = n.boundaryField()[patchi];
|
|
||||||
// scalar normalForce = sum( nb & totalForce );
|
|
||||||
// Info << "\tnormal force is " << normalForce << " N" << endl;
|
|
||||||
// scalar shearForce = mag(sum( (I - sqr(nb)) & totalForce ));
|
|
||||||
// Info << "\tshear force is " << shearForce << " N" << endl;
|
|
||||||
// }
|
|
||||||
|
|
||||||
runTime.write();
|
runTime.write();
|
||||||
}
|
}
|
||||||
|
|
|
@ -30,41 +30,41 @@ Description
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
#include "argList.H"
|
#include "fvCFD.H"
|
||||||
#include "fvMesh.H"
|
|
||||||
#include "pointFields.H"
|
#include "pointFields.H"
|
||||||
#include "IStringStream.H"
|
#include "IStringStream.H"
|
||||||
#include "volPointInterpolation.H"
|
#include "volPointInterpolation.H"
|
||||||
|
|
||||||
using namespace Foam;
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
timeSelector::addOptions();
|
||||||
|
|
||||||
|
# include "addRegionOption.H"
|
||||||
|
|
||||||
argList::validArgs.append("scaling factor");
|
argList::validArgs.append("scaling factor");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
|
# include "createTime.H"
|
||||||
|
# include "createNamedMesh.H"
|
||||||
|
|
||||||
scalar scaleFactor(readScalar(IStringStream(args.additionalArgs()[0])()));
|
scalar scaleFactor(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||||
|
|
||||||
# include "createTime.H"
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
# include "createMesh.H"
|
|
||||||
|
|
||||||
volPointInterpolation pInterp(mesh);
|
volPointInterpolation pInterp(mesh);
|
||||||
|
|
||||||
// Get times list
|
|
||||||
instantList Times = runTime.times();
|
|
||||||
|
|
||||||
pointField zeroPoints(mesh.points());
|
pointField zeroPoints(mesh.points());
|
||||||
|
|
||||||
// skip "constant" time
|
forAll(timeDirs, timeI)
|
||||||
for (label timeI = 1; timeI < Times.size(); ++timeI)
|
|
||||||
{
|
{
|
||||||
runTime.setTime(Times[timeI], timeI);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
Info<< "Time = " << runTime.timeName() << endl;
|
||||||
|
|
||||||
|
fvMesh::readUpdateState state = mesh.readUpdate();
|
||||||
|
|
||||||
IOobject Uheader
|
IOobject Uheader
|
||||||
(
|
(
|
||||||
"U",
|
"U",
|
||||||
|
|
|
@ -32,6 +32,7 @@ Description
|
||||||
|
|
||||||
#include "argList.H"
|
#include "argList.H"
|
||||||
#include "polyMesh.H"
|
#include "polyMesh.H"
|
||||||
|
#include "timeSelector.H"
|
||||||
#include "pointFields.H"
|
#include "pointFields.H"
|
||||||
#include "tetFemMatrix.H"
|
#include "tetFemMatrix.H"
|
||||||
#include "tetPointFields.H"
|
#include "tetPointFields.H"
|
||||||
|
@ -43,30 +44,32 @@ using namespace Foam;
|
||||||
|
|
||||||
int main(int argc, char *argv[])
|
int main(int argc, char *argv[])
|
||||||
{
|
{
|
||||||
|
timeSelector::addOptions();
|
||||||
|
|
||||||
|
# include "addRegionOption.H"
|
||||||
|
|
||||||
argList::validArgs.append("scaling factor");
|
argList::validArgs.append("scaling factor");
|
||||||
|
|
||||||
# include "setRootCase.H"
|
# include "setRootCase.H"
|
||||||
|
|
||||||
scalar scaleFactor(readScalar(IStringStream(args.additionalArgs()[0])()));
|
|
||||||
|
|
||||||
# include "createTime.H"
|
# include "createTime.H"
|
||||||
# include "createPolyMesh.H"
|
# include "createPolyMesh.H"
|
||||||
|
|
||||||
tetPolyMesh tetMesh(mesh);
|
scalar scaleFactor(readScalar(IStringStream(args.additionalArgs()[0])()));
|
||||||
|
|
||||||
// Get times list
|
instantList timeDirs = timeSelector::select0(runTime, args);
|
||||||
instantList Times = runTime.times();
|
|
||||||
|
tetPolyMesh tetMesh(mesh);
|
||||||
|
|
||||||
pointField zeroPoints(mesh.points());
|
pointField zeroPoints(mesh.points());
|
||||||
|
|
||||||
runTime.setTime(Times[0], 0);
|
forAll(timeDirs, timeI)
|
||||||
|
|
||||||
for (int i = 1; i<Times.size(); i++)
|
|
||||||
{
|
{
|
||||||
runTime.setTime(Times[i], i);
|
runTime.setTime(timeDirs[timeI], timeI);
|
||||||
|
|
||||||
Info<< "Time = " << runTime.timeName() << endl;
|
Info<< "Time = " << runTime.timeName() << endl;
|
||||||
|
|
||||||
|
polyMesh::readUpdateState state = mesh.readUpdate();
|
||||||
|
|
||||||
IOobject Uheader
|
IOobject Uheader
|
||||||
(
|
(
|
||||||
"U",
|
"U",
|
||||||
|
|
|
@ -10,6 +10,7 @@ print 'Reading file', logfilename
|
||||||
|
|
||||||
import re
|
import re
|
||||||
UpRegex=r"([A-Z,a-z]*):*.*Solving for Up, Initial residual = \(([0-9.Ee\-+]*)\s([0-9.Ee\-+]*)\s([0-9.Ee\-+]*)\s([0-9.Ee\-+]*)\), Final residual = \(([0-9.Ee\-+]*)\s([0-9.Ee\-+]*)\s([0-9.Ee\-+]*)\s([0-9.Ee\-+]*)\), No Iterations ([0-9]*)"
|
UpRegex=r"([A-Z,a-z]*):*.*Solving for Up, Initial residual = \(([0-9.Ee\-+]*)\s([0-9.Ee\-+]*)\s([0-9.Ee\-+]*)\s([0-9.Ee\-+]*)\), Final residual = \(([0-9.Ee\-+]*)\s([0-9.Ee\-+]*)\s([0-9.Ee\-+]*)\s([0-9.Ee\-+]*)\), No Iterations ([0-9]*)"
|
||||||
|
kepsilonRegex=r"([A-Z,a-z]*):*.*Solving for kEpsilon, Initial residual = \(([0-9.Ee\-+]*)\s([0-9.Ee\-+]*)\), Final residual = \(([0-9.Ee\-+]*)\s([0-9.Ee\-+]*)\), No Iterations ([0-9]*)"
|
||||||
komegaRegex=r"([A-Z,a-z]*):*.*Solving for kOmega, Initial residual = \(([0-9.Ee\-+]*)\s([0-9.Ee\-+]*)\), Final residual = \(([0-9.Ee\-+]*)\s([0-9.Ee\-+]*)\), No Iterations ([0-9]*)"
|
komegaRegex=r"([A-Z,a-z]*):*.*Solving for kOmega, Initial residual = \(([0-9.Ee\-+]*)\s([0-9.Ee\-+]*)\), Final residual = \(([0-9.Ee\-+]*)\s([0-9.Ee\-+]*)\), No Iterations ([0-9]*)"
|
||||||
|
|
||||||
tUp = []
|
tUp = []
|
||||||
|
@ -24,6 +25,11 @@ k = []
|
||||||
omega = []
|
omega = []
|
||||||
ikomega = 0
|
ikomega = 0
|
||||||
|
|
||||||
|
tkepsilon = []
|
||||||
|
k = []
|
||||||
|
epsilon = []
|
||||||
|
ikepsilon = 0
|
||||||
|
|
||||||
#HJ take name of log file as script argument
|
#HJ take name of log file as script argument
|
||||||
pipefile=open(logfilename,'r')
|
pipefile=open(logfilename,'r')
|
||||||
lines = pipefile.readlines()
|
lines = pipefile.readlines()
|
||||||
|
@ -37,6 +43,12 @@ for line in lines:
|
||||||
Uy.append(float(matchUp.group(3)))
|
Uy.append(float(matchUp.group(3)))
|
||||||
Uz.append(float(matchUp.group(4)))
|
Uz.append(float(matchUp.group(4)))
|
||||||
p.append(float(matchUp.group(5)))
|
p.append(float(matchUp.group(5)))
|
||||||
|
matchkepsilon=re.search(kepsilonRegex,line)
|
||||||
|
if matchkepsilon:
|
||||||
|
ikepsilon = ikepsilon + 1
|
||||||
|
tkepsilon.append(ikepsilon)
|
||||||
|
k.append(float(matchkepsilon.group(2)))
|
||||||
|
epsilon.append(float(matchkepsilon.group(3)))
|
||||||
matchkomega=re.search(komegaRegex,line)
|
matchkomega=re.search(komegaRegex,line)
|
||||||
if matchkomega:
|
if matchkomega:
|
||||||
ikomega = ikomega + 1
|
ikomega = ikomega + 1
|
||||||
|
@ -46,15 +58,15 @@ for line in lines:
|
||||||
|
|
||||||
outfile=open('residual.dat','w')
|
outfile=open('residual.dat','w')
|
||||||
|
|
||||||
print 'hits = ', ikomega
|
|
||||||
|
|
||||||
#HJ need better way of combining lists
|
|
||||||
if ikomega > 0:
|
if ikomega > 0:
|
||||||
for index in range(0,ikomega):
|
for data in zip(tUp,Ux,Uy,Uz,p,k,omega):
|
||||||
outfile.write(str(tUp[index])+' '+str(Ux[index])+' '+str(Uy[index])+' '+str(Uz[index])+' '+str(p[index])+' '+str(k[index])+' '+str(omega[index])+'\n')
|
outfile.write(' '.join([str(d) for d in data])+'\n')
|
||||||
|
elif ikepsilon > 0:
|
||||||
|
for data in zip(tUp,Ux,Uy,Uz,p,k,epsilon):
|
||||||
|
outfile.write(' '.join([str(d) for d in data])+'\n')
|
||||||
elif iUp > 0:
|
elif iUp > 0:
|
||||||
for index in range(0,iUp):
|
for data in zip(tUp,Ux,Uy,Uz,p):
|
||||||
outfile.write(str(tUp[index])+' '+str(Ux[index])+' '+str(Uy[index])+' '+str(Uz[index])+' '+str(p[index])+'\n')
|
outfile.write(' '.join([str(d) for d in data])+'\n')
|
||||||
|
|
||||||
outfile.close()
|
outfile.close()
|
||||||
|
|
||||||
|
@ -71,6 +83,10 @@ if iUp > 0:
|
||||||
pylab.semilogy(tUp,Uz,'-',label="Uz")
|
pylab.semilogy(tUp,Uz,'-',label="Uz")
|
||||||
pylab.semilogy(tUp,p,'-',label="p")
|
pylab.semilogy(tUp,p,'-',label="p")
|
||||||
|
|
||||||
|
if ikepsilon > 0:
|
||||||
|
pylab.semilogy(tkepsilon,k,'-',label="k")
|
||||||
|
pylab.semilogy(tkepsilon,epsilon,'-',label="epsilon")
|
||||||
|
|
||||||
if ikomega > 0:
|
if ikomega > 0:
|
||||||
pylab.semilogy(tkomega,k,'-',label="k")
|
pylab.semilogy(tkomega,k,'-',label="k")
|
||||||
pylab.semilogy(tkomega,omega,'-',label="omega")
|
pylab.semilogy(tkomega,omega,'-',label="omega")
|
||||||
|
|
|
@ -64,16 +64,15 @@ for line in lines:
|
||||||
|
|
||||||
outfile=open('residual.dat','w')
|
outfile=open('residual.dat','w')
|
||||||
|
|
||||||
#HJ need better way of combining lists
|
|
||||||
if iomega > 0:
|
if iomega > 0:
|
||||||
for index in range(0,iomega):
|
for data in zip(tUp,Ux,Uy,Uz,p,k,omega):
|
||||||
outfile.write(str(tUp[index])+' '+str(Ux[index])+' '+str(Uy[index])+' '+str(Uz[index])+' '+str(p[index])+' '+str(k[index])+' '+str(omega[index])+'\n')
|
outfile.write(' '.join([str(d) for d in data])+'\n')
|
||||||
elif iepsilon > 0:
|
elif iepsilon > 0:
|
||||||
for index in range(0,iepsilon):
|
for data in zip(tUp,Ux,Uy,Uz,p,k,epsilon):
|
||||||
outfile.write(str(tUp[index])+' '+str(Ux[index])+' '+str(Uy[index])+' '+str(Uz[index])+' '+str(p[index])+' '+str(k[index])+' '+str(epsilon[index])+'\n')
|
outfile.write(' '.join([str(d) for d in data])+'\n')
|
||||||
elif iUp > 0:
|
elif iUp > 0:
|
||||||
for index in range(0,iUp):
|
for data in zip(tUp,Ux,Uy,Uz,p):
|
||||||
outfile.write(str(tUp[index])+' '+str(Ux[index])+' '+str(Uy[index])+' '+str(Uz[index])+' '+str(p[index])+'\n')
|
outfile.write(' '.join([str(d) for d in data])+'\n')
|
||||||
|
|
||||||
outfile.close()
|
outfile.close()
|
||||||
|
|
||||||
|
|
146
doc/buildInstructions/ArchLinux/ArchLinux_Raspberry_Pi.txt
Normal file
146
doc/buildInstructions/ArchLinux/ArchLinux_Raspberry_Pi.txt
Normal file
|
@ -0,0 +1,146 @@
|
||||||
|
Below are the build instructions for Arch Linux over the Raspberry Pi
|
||||||
|
|
||||||
|
These instructions assume that your Arch Linux installation is up and running on
|
||||||
|
the Raspberry Pi with full network access. If not, please visit the following
|
||||||
|
Web sites for further instructions. As always, Google will also be your friend.
|
||||||
|
https://www.raspberrypi.org/documentation/
|
||||||
|
https://wiki.archlinux.org/index.php/Raspberry_Pi
|
||||||
|
|
||||||
|
|
||||||
|
* Update your Arch Linux installation:
|
||||||
|
|
||||||
|
sudo pacman -Syu
|
||||||
|
|
||||||
|
* Install required packages:
|
||||||
|
|
||||||
|
pacman -S git gcc cmake bison flex make openmpi --needed base-devel
|
||||||
|
|
||||||
|
* Create the foam-extend installation directory:
|
||||||
|
|
||||||
|
These instructions assume that you install in the default location, which is
|
||||||
|
~/foam/ . Create this folder with:
|
||||||
|
|
||||||
|
mkdir ~/foam
|
||||||
|
|
||||||
|
* Obtain and unpack source code (if you read this, you probably already have):
|
||||||
|
|
||||||
|
The recommended way is to get the source code through git source code
|
||||||
|
management system. This way, you can get updates and bugfixes easily by running
|
||||||
|
"git pull". To install into the default location run:
|
||||||
|
|
||||||
|
cd ~/foam
|
||||||
|
git clone git://git.code.sf.net/p/foam-extend/foam-extend-3.2
|
||||||
|
|
||||||
|
* For Arch Linux, you need to customize your file etc/prefs.sh in order to enable
|
||||||
|
the usage of system-provided packages, and to enable the compilation of other.
|
||||||
|
|
||||||
|
Here is a list of commands that will do just that. You can copy/paste
|
||||||
|
the following block of commands in a control terminal in order to make
|
||||||
|
the necessary adjustments. You will need to be located at the root of your
|
||||||
|
foam-extend-3.2 installation for those commands to work.
|
||||||
|
|
||||||
|
### - Start to copy commands here ###########################################
|
||||||
|
#
|
||||||
|
cd ~/foam/foam-extend-3.2
|
||||||
|
|
||||||
|
# Create a prefs.sh file
|
||||||
|
cp etc/prefs.sh-EXAMPLE etc/prefs.sh
|
||||||
|
|
||||||
|
# Create a patch file
|
||||||
|
cat <<'EOF' >> patch.txt
|
||||||
|
--- etc/prefs.sh-EXAMPLE 2015-11-23 22:54:50.341631348 -0500
|
||||||
|
+++ etc/prefs.sh 2015-12-05 13:31:02.967676779 -0500
|
||||||
|
@@ -36,7 +36,7 @@
|
||||||
|
|
||||||
|
# Specify system compiler
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
-#compilerInstall=System
|
||||||
|
+compilerInstall=System
|
||||||
|
#compilerInstall=FOAM
|
||||||
|
|
||||||
|
# Specify system openmpi
|
||||||
|
@@ -46,14 +46,14 @@
|
||||||
|
# The other openmpi related variables will be initialized using
|
||||||
|
# the command mpicc --showme:
|
||||||
|
#
|
||||||
|
-#export WM_MPLIB=SYSTEMOPENMPI
|
||||||
|
-#export OPENMPI_DIR=path_to_system_installed_openmpi
|
||||||
|
-#export OPENMPI_BIN_DIR=$OPENMPI_DIR/bin
|
||||||
|
-#
|
||||||
|
-#export OPENMPI_LIB_DIR="`$OPENMPI_BIN_DIR/mpicc --showme:libdirs`"
|
||||||
|
-#export OPENMPI_INCLUDE_DIR="`$OPENMPI_BIN_DIR/mpicc --showme:incdirs`"
|
||||||
|
-#export OPENMPI_COMPILE_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:compile`"
|
||||||
|
-#export OPENMPI_LINK_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:link`"
|
||||||
|
+export WM_MPLIB=SYSTEMOPENMPI
|
||||||
|
+export OPENMPI_DIR=/usr
|
||||||
|
+export OPENMPI_BIN_DIR=$OPENMPI_DIR/bin
|
||||||
|
+#
|
||||||
|
+export OPENMPI_LIB_DIR="`$OPENMPI_BIN_DIR/mpicc --showme:libdirs`"
|
||||||
|
+export OPENMPI_INCLUDE_DIR="`$OPENMPI_BIN_DIR/mpicc --showme:incdirs`"
|
||||||
|
+export OPENMPI_COMPILE_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:compile`"
|
||||||
|
+export OPENMPI_LINK_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:link`"
|
||||||
|
|
||||||
|
# Specify system installed ThirdParty packages/libraries
|
||||||
|
# NB: The packages installed under $WM_THIRD_PARTY_DIR
|
||||||
|
@@ -201,7 +201,6 @@
|
||||||
|
# For AllMake.stage1
|
||||||
|
#export WM_THIRD_PARTY_USE_GCC_492=1
|
||||||
|
#export WM_THIRD_PARTY_USE_GCC_484=1
|
||||||
|
-#export WM_THIRD_PARTY_USE_GCC_474=1
|
||||||
|
#export WM_THIRD_PARTY_USE_GCC_463=1
|
||||||
|
#export WM_THIRD_PARTY_USE_GCC_451=1
|
||||||
|
#export WM_THIRD_PARTY_USE_GCC_445=1
|
||||||
|
@@ -209,7 +208,8 @@
|
||||||
|
#export WM_THIRD_PARTY_USE_M4_1416=1
|
||||||
|
#export WM_THIRD_PARTY_USE_BISON_27=1
|
||||||
|
#export WM_THIRD_PARTY_USE_FLEX_2535=1
|
||||||
|
-export WM_THIRD_PARTY_USE_CMAKE_322=1
|
||||||
|
+#export WM_THIRD_PARTY_USE_CMAKE_322=1
|
||||||
|
+unset WM_THIRD_PARTY_USE_CMAKE_322
|
||||||
|
|
||||||
|
#
|
||||||
|
# For AllMake.stage2
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Patch the file prefs.sh
|
||||||
|
patch -p0 < patch.txt
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
rm patch.txt
|
||||||
|
|
||||||
|
# You are done
|
||||||
|
#
|
||||||
|
### - Stop to copy commands here ###########################################
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
* Set environment variables:
|
||||||
|
|
||||||
|
cd ~/foam/foam-extend-3.2
|
||||||
|
. etc/bashrc
|
||||||
|
|
||||||
|
* Before compiling on the Raspberry Pi 2:
|
||||||
|
|
||||||
|
Even though the Raspberry Pi2 has a more onboard RAM memory (1 GB), it cannot
|
||||||
|
compile some parts of foam-extend in parallel without borrowing some virtual
|
||||||
|
memory (swap). Depending on your system configuration and the amount of enabled
|
||||||
|
services on your Raspberry Pi, you might even ran out of memory completely. So
|
||||||
|
it is recommended not to compile foam-extend in parallel unless you keep an eye
|
||||||
|
regularly on the compilation process and adjust your environment variable
|
||||||
|
WM_NCOMPPROCS accordingly so you can compile some libraries/applications in
|
||||||
|
parallel and some others using just 1 core.
|
||||||
|
|
||||||
|
export WM_NCOMPPROCS=1 # or maybe 2
|
||||||
|
|
||||||
|
* Compile:
|
||||||
|
|
||||||
|
# This will take a very long time but it will compile completely
|
||||||
|
./Allwmake.firstInstall
|
||||||
|
|
||||||
|
|
||||||
|
* Create user directory:
|
||||||
|
|
||||||
|
mkdir -p $FOAM_RUN
|
||||||
|
|
||||||
|
|
||||||
|
And you are ready to start.
|
151
doc/buildInstructions/Debian/Raspbian/Raspbian_Jessie.txt
Normal file
151
doc/buildInstructions/Debian/Raspbian/Raspbian_Jessie.txt
Normal file
|
@ -0,0 +1,151 @@
|
||||||
|
Below are the build instructions for Raspbian Jessie (November 2015)
|
||||||
|
|
||||||
|
These instructions assume that your Raspbian installation is up and running with
|
||||||
|
full network access. If not, please visit the following Web sites for further
|
||||||
|
instructions. As always, Google will also be your friend.
|
||||||
|
https://www.raspberrypi.org/documentation/
|
||||||
|
https://www.raspberrypi.org/downloads/raspbian/
|
||||||
|
|
||||||
|
* Update your Raspbian installation:
|
||||||
|
|
||||||
|
sudo apt-get update
|
||||||
|
sudo apt-get upgrade
|
||||||
|
|
||||||
|
* Install required packages:
|
||||||
|
|
||||||
|
sudo apt-get install git gcc cmake bison flex make build-essential \
|
||||||
|
bison zlib1g-dev qt4-dev-tools libqt4-dev libopenmpi-dev openmpi-bin \
|
||||||
|
rpm libncurses-dev libxt-dev libboost-system-dev libboost-thread-dev \
|
||||||
|
libgmp-dev libmpfr-dev
|
||||||
|
|
||||||
|
* Create the foam-extend installation directory:
|
||||||
|
|
||||||
|
These instructions assume that you install in the default location, which is
|
||||||
|
~/foam/ . Create this folder with:
|
||||||
|
|
||||||
|
mkdir ~/foam
|
||||||
|
|
||||||
|
* Obtain and unpack source code (if you read this, you probably already have):
|
||||||
|
|
||||||
|
The recommended way is to get the source code through git source code
|
||||||
|
management system. This way, you can get updates and bugfixes easily by running
|
||||||
|
"git pull". To install into the default location run:
|
||||||
|
|
||||||
|
cd ~/foam
|
||||||
|
git clone git://git.code.sf.net/p/foam-extend/foam-extend-3.2
|
||||||
|
|
||||||
|
* For Raspbian, you need to customize your file etc/prefs.sh in order to enable
|
||||||
|
the usage of system-provided packages, and to enable the compilation of other.
|
||||||
|
|
||||||
|
Here is a list of commands that will do just that. You can copy/paste
|
||||||
|
the following block of commands in a control terminal in order to make
|
||||||
|
the necessary adjustments. You will need to be located at the root of your
|
||||||
|
foam-extend-3.2 installation for those commands to work.
|
||||||
|
|
||||||
|
### - Start to copy commands here ###########################################
|
||||||
|
#
|
||||||
|
cd ~/foam/foam-extend-3.2
|
||||||
|
|
||||||
|
# Create a prefs.sh file
|
||||||
|
cp etc/prefs.sh-EXAMPLE etc/prefs.sh
|
||||||
|
|
||||||
|
# Create a patch file
|
||||||
|
cat <<'EOF' >> patch.txt
|
||||||
|
--- etc/prefs.sh-EXAMPLE 2015-11-26 05:01:05.676022832 +0000
|
||||||
|
+++ etc/prefs.sh 2015-12-05 17:27:58.100579669 +0000
|
||||||
|
@@ -36,8 +36,9 @@
|
||||||
|
|
||||||
|
# Specify system compiler
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
-#compilerInstall=System
|
||||||
|
+compilerInstall=System
|
||||||
|
#compilerInstall=FOAM
|
||||||
|
+#WM_COMPILER=Gcc49
|
||||||
|
|
||||||
|
# Specify system openmpi
|
||||||
|
# ~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
@@ -46,14 +47,14 @@
|
||||||
|
# The other openmpi related variables will be initialized using
|
||||||
|
# the command mpicc --showme:
|
||||||
|
#
|
||||||
|
-#export WM_MPLIB=SYSTEMOPENMPI
|
||||||
|
-#export OPENMPI_DIR=path_to_system_installed_openmpi
|
||||||
|
-#export OPENMPI_BIN_DIR=$OPENMPI_DIR/bin
|
||||||
|
-#
|
||||||
|
-#export OPENMPI_LIB_DIR="`$OPENMPI_BIN_DIR/mpicc --showme:libdirs`"
|
||||||
|
-#export OPENMPI_INCLUDE_DIR="`$OPENMPI_BIN_DIR/mpicc --showme:incdirs`"
|
||||||
|
-#export OPENMPI_COMPILE_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:compile`"
|
||||||
|
-#export OPENMPI_LINK_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:link`"
|
||||||
|
+export WM_MPLIB=SYSTEMOPENMPI
|
||||||
|
+export OPENMPI_DIR=/usr
|
||||||
|
+export OPENMPI_BIN_DIR=$OPENMPI_DIR/bin
|
||||||
|
+#
|
||||||
|
+export OPENMPI_LIB_DIR="`$OPENMPI_BIN_DIR/mpicc --showme:libdirs`"
|
||||||
|
+export OPENMPI_INCLUDE_DIR="`$OPENMPI_BIN_DIR/mpicc --showme:incdirs`"
|
||||||
|
+export OPENMPI_COMPILE_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:compile`"
|
||||||
|
+export OPENMPI_LINK_FLAGS="`$OPENMPI_BIN_DIR/mpicc --showme:link`"
|
||||||
|
|
||||||
|
# Specify system installed ThirdParty packages/libraries
|
||||||
|
# NB: The packages installed under $WM_THIRD_PARTY_DIR
|
||||||
|
@@ -201,7 +202,6 @@
|
||||||
|
# For AllMake.stage1
|
||||||
|
#export WM_THIRD_PARTY_USE_GCC_492=1
|
||||||
|
#export WM_THIRD_PARTY_USE_GCC_484=1
|
||||||
|
-#export WM_THIRD_PARTY_USE_GCC_474=1
|
||||||
|
#export WM_THIRD_PARTY_USE_GCC_463=1
|
||||||
|
#export WM_THIRD_PARTY_USE_GCC_451=1
|
||||||
|
#export WM_THIRD_PARTY_USE_GCC_445=1
|
||||||
|
@@ -209,7 +209,8 @@
|
||||||
|
#export WM_THIRD_PARTY_USE_M4_1416=1
|
||||||
|
#export WM_THIRD_PARTY_USE_BISON_27=1
|
||||||
|
#export WM_THIRD_PARTY_USE_FLEX_2535=1
|
||||||
|
-export WM_THIRD_PARTY_USE_CMAKE_322=1
|
||||||
|
+#export WM_THIRD_PARTY_USE_CMAKE_322=1
|
||||||
|
+unset WM_THIRD_PARTY_USE_CMAKE_322
|
||||||
|
|
||||||
|
#
|
||||||
|
# For AllMake.stage2
|
||||||
|
EOF
|
||||||
|
|
||||||
|
# Patch the file prefs.sh
|
||||||
|
patch -p0 < patch.txt
|
||||||
|
|
||||||
|
# Cleanup
|
||||||
|
rm patch.txt
|
||||||
|
|
||||||
|
# You are done
|
||||||
|
#
|
||||||
|
### - Stop to copy commands here ###########################################
|
||||||
|
############################################################################
|
||||||
|
|
||||||
|
|
||||||
|
* Set environment variables:
|
||||||
|
|
||||||
|
cd ~/foam/foam-extend-3.2
|
||||||
|
. etc/bashrc
|
||||||
|
|
||||||
|
* Before compiling on the Raspberry Pi 2:
|
||||||
|
|
||||||
|
Even though the Raspberry Pi2 has a more onboard RAM memory (1 GB), it cannot
|
||||||
|
compile some parts of foam-extend in parallel without borrowing some virtual
|
||||||
|
memory (swap). Depending on your system configuration and the amount of enabled
|
||||||
|
services on your Raspberry Pi, you might even ran out of memory completely. So
|
||||||
|
it is recommended not to compile foam-extend in parallel unless you keep an eye
|
||||||
|
regularly on the compilation process and adjust your environment variable
|
||||||
|
WM_NCOMPPROCS accordingly so you can compile some libraries/applications in
|
||||||
|
parallel and some others using just 1 core.
|
||||||
|
|
||||||
|
export WM_NCOMPPROCS=1 # or maybe 2
|
||||||
|
|
||||||
|
* Compile:
|
||||||
|
|
||||||
|
# This will take a very long time but it will compile completely
|
||||||
|
./Allwmake.firstInstall
|
||||||
|
|
||||||
|
|
||||||
|
* Create user directory:
|
||||||
|
|
||||||
|
mkdir -p $FOAM_RUN
|
||||||
|
|
||||||
|
|
||||||
|
And you are ready to start.
|
46
etc/bashrc
46
etc/bashrc
|
@ -219,6 +219,42 @@ MINGW32_NT-6.2)
|
||||||
export WM_LDFLAGS='-m64'
|
export WM_LDFLAGS='-m64'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
MINGW64_NT-6.1)
|
||||||
|
WM_ARCH=mingw
|
||||||
|
export WM_ARCH_BASE=mingw
|
||||||
|
export WM_COMPILER_LIB_ARCH=64
|
||||||
|
export WM_CFLAGS='-m64 -fPIC'
|
||||||
|
export WM_CXXFLAGS='-m64 -fPIC'
|
||||||
|
export WM_LDFLAGS='-m64'
|
||||||
|
;;
|
||||||
|
|
||||||
|
MINGW64_NT-6.2)
|
||||||
|
WM_ARCH=mingw
|
||||||
|
export WM_ARCH_BASE=mingw
|
||||||
|
export WM_COMPILER_LIB_ARCH=64
|
||||||
|
export WM_CFLAGS='-m64 -fPIC'
|
||||||
|
export WM_CXXFLAGS='-m64 -fPIC'
|
||||||
|
export WM_LDFLAGS='-m64'
|
||||||
|
;;
|
||||||
|
|
||||||
|
MINGW64_NT-6.1)
|
||||||
|
WM_ARCH=mingw
|
||||||
|
export WM_ARCH_BASE=mingw
|
||||||
|
export WM_COMPILER_LIB_ARCH=64
|
||||||
|
export WM_CFLAGS='-m64 -fPIC'
|
||||||
|
export WM_CXXFLAGS='-m64 -fPIC'
|
||||||
|
export WM_LDFLAGS='-m64'
|
||||||
|
;;
|
||||||
|
|
||||||
|
MINGW64_NT-6.2)
|
||||||
|
WM_ARCH=mingw
|
||||||
|
export WM_ARCH_BASE=mingw
|
||||||
|
export WM_COMPILER_LIB_ARCH=64
|
||||||
|
export WM_CFLAGS='-m64 -fPIC'
|
||||||
|
export WM_CXXFLAGS='-m64 -fPIC'
|
||||||
|
export WM_LDFLAGS='-m64'
|
||||||
|
;;
|
||||||
|
|
||||||
Linux)
|
Linux)
|
||||||
WM_ARCH=linux
|
WM_ARCH=linux
|
||||||
|
|
||||||
|
@ -270,6 +306,16 @@ Linux)
|
||||||
export WM_LDFLAGS='-m64'
|
export WM_LDFLAGS='-m64'
|
||||||
;;
|
;;
|
||||||
|
|
||||||
|
armv7l)
|
||||||
|
WM_ARCH=linuxARM7
|
||||||
|
export WM_COMPILER_LIB_ARCH=32
|
||||||
|
export WM_CC='gcc'
|
||||||
|
export WM_CXX='g++'
|
||||||
|
export WM_CFLAGS='-fPIC -mfloat-abi=hard'
|
||||||
|
export WM_CXXFLAGS='-fPIC -mfloat-abi=hard'
|
||||||
|
export WM_LDFLAGS='-mfloat-abi=hard'
|
||||||
|
;;
|
||||||
|
|
||||||
*)
|
*)
|
||||||
echo Unknown processor type `uname -m` for Linux
|
echo Unknown processor type `uname -m` for Linux
|
||||||
;;
|
;;
|
||||||
|
|
10
etc/cshrc
10
etc/cshrc
|
@ -228,6 +228,16 @@ case Linux:
|
||||||
setenv WM_LDFLAGS '-m64'
|
setenv WM_LDFLAGS '-m64'
|
||||||
breaksw
|
breaksw
|
||||||
|
|
||||||
|
armv7l)
|
||||||
|
setenv WM_ARCH linuxARM7
|
||||||
|
setenv WM_COMPILER_LIB_ARCH 32
|
||||||
|
setenv WM_CC 'gcc'
|
||||||
|
setenv WM_CXX 'g++'
|
||||||
|
setenv WM_CFLAGS '-fPIC -mfloat-abi=hard'
|
||||||
|
setenv WM_CXXFLAGS '-fPIC -mfloat-abi=hard'
|
||||||
|
setenv WM_LDFLAGS '-mfloat-abi=hard'
|
||||||
|
;;
|
||||||
|
|
||||||
default:
|
default:
|
||||||
echo Unknown processor type `uname -m` for Linux
|
echo Unknown processor type `uname -m` for Linux
|
||||||
breaksw
|
breaksw
|
||||||
|
|
|
@ -191,6 +191,7 @@
|
||||||
# For AllMake.stage1
|
# For AllMake.stage1
|
||||||
#setenv WM_THIRD_PARTY_USE_GCC_492 1
|
#setenv WM_THIRD_PARTY_USE_GCC_492 1
|
||||||
#setenv WM_THIRD_PARTY_USE_GCC_484 1
|
#setenv WM_THIRD_PARTY_USE_GCC_484 1
|
||||||
|
#setenv WM_THIRD_PARTY_USE_GCC_474 1
|
||||||
#setenv WM_THIRD_PARTY_USE_GCC_463 1
|
#setenv WM_THIRD_PARTY_USE_GCC_463 1
|
||||||
#setenv WM_THIRD_PARTY_USE_GCC_451 1
|
#setenv WM_THIRD_PARTY_USE_GCC_451 1
|
||||||
#setenv WM_THIRD_PARTY_USE_GCC_445 1
|
#setenv WM_THIRD_PARTY_USE_GCC_445 1
|
||||||
|
|
|
@ -201,6 +201,7 @@ export FOAM_VERBOSE=1
|
||||||
# For AllMake.stage1
|
# For AllMake.stage1
|
||||||
#export WM_THIRD_PARTY_USE_GCC_492=1
|
#export WM_THIRD_PARTY_USE_GCC_492=1
|
||||||
#export WM_THIRD_PARTY_USE_GCC_484=1
|
#export WM_THIRD_PARTY_USE_GCC_484=1
|
||||||
|
#export WM_THIRD_PARTY_USE_GCC_474=1
|
||||||
#export WM_THIRD_PARTY_USE_GCC_463=1
|
#export WM_THIRD_PARTY_USE_GCC_463=1
|
||||||
#export WM_THIRD_PARTY_USE_GCC_451=1
|
#export WM_THIRD_PARTY_USE_GCC_451=1
|
||||||
#export WM_THIRD_PARTY_USE_GCC_445=1
|
#export WM_THIRD_PARTY_USE_GCC_445=1
|
||||||
|
|
|
@ -105,7 +105,7 @@ export PARMGRIDGEN_INCLUDE_DIR=$PARMGRIDGEN_DIR/include
|
||||||
|
|
||||||
# System installed Scotch
|
# System installed Scotch
|
||||||
#export SCOTCH_SYSTEM=1
|
#export SCOTCH_SYSTEM=1
|
||||||
export SCOTCH_DIR=$WM_THIRD_PARTY_DIR/packages/scotch_6.0.0
|
export SCOTCH_DIR=$WM_THIRD_PARTY_DIR/packages/scotch_6.0.4
|
||||||
export SCOTCH_BIN_DIR=$SCOTCH_DIR/bin
|
export SCOTCH_BIN_DIR=$SCOTCH_DIR/bin
|
||||||
export SCOTCH_LIB_DIR=$SCOTCH_DIR/lib
|
export SCOTCH_LIB_DIR=$SCOTCH_DIR/lib
|
||||||
export SCOTCH_INCLUDE_DIR=$SCOTCH_DIR/include
|
export SCOTCH_INCLUDE_DIR=$SCOTCH_DIR/include
|
||||||
|
|
|
@ -103,6 +103,10 @@ case FOAM:
|
||||||
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/packages/gcc-4.9.2/platforms/$WM_OPTIONS
|
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/packages/gcc-4.9.2/platforms/$WM_OPTIONS
|
||||||
_foamSource $WM_THIRD_PARTY_DIR/packages/gcc-4.9.2/platforms/$WM_OPTIONS/etc/gcc-4.9.2.csh
|
_foamSource $WM_THIRD_PARTY_DIR/packages/gcc-4.9.2/platforms/$WM_OPTIONS/etc/gcc-4.9.2.csh
|
||||||
breaksw
|
breaksw
|
||||||
|
case Gcc48:
|
||||||
|
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/packages/gcc-4.8.4/platforms/$WM_OPTIONS
|
||||||
|
_foamSource $WM_THIRD_PARTY_DIR/packages/gcc-4.8.4/platforms/$WM_OPTIONS/etc/gcc-4.8.4.csh
|
||||||
|
breaksw
|
||||||
case Gcc47:
|
case Gcc47:
|
||||||
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/packages/gcc-4.7.4/platforms/$WM_OPTIONS
|
setenv WM_COMPILER_DIR $WM_THIRD_PARTY_DIR/packages/gcc-4.7.4/platforms/$WM_OPTIONS
|
||||||
_foamSource $WM_THIRD_PARTY_DIR/packages/gmp-5.1.2/platforms/$WM_OPTIONS/etc/gmp-5.1.2.csh
|
_foamSource $WM_THIRD_PARTY_DIR/packages/gmp-5.1.2/platforms/$WM_OPTIONS/etc/gmp-5.1.2.csh
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | foam-extend: Open Source CFD
|
\\ / F ield | foam-extend: Open Source CFD
|
||||||
\\ / O peration | Version: 3.2
|
\\ / O peration |
|
||||||
\\ / A nd | Web: http://www.foam-extend.org
|
\\ / A nd | For copyright notice see file Copyright
|
||||||
\\/ M anipulation | For copyright notice see file Copyright
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of foam-extend.
|
This file is part of foam-extend.
|
||||||
|
@ -72,7 +72,7 @@ Foam::scalar Foam::finiteRotation::rotAngle(const tensor& rotT)
|
||||||
|
|
||||||
Foam::vector Foam::finiteRotation::eulerAngles(const tensor& rotT)
|
Foam::vector Foam::finiteRotation::eulerAngles(const tensor& rotT)
|
||||||
{
|
{
|
||||||
// Define a vector containing euler angles (x = roll, y = pitch, z = yaw)
|
// Create a vector containing euler angles (x = roll, y = pitch, z = yaw)
|
||||||
vector eulerAngles;
|
vector eulerAngles;
|
||||||
|
|
||||||
scalar& rollAngle = eulerAngles.x();
|
scalar& rollAngle = eulerAngles.x();
|
||||||
|
@ -82,7 +82,9 @@ Foam::vector Foam::finiteRotation::eulerAngles(const tensor& rotT)
|
||||||
// Calculate roll angle
|
// Calculate roll angle
|
||||||
rollAngle = atan2(rotT.yz(), rotT.zz());
|
rollAngle = atan2(rotT.yz(), rotT.zz());
|
||||||
|
|
||||||
const scalar c2 = sqrt(rotT.xx() + rotT.xy());
|
// Use mag to avoid negative value due to round-off
|
||||||
|
// HJ, 24/Feb/2016
|
||||||
|
const scalar c2 = sqrt(Foam::max(0, rotT.xx() + rotT.xy()));
|
||||||
|
|
||||||
// Calculate pitch angle
|
// Calculate pitch angle
|
||||||
pitchAngle = atan2(-rotT.xz(), c2);
|
pitchAngle = atan2(-rotT.xz(), c2);
|
||||||
|
|
|
@ -1,9 +1,9 @@
|
||||||
/*---------------------------------------------------------------------------*\
|
/*---------------------------------------------------------------------------*\
|
||||||
========= |
|
========= |
|
||||||
\\ / F ield | foam-extend: Open Source CFD
|
\\ / F ield | foam-extend: Open Source CFD
|
||||||
\\ / O peration | Version: 3.2
|
\\ / O peration |
|
||||||
\\ / A nd | Web: http://www.foam-extend.org
|
\\ / A nd | For copyright notice see file Copyright
|
||||||
\\/ M anipulation | For copyright notice see file Copyright
|
\\/ M anipulation |
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of foam-extend.
|
This file is part of foam-extend.
|
||||||
|
@ -69,7 +69,7 @@ class finiteRotation
|
||||||
//- Calculate rotation angle from given rotation tensor
|
//- Calculate rotation angle from given rotation tensor
|
||||||
static scalar rotAngle(const tensor& rotT);
|
static scalar rotAngle(const tensor& rotT);
|
||||||
|
|
||||||
//- Calculate Euler angles (x-y-z (roll-pitch-yaw) convenction) from
|
//- Calculate Euler angles (x-y-z (roll-pitch-yaw) convention) from
|
||||||
// given rotation tensor. Reference: Mike Day, Insomniac Games,
|
// given rotation tensor. Reference: Mike Day, Insomniac Games,
|
||||||
// Extracting Euler Angles from a Rotation Matrix.
|
// Extracting Euler Angles from a Rotation Matrix.
|
||||||
static vector eulerAngles(const tensor& rotT);
|
static vector eulerAngles(const tensor& rotT);
|
||||||
|
|
|
@ -74,11 +74,17 @@ Foam::dimensionedVector Foam::sixDOFqODE::A
|
||||||
const HamiltonRodriguezRot& rotation
|
const HamiltonRodriguezRot& rotation
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
// Fix the global force for global rotation constraints
|
||||||
|
dimensionedVector fAbs = force();
|
||||||
|
|
||||||
|
// Constrain translation
|
||||||
|
constrainTranslation(fAbs.value());
|
||||||
|
|
||||||
return
|
return
|
||||||
(
|
(
|
||||||
- (linSpringCoeffs_ & xR) // spring
|
- (linSpringCoeffs_ & xR) // spring
|
||||||
- (linDampingCoeffs_ & uR) // damping
|
- (linDampingCoeffs_ & uR) // damping
|
||||||
+ force()
|
+ fAbs
|
||||||
// To absolute
|
// To absolute
|
||||||
+ (rotation.invR() & forceRelative())
|
+ (rotation.invR() & forceRelative())
|
||||||
)/mass_;
|
)/mass_;
|
||||||
|
@ -91,12 +97,18 @@ Foam::dimensionedVector Foam::sixDOFqODE::OmegaDot
|
||||||
const dimensionedVector& omega
|
const dimensionedVector& omega
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
// Fix the global moment for global rotation constraints
|
||||||
|
dimensionedVector mAbs = moment();
|
||||||
|
|
||||||
|
// Constrain rotation
|
||||||
|
constrainRotation(mAbs.value());
|
||||||
|
|
||||||
return
|
return
|
||||||
inv(momentOfInertia_)
|
inv(momentOfInertia_)
|
||||||
& (
|
& (
|
||||||
E(omega)
|
E(omega)
|
||||||
// To relative
|
// To relative
|
||||||
+ (rotation.R() & moment())
|
+ (rotation.R() & mAbs)
|
||||||
+ momentRelative()
|
+ momentRelative()
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
@ -111,6 +123,89 @@ Foam::dimensionedVector Foam::sixDOFqODE::E
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::sixDOFqODE::constrainRotation(vector& vec) const
|
||||||
|
{
|
||||||
|
vector consVec(vector::zero);
|
||||||
|
|
||||||
|
// Constrain the vector in respect to referent or global coordinate system
|
||||||
|
if (referentMotionConstraints_)
|
||||||
|
{
|
||||||
|
consVec = referentRotation_.R() & vec;
|
||||||
|
|
||||||
|
if (fixedRoll_)
|
||||||
|
{
|
||||||
|
consVec.x() = 0;
|
||||||
|
}
|
||||||
|
if (fixedPitch_)
|
||||||
|
{
|
||||||
|
consVec.y() = 0;
|
||||||
|
}
|
||||||
|
if (fixedYaw_)
|
||||||
|
{
|
||||||
|
consVec.z() = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
vec = referentRotation_.invR() & consVec;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (fixedRoll_)
|
||||||
|
{
|
||||||
|
vec.x() = 0;
|
||||||
|
}
|
||||||
|
if (fixedPitch_)
|
||||||
|
{
|
||||||
|
vec.y() = 0;
|
||||||
|
}
|
||||||
|
if (fixedYaw_)
|
||||||
|
{
|
||||||
|
vec.z() = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::sixDOFqODE::constrainTranslation(vector& vec) const
|
||||||
|
{
|
||||||
|
vector consVec(vector::zero);
|
||||||
|
|
||||||
|
// Constrain the vector in respect to referent or global coordinate system
|
||||||
|
if (referentMotionConstraints_)
|
||||||
|
{
|
||||||
|
consVec = referentRotation_.R() & vec;
|
||||||
|
|
||||||
|
if (fixedSurge_)
|
||||||
|
{
|
||||||
|
consVec.x() = 0;
|
||||||
|
}
|
||||||
|
if (fixedSway_)
|
||||||
|
{
|
||||||
|
consVec.y() = 0;
|
||||||
|
}
|
||||||
|
if (fixedHeave_)
|
||||||
|
{
|
||||||
|
consVec.z() = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
vec = referentRotation_.invR() & consVec;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
if (fixedSurge_)
|
||||||
|
{
|
||||||
|
vec.x() = 0;
|
||||||
|
}
|
||||||
|
if (fixedSway_)
|
||||||
|
{
|
||||||
|
vec.y() = 0;
|
||||||
|
}
|
||||||
|
if (fixedHeave_)
|
||||||
|
{
|
||||||
|
vec.z() = 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
@ -118,11 +213,14 @@ Foam::dimensionedVector Foam::sixDOFqODE::E
|
||||||
Foam::sixDOFqODE::sixDOFqODE(const IOobject& io)
|
Foam::sixDOFqODE::sixDOFqODE(const IOobject& io)
|
||||||
:
|
:
|
||||||
IOdictionary(io),
|
IOdictionary(io),
|
||||||
|
|
||||||
mass_(lookup("mass")),
|
mass_(lookup("mass")),
|
||||||
momentOfInertia_(lookup("momentOfInertia")),
|
momentOfInertia_(lookup("momentOfInertia")),
|
||||||
|
|
||||||
Xequilibrium_(lookup("equilibriumPosition")),
|
Xequilibrium_(lookup("equilibriumPosition")),
|
||||||
linSpringCoeffs_(lookup("linearSpring")),
|
linSpringCoeffs_(lookup("linearSpring")),
|
||||||
linDampingCoeffs_(lookup("linearDamping")),
|
linDampingCoeffs_(lookup("linearDamping")),
|
||||||
|
|
||||||
Xrel_(lookup("Xrel")),
|
Xrel_(lookup("Xrel")),
|
||||||
U_(lookup("U")),
|
U_(lookup("U")),
|
||||||
Uaverage_(U_),
|
Uaverage_(U_),
|
||||||
|
@ -134,11 +232,29 @@ Foam::sixDOFqODE::sixDOFqODE(const IOobject& io)
|
||||||
omega_(lookup("omega")),
|
omega_(lookup("omega")),
|
||||||
omegaAverage_(omega_),
|
omegaAverage_(omega_),
|
||||||
omegaAverageAbsolute_(omega_),
|
omegaAverageAbsolute_(omega_),
|
||||||
|
|
||||||
force_(lookup("force")),
|
force_(lookup("force")),
|
||||||
moment_(lookup("moment")),
|
moment_(lookup("moment")),
|
||||||
forceRelative_(lookup("forceRelative")),
|
forceRelative_(lookup("forceRelative")),
|
||||||
momentRelative_(lookup("momentRelative")),
|
momentRelative_(lookup("momentRelative")),
|
||||||
coeffs_(13, 0.0)
|
|
||||||
|
coeffs_(13, 0.0),
|
||||||
|
|
||||||
|
fixedSurge_(lookup("fixedSurge")),
|
||||||
|
fixedSway_(lookup("fixedSway")),
|
||||||
|
fixedHeave_(lookup("fixedHeave")),
|
||||||
|
fixedRoll_(lookup("fixedRoll")),
|
||||||
|
fixedPitch_(lookup("fixedPitch")),
|
||||||
|
fixedYaw_(lookup("fixedYaw")),
|
||||||
|
referentMotionConstraints_
|
||||||
|
(
|
||||||
|
lookupOrDefault<Switch>
|
||||||
|
(
|
||||||
|
"referentMotionConstraints",
|
||||||
|
false
|
||||||
|
)
|
||||||
|
),
|
||||||
|
referentRotation_(vector(1, 0, 0), 0)
|
||||||
{
|
{
|
||||||
setCoeffs();
|
setCoeffs();
|
||||||
}
|
}
|
||||||
|
@ -163,11 +279,14 @@ Foam::sixDOFqODE::sixDOFqODE
|
||||||
IOobject::NO_WRITE
|
IOobject::NO_WRITE
|
||||||
)
|
)
|
||||||
),
|
),
|
||||||
|
|
||||||
mass_(sd.mass_.name(), sd.mass_),
|
mass_(sd.mass_.name(), sd.mass_),
|
||||||
momentOfInertia_(sd.momentOfInertia_.name(), sd.momentOfInertia_),
|
momentOfInertia_(sd.momentOfInertia_.name(), sd.momentOfInertia_),
|
||||||
|
|
||||||
Xequilibrium_(sd.Xequilibrium_.name(), sd.Xequilibrium_),
|
Xequilibrium_(sd.Xequilibrium_.name(), sd.Xequilibrium_),
|
||||||
linSpringCoeffs_(sd.linSpringCoeffs_.name(), sd.linSpringCoeffs_),
|
linSpringCoeffs_(sd.linSpringCoeffs_.name(), sd.linSpringCoeffs_),
|
||||||
linDampingCoeffs_(sd.linDampingCoeffs_.name(), sd.linDampingCoeffs_),
|
linDampingCoeffs_(sd.linDampingCoeffs_.name(), sd.linDampingCoeffs_),
|
||||||
|
|
||||||
Xrel_(sd.Xrel_.name(), sd.Xrel_),
|
Xrel_(sd.Xrel_.name(), sd.Xrel_),
|
||||||
U_(sd.U_.name(), sd.U_),
|
U_(sd.U_.name(), sd.U_),
|
||||||
Uaverage_(sd.Uaverage_.name(), sd.Uaverage_),
|
Uaverage_(sd.Uaverage_.name(), sd.Uaverage_),
|
||||||
|
@ -179,11 +298,22 @@ Foam::sixDOFqODE::sixDOFqODE
|
||||||
sd.omegaAverageAbsolute_.name(),
|
sd.omegaAverageAbsolute_.name(),
|
||||||
sd.omegaAverageAbsolute_
|
sd.omegaAverageAbsolute_
|
||||||
),
|
),
|
||||||
|
|
||||||
force_(sd.force_.name(), sd.force_),
|
force_(sd.force_.name(), sd.force_),
|
||||||
moment_(sd.moment_.name(), sd.moment_),
|
moment_(sd.moment_.name(), sd.moment_),
|
||||||
forceRelative_(sd.forceRelative_.name(), sd.forceRelative_),
|
forceRelative_(sd.forceRelative_.name(), sd.forceRelative_),
|
||||||
momentRelative_(sd.momentRelative_.name(), sd.momentRelative_),
|
momentRelative_(sd.momentRelative_.name(), sd.momentRelative_),
|
||||||
coeffs_(sd.coeffs_)
|
|
||||||
|
coeffs_(sd.coeffs_),
|
||||||
|
|
||||||
|
fixedSurge_(sd.fixedSurge_),
|
||||||
|
fixedSway_(sd.fixedSway_),
|
||||||
|
fixedHeave_(sd.fixedHeave_),
|
||||||
|
fixedRoll_(sd.fixedRoll_),
|
||||||
|
fixedPitch_(sd.fixedPitch_),
|
||||||
|
fixedYaw_(sd.fixedYaw_),
|
||||||
|
referentMotionConstraints_(sd.referentMotionConstraints_),
|
||||||
|
referentRotation_(sd.referentRotation_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
@ -199,9 +329,11 @@ void Foam::sixDOFqODE::setState(const sixDOFqODE& sd)
|
||||||
{
|
{
|
||||||
mass_ = sd.mass_;
|
mass_ = sd.mass_;
|
||||||
momentOfInertia_ = sd.momentOfInertia_;
|
momentOfInertia_ = sd.momentOfInertia_;
|
||||||
|
|
||||||
Xequilibrium_ = sd.Xequilibrium_;
|
Xequilibrium_ = sd.Xequilibrium_;
|
||||||
linSpringCoeffs_ = sd.linSpringCoeffs_;
|
linSpringCoeffs_ = sd.linSpringCoeffs_;
|
||||||
linDampingCoeffs_ = sd.linDampingCoeffs_;
|
linDampingCoeffs_ = sd.linDampingCoeffs_;
|
||||||
|
|
||||||
Xrel_ = sd.Xrel_;
|
Xrel_ = sd.Xrel_;
|
||||||
U_ = sd.U_;
|
U_ = sd.U_;
|
||||||
Uaverage_ = sd.Uaverage_;
|
Uaverage_ = sd.Uaverage_;
|
||||||
|
@ -209,6 +341,7 @@ void Foam::sixDOFqODE::setState(const sixDOFqODE& sd)
|
||||||
omega_ = sd.omega_;
|
omega_ = sd.omega_;
|
||||||
omegaAverage_ = sd.omegaAverage_;
|
omegaAverage_ = sd.omegaAverage_;
|
||||||
omegaAverageAbsolute_ = sd.omegaAverageAbsolute_;
|
omegaAverageAbsolute_ = sd.omegaAverageAbsolute_;
|
||||||
|
|
||||||
force_ = sd.force_;
|
force_ = sd.force_;
|
||||||
moment_ = sd.moment_;
|
moment_ = sd.moment_;
|
||||||
forceRelative_ = sd.forceRelative_;
|
forceRelative_ = sd.forceRelative_;
|
||||||
|
@ -217,6 +350,13 @@ void Foam::sixDOFqODE::setState(const sixDOFqODE& sd)
|
||||||
// Copy ODE coefficients: this carries actual ODE state
|
// Copy ODE coefficients: this carries actual ODE state
|
||||||
// HJ, 23/Mar/2015
|
// HJ, 23/Mar/2015
|
||||||
coeffs_ = sd.coeffs_;
|
coeffs_ = sd.coeffs_;
|
||||||
|
|
||||||
|
fixedSurge_ = sd.fixedSurge_;
|
||||||
|
fixedSway_ = sd.fixedSway_;
|
||||||
|
fixedHeave_ = sd.fixedHeave_;
|
||||||
|
fixedRoll_ = sd.fixedRoll_;
|
||||||
|
fixedPitch_ = sd.fixedPitch_;
|
||||||
|
fixedYaw_ = sd.fixedYaw_;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -248,6 +388,23 @@ void Foam::sixDOFqODE::derivatives
|
||||||
dydx[4] = accel.y();
|
dydx[4] = accel.y();
|
||||||
dydx[5] = accel.z();
|
dydx[5] = accel.z();
|
||||||
|
|
||||||
|
// // Add translational constraints by setting RHS of given components to zero
|
||||||
|
// if (fixedSurge_)
|
||||||
|
// {
|
||||||
|
// dydx[0] = 0; // Surge velocity
|
||||||
|
// dydx[3] = 0; // Surge acceleration
|
||||||
|
// }
|
||||||
|
// if (fixedSway_)
|
||||||
|
// {
|
||||||
|
// dydx[1] = 0; // Sway velocity
|
||||||
|
// dydx[4] = 0; // Sway acceleration
|
||||||
|
// }
|
||||||
|
// if (fixedHeave_)
|
||||||
|
// {
|
||||||
|
// dydx[2] = 0; // Heave velocity
|
||||||
|
// dydx[5] = 0; // Heave acceleration
|
||||||
|
// }
|
||||||
|
|
||||||
// Set the derivatives for rotation
|
// Set the derivatives for rotation
|
||||||
dimensionedVector curOmega
|
dimensionedVector curOmega
|
||||||
(
|
(
|
||||||
|
@ -256,6 +413,25 @@ void Foam::sixDOFqODE::derivatives
|
||||||
vector(y[6], y[7], y[8])
|
vector(y[6], y[7], y[8])
|
||||||
);
|
);
|
||||||
|
|
||||||
|
// dimensionedVector curGlobalOmega = curRotation.invR() & curOmega;
|
||||||
|
//
|
||||||
|
// // Add rotational constraints by setting RHS of given components to zero
|
||||||
|
// if (fixedRoll_)
|
||||||
|
// {
|
||||||
|
// curGlobalOmega.value().x() = 0;
|
||||||
|
// }
|
||||||
|
// if (fixedPitch_)
|
||||||
|
// {
|
||||||
|
// curGlobalOmega.value().y() = 0;
|
||||||
|
// }
|
||||||
|
// if (fixedYaw_)
|
||||||
|
// {
|
||||||
|
// curGlobalOmega.value().z() = 0;
|
||||||
|
// }
|
||||||
|
//
|
||||||
|
//
|
||||||
|
// curOmega = curRotation.R() & curGlobalOmega;
|
||||||
|
|
||||||
const vector omegaDot = OmegaDot(curRotation, curOmega).value();
|
const vector omegaDot = OmegaDot(curRotation, curOmega).value();
|
||||||
|
|
||||||
dydx[6] = omegaDot.x();
|
dydx[6] = omegaDot.x();
|
||||||
|
@ -266,6 +442,20 @@ void Foam::sixDOFqODE::derivatives
|
||||||
dydx[10] = curRotation.eDot(curOmega.value(), 1);
|
dydx[10] = curRotation.eDot(curOmega.value(), 1);
|
||||||
dydx[11] = curRotation.eDot(curOmega.value(), 2);
|
dydx[11] = curRotation.eDot(curOmega.value(), 2);
|
||||||
dydx[12] = curRotation.eDot(curOmega.value(), 3);
|
dydx[12] = curRotation.eDot(curOmega.value(), 3);
|
||||||
|
|
||||||
|
// Add rotational constraints by setting RHS of given components to zero
|
||||||
|
if (fixedRoll_)
|
||||||
|
{
|
||||||
|
dydx[10] = 0; // Roll axis (roll quaternion evolution RHS)
|
||||||
|
}
|
||||||
|
if (fixedPitch_)
|
||||||
|
{
|
||||||
|
dydx[11] = 0; // Pitch axis (pitch quaternion evolution RHS)
|
||||||
|
}
|
||||||
|
if (fixedYaw_)
|
||||||
|
{
|
||||||
|
dydx[12] = 0; // Yaw axis (yaw quaternion evolution RHS)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -302,6 +492,12 @@ void Foam::sixDOFqODE::update(const scalar delta)
|
||||||
Uval.y() = coeffs_[4];
|
Uval.y() = coeffs_[4];
|
||||||
Uval.z() = coeffs_[5];
|
Uval.z() = coeffs_[5];
|
||||||
|
|
||||||
|
// Constrain velocity
|
||||||
|
constrainTranslation(Uval);
|
||||||
|
coeffs_[3] = Uval.x();
|
||||||
|
coeffs_[4] = Uval.y();
|
||||||
|
coeffs_[5] = Uval.z();
|
||||||
|
|
||||||
// Update omega
|
// Update omega
|
||||||
vector& omegaVal = omega_.value();
|
vector& omegaVal = omega_.value();
|
||||||
|
|
||||||
|
@ -309,6 +505,12 @@ void Foam::sixDOFqODE::update(const scalar delta)
|
||||||
omegaVal.y() = coeffs_[7];
|
omegaVal.y() = coeffs_[7];
|
||||||
omegaVal.z() = coeffs_[8];
|
omegaVal.z() = coeffs_[8];
|
||||||
|
|
||||||
|
// Constrain omega
|
||||||
|
constrainRotation(omegaVal);
|
||||||
|
coeffs_[6] = omegaVal.x();
|
||||||
|
coeffs_[7] = omegaVal.y();
|
||||||
|
coeffs_[8] = omegaVal.z();
|
||||||
|
|
||||||
rotation_.updateRotation
|
rotation_.updateRotation
|
||||||
(
|
(
|
||||||
HamiltonRodriguezRot
|
HamiltonRodriguezRot
|
||||||
|
@ -321,7 +523,23 @@ void Foam::sixDOFqODE::update(const scalar delta)
|
||||||
);
|
);
|
||||||
|
|
||||||
omegaAverage_.value() = rotation_.omegaAverage(delta);
|
omegaAverage_.value() = rotation_.omegaAverage(delta);
|
||||||
omegaAverageAbsolute_.value() = rotation_.omegaAverageAbsolute(delta);
|
|
||||||
|
// Calculate and constrain omegaAverageAbsolute appropriately
|
||||||
|
vector& omegaAverageAbsoluteValue = omegaAverageAbsolute_.value();
|
||||||
|
omegaAverageAbsoluteValue = rotation_.omegaAverageAbsolute(delta);
|
||||||
|
|
||||||
|
if (fixedRoll_)
|
||||||
|
{
|
||||||
|
omegaAverageAbsoluteValue.x() = 0;
|
||||||
|
}
|
||||||
|
if (fixedPitch_)
|
||||||
|
{
|
||||||
|
omegaAverageAbsoluteValue.y() = 0;
|
||||||
|
}
|
||||||
|
if (fixedYaw_)
|
||||||
|
{
|
||||||
|
omegaAverageAbsoluteValue.z() = 0;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -367,6 +585,19 @@ Foam::Ostream& Foam::operator<<(Ostream& os, const sixDOFqODE& sds)
|
||||||
os.writeKeyword("momentRelative") << tab << sds.momentRelative()
|
os.writeKeyword("momentRelative") << tab << sds.momentRelative()
|
||||||
<< token::END_STATEMENT << endl;
|
<< token::END_STATEMENT << endl;
|
||||||
|
|
||||||
|
os.writeKeyword("fixedSurge") << tab << sds.fixedSurge_ <<
|
||||||
|
token::END_STATEMENT << endl;
|
||||||
|
os.writeKeyword("fixedSway") << tab << sds.fixedSway_ <<
|
||||||
|
token::END_STATEMENT << endl;
|
||||||
|
os.writeKeyword("fixedHeave") << tab << sds.fixedHeave_ <<
|
||||||
|
token::END_STATEMENT << endl;
|
||||||
|
os.writeKeyword("fixedRoll") << tab << sds.fixedRoll_ <<
|
||||||
|
token::END_STATEMENT << endl;
|
||||||
|
os.writeKeyword("fixedPitch") << tab << sds.fixedPitch_ <<
|
||||||
|
token::END_STATEMENT << endl;
|
||||||
|
os.writeKeyword("fixedYaw") << tab << sds.fixedYaw_ <<
|
||||||
|
token::END_STATEMENT << endl;
|
||||||
|
|
||||||
return os;
|
return os;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -131,6 +131,33 @@ class sixDOFqODE
|
||||||
scalarField coeffs_;
|
scalarField coeffs_;
|
||||||
|
|
||||||
|
|
||||||
|
//- Motion constraints (given as fixed motion components)
|
||||||
|
|
||||||
|
//- Fixed surge (x-translation)
|
||||||
|
Switch fixedSurge_;
|
||||||
|
|
||||||
|
//- Fixed sway (y-translation)
|
||||||
|
Switch fixedSway_;
|
||||||
|
|
||||||
|
//- Fixed heave (z-translation)
|
||||||
|
Switch fixedHeave_;
|
||||||
|
|
||||||
|
//- Fixed roll (rotation around x)
|
||||||
|
Switch fixedRoll_;
|
||||||
|
|
||||||
|
//- Fixed pitch (rotation around y)
|
||||||
|
Switch fixedPitch_;
|
||||||
|
|
||||||
|
//- Fixed yaw (rotation around z)
|
||||||
|
Switch fixedYaw_;
|
||||||
|
|
||||||
|
//- Restraints in referent coordinate system
|
||||||
|
Switch referentMotionConstraints_;
|
||||||
|
|
||||||
|
//- Rotation of referent coordinate system
|
||||||
|
HamiltonRodriguezRot referentRotation_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
|
||||||
//- Disallow default bitwise copy construct
|
//- Disallow default bitwise copy construct
|
||||||
|
@ -170,6 +197,14 @@ class sixDOFqODE
|
||||||
const dimensionedVector& omega
|
const dimensionedVector& omega
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
//- Constrain rotation vector in referent or global coordinate
|
||||||
|
// system
|
||||||
|
void constrainRotation(vector& vec) const;
|
||||||
|
|
||||||
|
//- Constrain translation vector in referent or global coordinate
|
||||||
|
// system
|
||||||
|
void constrainTranslation(vector& vec) const;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
@ -265,6 +300,9 @@ public:
|
||||||
// coordinate system
|
// coordinate system
|
||||||
inline void setOmega(const vector& omega);
|
inline void setOmega(const vector& omega);
|
||||||
|
|
||||||
|
//- Set referent coordinate system to apply constraints
|
||||||
|
inline void setReferentRotation(const HamiltonRodriguezRot& rot);
|
||||||
|
|
||||||
|
|
||||||
// Average motion per time-step
|
// Average motion per time-step
|
||||||
|
|
||||||
|
|
|
@ -166,6 +166,14 @@ void Foam::sixDOFqODE::setOmega(const vector& omega)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
void Foam::sixDOFqODE::setReferentRotation(const HamiltonRodriguezRot& rot)
|
||||||
|
{
|
||||||
|
referentRotation_ = rot;
|
||||||
|
|
||||||
|
referentMotionConstraints_ = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const Foam::dimensionedVector& Foam::sixDOFqODE::Uaverage() const
|
const Foam::dimensionedVector& Foam::sixDOFqODE::Uaverage() const
|
||||||
{
|
{
|
||||||
return Uaverage_;
|
return Uaverage_;
|
||||||
|
|
|
@ -46,7 +46,7 @@ SourceFiles
|
||||||
#include "OSspecific.H"
|
#include "OSspecific.H"
|
||||||
#include <signal.h>
|
#include <signal.h>
|
||||||
|
|
||||||
#if defined(linux) || defined(linuxAMD64) || defined(linuxIA64)
|
#if defined(linux) || defined(linuxAMD64) || defined(linuxIA64) || defined(linuxARM7)
|
||||||
# define LINUX
|
# define LINUX
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
|
|
|
@ -446,7 +446,7 @@ void Foam::cellTable::addCellZones
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
Map<label> typeToZone = zoneMap();
|
Map<label> typeToZone = zoneMap();
|
||||||
List<DynamicList<label> > zoneCells(size());
|
List<dynamicLabelList > zoneCells(size());
|
||||||
|
|
||||||
forAll(tableIds, cellI)
|
forAll(tableIds, cellI)
|
||||||
{
|
{
|
||||||
|
|
|
@ -230,7 +230,7 @@ Foam::labelList Foam::polyDualMesh::collectPatchSideFace
|
||||||
label meshPointI = patch.meshPoints()[pointI];
|
label meshPointI = patch.meshPoints()[pointI];
|
||||||
const labelList& pFaces = patch.pointFaces()[pointI];
|
const labelList& pFaces = patch.pointFaces()[pointI];
|
||||||
|
|
||||||
DynamicList<label> dualFace;
|
dynamicLabelList dualFace;
|
||||||
|
|
||||||
if (pointToDualPoint[meshPointI] >= 0)
|
if (pointToDualPoint[meshPointI] >= 0)
|
||||||
{
|
{
|
||||||
|
@ -345,9 +345,9 @@ void Foam::polyDualMesh::collectPatchInternalFace
|
||||||
const labelList& pFaces = patch.pointFaces()[pointI];
|
const labelList& pFaces = patch.pointFaces()[pointI];
|
||||||
|
|
||||||
// Vertices of dualFace
|
// Vertices of dualFace
|
||||||
DynamicList<label> dualFace(pFaces.size());
|
dynamicLabelList dualFace(pFaces.size());
|
||||||
// Indices in dualFace of vertices added because of feature edge
|
// Indices in dualFace of vertices added because of feature edge
|
||||||
DynamicList<label> featEdgeIndices(dualFace.size());
|
dynamicLabelList featEdgeIndices(dualFace.size());
|
||||||
|
|
||||||
|
|
||||||
label edgeI = startEdgeI;
|
label edgeI = startEdgeI;
|
||||||
|
@ -440,9 +440,9 @@ void Foam::polyDualMesh::splitFace
|
||||||
const labelList& featEdgeIndices,
|
const labelList& featEdgeIndices,
|
||||||
|
|
||||||
DynamicList<face>& dualFaces,
|
DynamicList<face>& dualFaces,
|
||||||
DynamicList<label>& dualOwner,
|
dynamicLabelList& dualOwner,
|
||||||
DynamicList<label>& dualNeighbour,
|
dynamicLabelList& dualNeighbour,
|
||||||
DynamicList<label>& dualRegion
|
dynamicLabelList& dualRegion
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
|
||||||
|
@ -522,7 +522,7 @@ void Foam::polyDualMesh::splitFace
|
||||||
// number of feature edges > 2.
|
// number of feature edges > 2.
|
||||||
|
|
||||||
// Storage for new face
|
// Storage for new face
|
||||||
DynamicList<label> subFace(dualFace.size());
|
dynamicLabelList subFace(dualFace.size());
|
||||||
|
|
||||||
forAll(featEdgeIndices, featI)
|
forAll(featEdgeIndices, featI)
|
||||||
{
|
{
|
||||||
|
@ -587,9 +587,9 @@ void Foam::polyDualMesh::dualPatch
|
||||||
const pointField& dualPoints,
|
const pointField& dualPoints,
|
||||||
|
|
||||||
DynamicList<face>& dualFaces,
|
DynamicList<face>& dualFaces,
|
||||||
DynamicList<label>& dualOwner,
|
dynamicLabelList& dualOwner,
|
||||||
DynamicList<label>& dualNeighbour,
|
dynamicLabelList& dualNeighbour,
|
||||||
DynamicList<label>& dualRegion
|
dynamicLabelList& dualRegion
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
const labelList& meshEdges = patch.meshEdges();
|
const labelList& meshEdges = patch.meshEdges();
|
||||||
|
@ -885,9 +885,9 @@ void Foam::polyDualMesh::calcDual
|
||||||
// Dynamic sized since we don't know size.
|
// Dynamic sized since we don't know size.
|
||||||
|
|
||||||
DynamicList<face> dynDualFaces(mesh.nEdges());
|
DynamicList<face> dynDualFaces(mesh.nEdges());
|
||||||
DynamicList<label> dynDualOwner(mesh.nEdges());
|
dynamicLabelList dynDualOwner(mesh.nEdges());
|
||||||
DynamicList<label> dynDualNeighbour(mesh.nEdges());
|
dynamicLabelList dynDualNeighbour(mesh.nEdges());
|
||||||
DynamicList<label> dynDualRegion(mesh.nEdges());
|
dynamicLabelList dynDualRegion(mesh.nEdges());
|
||||||
|
|
||||||
|
|
||||||
// Generate faces from edges on the boundary
|
// Generate faces from edges on the boundary
|
||||||
|
@ -950,7 +950,7 @@ void Foam::polyDualMesh::calcDual
|
||||||
|
|
||||||
// Now walk from startFaceI to cell to face to cell etc. until endFaceI
|
// Now walk from startFaceI to cell to face to cell etc. until endFaceI
|
||||||
|
|
||||||
DynamicList<label> dualFace;
|
dynamicLabelList dualFace;
|
||||||
|
|
||||||
if (edgeToDualPoint[edgeI] >= 0)
|
if (edgeToDualPoint[edgeI] >= 0)
|
||||||
{
|
{
|
||||||
|
@ -1084,7 +1084,7 @@ void Foam::polyDualMesh::calcDual
|
||||||
}
|
}
|
||||||
|
|
||||||
// Walk face-cell-face until starting face reached.
|
// Walk face-cell-face until starting face reached.
|
||||||
DynamicList<label> dualFace(mesh.edgeCells()[edgeI].size());
|
dynamicLabelList dualFace(mesh.edgeCells()[edgeI].size());
|
||||||
|
|
||||||
label faceI = startFaceI;
|
label faceI = startFaceI;
|
||||||
|
|
||||||
|
@ -1566,7 +1566,7 @@ void Foam::polyDualMesh::calcFeatures
|
||||||
|
|
||||||
const labelListList& pointEdges = allBoundary.pointEdges();
|
const labelListList& pointEdges = allBoundary.pointEdges();
|
||||||
|
|
||||||
DynamicList<label> allFeaturePoints(pointEdges.size());
|
dynamicLabelList allFeaturePoints(pointEdges.size());
|
||||||
|
|
||||||
forAll(pointEdges, pointI)
|
forAll(pointEdges, pointI)
|
||||||
{
|
{
|
||||||
|
@ -1620,7 +1620,7 @@ void Foam::polyDualMesh::calcFeatures
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
DynamicList<label> allFeatureEdges(isFeatureEdge.size());
|
dynamicLabelList allFeatureEdges(isFeatureEdge.size());
|
||||||
forAll(isFeatureEdge, edgeI)
|
forAll(isFeatureEdge, edgeI)
|
||||||
{
|
{
|
||||||
if (isFeatureEdge[edgeI])
|
if (isFeatureEdge[edgeI])
|
||||||
|
|
|
@ -119,9 +119,9 @@ class polyDualMesh
|
||||||
const labelList& featEdgeIndices,
|
const labelList& featEdgeIndices,
|
||||||
|
|
||||||
DynamicList<face>& dualFaces,
|
DynamicList<face>& dualFaces,
|
||||||
DynamicList<label>& dualOwner,
|
dynamicLabelList& dualOwner,
|
||||||
DynamicList<label>& dualNeighbour,
|
dynamicLabelList& dualNeighbour,
|
||||||
DynamicList<label>& dualRegion
|
dynamicLabelList& dualRegion
|
||||||
);
|
);
|
||||||
|
|
||||||
static void dualPatch
|
static void dualPatch
|
||||||
|
@ -134,9 +134,9 @@ class polyDualMesh
|
||||||
const pointField& dualPoints,
|
const pointField& dualPoints,
|
||||||
|
|
||||||
DynamicList<face>& dualFaces,
|
DynamicList<face>& dualFaces,
|
||||||
DynamicList<label>& dualOwner,
|
dynamicLabelList& dualOwner,
|
||||||
DynamicList<label>& dualNeighbour,
|
dynamicLabelList& dualNeighbour,
|
||||||
DynamicList<label>& dualRegion
|
dynamicLabelList& dualRegion
|
||||||
);
|
);
|
||||||
|
|
||||||
void calcDual
|
void calcDual
|
||||||
|
|
|
@ -161,7 +161,7 @@ void Foam::mgMeshLevel::makeChild() const
|
||||||
options[3] = nGeometricD(); // Dimensionality of the grid
|
options[3] = nGeometricD(); // Dimensionality of the grid
|
||||||
|
|
||||||
// Output: cell to coarse clusted addressing
|
// Output: cell to coarse clusted addressing
|
||||||
label nCoarseCells = 0;
|
int nCoarseCells = 0;
|
||||||
child_.setSize(nCells());
|
child_.setSize(nCells());
|
||||||
int nMoves = -1;
|
int nMoves = -1;
|
||||||
|
|
||||||
|
@ -214,8 +214,8 @@ void Foam::mgMeshLevel::makeChild() const
|
||||||
dblAreas.begin(),
|
dblAreas.begin(),
|
||||||
cellCells.begin(),
|
cellCells.begin(),
|
||||||
dblFaceWeights.begin(),
|
dblFaceWeights.begin(),
|
||||||
mgMinClusterSize_,
|
mgMinClusterSize_(),
|
||||||
mgMaxClusterSize_,
|
mgMaxClusterSize_(),
|
||||||
options.begin(),
|
options.begin(),
|
||||||
&nMoves,
|
&nMoves,
|
||||||
&nCoarseCells_,
|
&nCoarseCells_,
|
||||||
|
|
|
@ -341,7 +341,7 @@ void Foam::decompositionMethod::calcCellCells
|
||||||
) << "Only valid for mesh agglomeration." << exit(FatalError);
|
) << "Only valid for mesh agglomeration." << exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
List<DynamicList<label> > dynCellCells(nCoarse);
|
List<dynamicLabelList > dynCellCells(nCoarse);
|
||||||
|
|
||||||
forAll(mesh.faceNeighbour(), faceI)
|
forAll(mesh.faceNeighbour(), faceI)
|
||||||
{
|
{
|
||||||
|
|
|
@ -11,5 +11,4 @@ LIB_LIBS = \
|
||||||
-L$(METIS_LIB_DIR) -lmetis \
|
-L$(METIS_LIB_DIR) -lmetis \
|
||||||
-L$(PARMETIS_LIB_DIR) -lmetis -lparmetis \
|
-L$(PARMETIS_LIB_DIR) -lmetis -lparmetis \
|
||||||
-ldecompositionMethods \
|
-ldecompositionMethods \
|
||||||
-lmetisDecomp \
|
-lmetisDecomp
|
||||||
-L$(OPENMPI_DIR)/lib -lmpi
|
|
||||||
|
|
|
@ -665,7 +665,7 @@ Foam::labelList Foam::parMetisDecomp::decompose
|
||||||
|
|
||||||
labelListList globalRegionRegions;
|
labelListList globalRegionRegions;
|
||||||
{
|
{
|
||||||
List<DynamicList<label> > dynRegionRegions(regionPoints.size());
|
List<dynamicLabelList > dynRegionRegions(regionPoints.size());
|
||||||
|
|
||||||
// Internal faces first
|
// Internal faces first
|
||||||
forAll(faceNeighbour, faceI)
|
forAll(faceNeighbour, faceI)
|
||||||
|
|
|
@ -17,6 +17,7 @@ LIB_LIBS = \
|
||||||
-ldecompositionMethods \
|
-ldecompositionMethods \
|
||||||
-L$(SCOTCH_LIB_DIR) -lscotch \
|
-L$(SCOTCH_LIB_DIR) -lscotch \
|
||||||
-L$(SCOTCH_LIB_DIR) -lscotcherrexit \
|
-L$(SCOTCH_LIB_DIR) -lscotcherrexit \
|
||||||
|
-L$(WM_THIRD_PARTY_DIR)/packages/pthreads-w32-2-9-1-release/Pre-built.2/lib/x64 -lpthreadGC2 \
|
||||||
-L$(OPENMPI_DIR)/lib -lmpi
|
-L$(OPENMPI_DIR)/lib -lmpi
|
||||||
|
|
||||||
#else
|
#else
|
||||||
|
|
|
@ -695,7 +695,7 @@ labelList dynamicRefineFvMesh::selectRefineCells
|
||||||
label nCandidates = returnReduce(count(candidateCell, 1), sumOp<label>());
|
label nCandidates = returnReduce(count(candidateCell, 1), sumOp<label>());
|
||||||
|
|
||||||
// Collect all cells
|
// Collect all cells
|
||||||
DynamicList<label> candidates(nCells());
|
dynamicLabelList candidates(nCells());
|
||||||
|
|
||||||
if (nCandidates < nTotToRefine)
|
if (nCandidates < nTotToRefine)
|
||||||
{
|
{
|
||||||
|
@ -771,7 +771,7 @@ labelList dynamicRefineFvMesh::selectUnrefinePoints
|
||||||
// All points that can be unrefined
|
// All points that can be unrefined
|
||||||
const labelList splitPoints(meshCutter_.getSplitPoints());
|
const labelList splitPoints(meshCutter_.getSplitPoints());
|
||||||
|
|
||||||
DynamicList<label> newSplitPoints(splitPoints.size());
|
dynamicLabelList newSplitPoints(splitPoints.size());
|
||||||
|
|
||||||
forAll(splitPoints, i)
|
forAll(splitPoints, i)
|
||||||
{
|
{
|
||||||
|
|
|
@ -322,8 +322,9 @@ bool Foam::mixerGgiFvMesh::update()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// The mesh is not morphing
|
// The mesh is not morphing, but flux re-calculation is required
|
||||||
return false;
|
// HJ, 25/Jan/2016
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -235,8 +235,9 @@ bool Foam::turboFvMesh::update()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
// The mesh is not morphing
|
// The mesh is not morphing, but flux re-calculation is required
|
||||||
return false;
|
// HJ, 25/Jan/2016
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ void Foam::boundaryMesh::markEdges
|
||||||
const label edgeI,
|
const label edgeI,
|
||||||
const label distance,
|
const label distance,
|
||||||
labelList& minDistance,
|
labelList& minDistance,
|
||||||
DynamicList<label>& visited
|
dynamicLabelList& visited
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (distance < maxDistance)
|
if (distance < maxDistance)
|
||||||
|
@ -868,8 +868,8 @@ Foam::labelList Foam::boundaryMesh::getNearest
|
||||||
// Divide faces into two bins acc. to normal
|
// Divide faces into two bins acc. to normal
|
||||||
// - left of splitNormal
|
// - left of splitNormal
|
||||||
// - right ,,
|
// - right ,,
|
||||||
DynamicList<label> leftFaces(mesh().size()/2);
|
dynamicLabelList leftFaces(mesh().size()/2);
|
||||||
DynamicList<label> rightFaces(mesh().size()/2);
|
dynamicLabelList rightFaces(mesh().size()/2);
|
||||||
|
|
||||||
forAll(mesh(), bFaceI)
|
forAll(mesh(), bFaceI)
|
||||||
{
|
{
|
||||||
|
@ -1241,7 +1241,7 @@ void Foam::boundaryMesh::patchify
|
||||||
|
|
||||||
if (newPatchPtrList.size() > 0)
|
if (newPatchPtrList.size() > 0)
|
||||||
{
|
{
|
||||||
List<DynamicList<label> > patchFaces(nNewPatches);
|
List<dynamicLabelList > patchFaces(nNewPatches);
|
||||||
|
|
||||||
// Give reasonable estimate for size of patches
|
// Give reasonable estimate for size of patches
|
||||||
label nAvgFaces =
|
label nAvgFaces =
|
||||||
|
@ -1505,7 +1505,7 @@ void Foam::boundaryMesh::setExtraEdges(const label edgeI)
|
||||||
|
|
||||||
// All edge labels encountered
|
// All edge labels encountered
|
||||||
|
|
||||||
DynamicList<label> visitedEdges;
|
dynamicLabelList visitedEdges;
|
||||||
|
|
||||||
// Floodfill from edgeI starting from distance 0. Stop at distance.
|
// Floodfill from edgeI starting from distance 0. Stop at distance.
|
||||||
markEdges(8, edgeI, 0, minDistance, visitedEdges);
|
markEdges(8, edgeI, 0, minDistance, visitedEdges);
|
||||||
|
|
|
@ -132,7 +132,7 @@ class boundaryMesh
|
||||||
const label edgeI,
|
const label edgeI,
|
||||||
const label distance,
|
const label distance,
|
||||||
labelList& minDistance,
|
labelList& minDistance,
|
||||||
DynamicList<label>& visited
|
dynamicLabelList& visited
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Get index of polypatch by name
|
//- Get index of polypatch by name
|
||||||
|
|
|
@ -235,7 +235,7 @@ bool Foam::combineFaces::faceNeighboursValid
|
||||||
// to be 3 or more.
|
// to be 3 or more.
|
||||||
|
|
||||||
// Unregioned neighbouring faces
|
// Unregioned neighbouring faces
|
||||||
DynamicList<label> neighbourFaces(cFaces.size());
|
dynamicLabelList neighbourFaces(cFaces.size());
|
||||||
// Regioned neighbouring faces
|
// Regioned neighbouring faces
|
||||||
labelHashSet neighbourRegions;
|
labelHashSet neighbourRegions;
|
||||||
|
|
||||||
|
|
|
@ -38,7 +38,7 @@ SourceFiles
|
||||||
#define edgeCollapser_H
|
#define edgeCollapser_H
|
||||||
|
|
||||||
#include "labelList.H"
|
#include "labelList.H"
|
||||||
#include "DynamicList.H"
|
#include "dynamicLabelList.H"
|
||||||
#include "typeInfo.H"
|
#include "typeInfo.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
@ -67,7 +67,7 @@ class edgeCollapser
|
||||||
labelList pointRegion_;
|
labelList pointRegion_;
|
||||||
|
|
||||||
//- -1 or master vertex for region number
|
//- -1 or master vertex for region number
|
||||||
DynamicList<label> pointRegionMaster_;
|
dynamicLabelList pointRegionMaster_;
|
||||||
|
|
||||||
//- Stack of free region numbers. Corresponds to -1 in pointRegionMaster
|
//- Stack of free region numbers. Corresponds to -1 in pointRegionMaster
|
||||||
SLList<label> freeRegions_;
|
SLList<label> freeRegions_;
|
||||||
|
@ -139,7 +139,7 @@ public:
|
||||||
|
|
||||||
//- For every region the master (i.e. the point the region will
|
//- For every region the master (i.e. the point the region will
|
||||||
// be replaced by)
|
// be replaced by)
|
||||||
const DynamicList<label>& pointRegionMaster() const
|
const dynamicLabelList& pointRegionMaster() const
|
||||||
{
|
{
|
||||||
return pointRegionMaster_;
|
return pointRegionMaster_;
|
||||||
}
|
}
|
||||||
|
|
|
@ -103,7 +103,7 @@ void Foam::faceCollapser::filterFace
|
||||||
const labelList& fEdges = mesh_.faceEdges()[faceI];
|
const labelList& fEdges = mesh_.faceEdges()[faceI];
|
||||||
|
|
||||||
// Space for replaced vertices and split edges.
|
// Space for replaced vertices and split edges.
|
||||||
DynamicList<label> newFace(10 * f.size());
|
dynamicLabelList newFace(10 * f.size());
|
||||||
|
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
{
|
{
|
||||||
|
@ -416,7 +416,7 @@ void Foam::faceCollapser::setRefinement
|
||||||
label sorted1 = sortedFp[fp1];
|
label sorted1 = sortedFp[fp1];
|
||||||
|
|
||||||
// Get indices in increasing order
|
// Get indices in increasing order
|
||||||
DynamicList<label> edgePoints(f.size());
|
dynamicLabelList edgePoints(f.size());
|
||||||
|
|
||||||
// Whether edgePoints are from fp to fp1
|
// Whether edgePoints are from fp to fp1
|
||||||
bool fpToFp1;
|
bool fpToFp1;
|
||||||
|
|
|
@ -881,7 +881,7 @@ void Foam::hexRef8::insertEdgeSplit
|
||||||
const labelList& edgeMidPoint,
|
const labelList& edgeMidPoint,
|
||||||
const label p0,
|
const label p0,
|
||||||
const label p1,
|
const label p1,
|
||||||
DynamicList<label>& verts
|
dynamicLabelList& verts
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
if (p0 < mesh_.nPoints() && p1 < mesh_.nPoints())
|
if (p0 < mesh_.nPoints() && p1 < mesh_.nPoints())
|
||||||
|
@ -994,7 +994,7 @@ Foam::label Foam::hexRef8::storeMidPointInfo
|
||||||
// might be marked for splitting. Note that these edge splits cannot
|
// might be marked for splitting. Note that these edge splits cannot
|
||||||
// be between cellMid and face mids.
|
// be between cellMid and face mids.
|
||||||
|
|
||||||
DynamicList<label> newFaceVerts(4);
|
dynamicLabelList newFaceVerts(4);
|
||||||
if (faceOrder == (mesh_.faceOwner()[faceI] == cellI))
|
if (faceOrder == (mesh_.faceOwner()[faceI] == cellI))
|
||||||
{
|
{
|
||||||
newFaceVerts.append(faceMidPointI);
|
newFaceVerts.append(faceMidPointI);
|
||||||
|
@ -1388,7 +1388,7 @@ void Foam::hexRef8::walkFaceToMid
|
||||||
const label cLevel,
|
const label cLevel,
|
||||||
const label faceI,
|
const label faceI,
|
||||||
const label startFp,
|
const label startFp,
|
||||||
DynamicList<label>& faceVerts
|
dynamicLabelList& faceVerts
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const face& f = mesh_.faces()[faceI];
|
const face& f = mesh_.faces()[faceI];
|
||||||
|
@ -1437,7 +1437,7 @@ void Foam::hexRef8::walkFaceFromMid
|
||||||
const label cLevel,
|
const label cLevel,
|
||||||
const label faceI,
|
const label faceI,
|
||||||
const label startFp,
|
const label startFp,
|
||||||
DynamicList<label>& faceVerts
|
dynamicLabelList& faceVerts
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
const face& f = mesh_.faces()[faceI];
|
const face& f = mesh_.faces()[faceI];
|
||||||
|
@ -2104,7 +2104,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement
|
||||||
|
|
||||||
|
|
||||||
// Labels of seed faces
|
// Labels of seed faces
|
||||||
DynamicList<label> seedFaces(mesh_.nFaces()/100);
|
dynamicLabelList seedFaces(mesh_.nFaces()/100);
|
||||||
// refinementLevel data on seed faces
|
// refinementLevel data on seed faces
|
||||||
DynamicList<refinementData> seedFacesInfo(mesh_.nFaces()/100);
|
DynamicList<refinementData> seedFacesInfo(mesh_.nFaces()/100);
|
||||||
|
|
||||||
|
@ -2597,7 +2597,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
|
||||||
|
|
||||||
|
|
||||||
// Labels of seed faces
|
// Labels of seed faces
|
||||||
DynamicList<label> seedFaces(mesh_.nFaces()/100);
|
dynamicLabelList seedFaces(mesh_.nFaces()/100);
|
||||||
// refinementLevel data on seed faces
|
// refinementLevel data on seed faces
|
||||||
DynamicList<refinementDistanceData> seedFacesInfo(mesh_.nFaces()/100);
|
DynamicList<refinementDistanceData> seedFacesInfo(mesh_.nFaces()/100);
|
||||||
|
|
||||||
|
@ -2988,12 +2988,12 @@ Foam::labelListList Foam::hexRef8::setRefinement
|
||||||
|
|
||||||
|
|
||||||
// New point/cell level. Copy of pointLevel for existing points.
|
// New point/cell level. Copy of pointLevel for existing points.
|
||||||
DynamicList<label> newCellLevel(cellLevel_.size());
|
dynamicLabelList newCellLevel(cellLevel_.size());
|
||||||
forAll(cellLevel_, cellI)
|
forAll(cellLevel_, cellI)
|
||||||
{
|
{
|
||||||
newCellLevel.append(cellLevel_[cellI]);
|
newCellLevel.append(cellLevel_[cellI]);
|
||||||
}
|
}
|
||||||
DynamicList<label> newPointLevel(pointLevel_.size());
|
dynamicLabelList newPointLevel(pointLevel_.size());
|
||||||
forAll(pointLevel_, pointI)
|
forAll(pointLevel_, pointI)
|
||||||
{
|
{
|
||||||
newPointLevel.append(pointLevel_[pointI]);
|
newPointLevel.append(pointLevel_[pointI]);
|
||||||
|
@ -3608,7 +3608,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
|
||||||
{
|
{
|
||||||
// point is anchor. Start collecting face.
|
// point is anchor. Start collecting face.
|
||||||
|
|
||||||
DynamicList<label> faceVerts(4);
|
dynamicLabelList faceVerts(4);
|
||||||
|
|
||||||
faceVerts.append(pointI);
|
faceVerts.append(pointI);
|
||||||
|
|
||||||
|
@ -3740,7 +3740,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
|
||||||
const face& f = mesh_.faces()[faceI];
|
const face& f = mesh_.faces()[faceI];
|
||||||
const labelList& fEdges = mesh_.faceEdges()[faceI];
|
const labelList& fEdges = mesh_.faceEdges()[faceI];
|
||||||
|
|
||||||
DynamicList<label> newFaceVerts(f.size());
|
dynamicLabelList newFaceVerts(f.size());
|
||||||
|
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
{
|
{
|
||||||
|
|
|
@ -217,7 +217,7 @@ class hexRef8
|
||||||
const labelList& edgeMidPoint,
|
const labelList& edgeMidPoint,
|
||||||
const label p0,
|
const label p0,
|
||||||
const label p1,
|
const label p1,
|
||||||
DynamicList<label>& verts
|
dynamicLabelList& verts
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Store in maps correspondence from midpoint to anchors and faces.
|
//- Store in maps correspondence from midpoint to anchors and faces.
|
||||||
|
@ -277,7 +277,7 @@ class hexRef8
|
||||||
const label cLevel,
|
const label cLevel,
|
||||||
const label faceI,
|
const label faceI,
|
||||||
const label startFp,
|
const label startFp,
|
||||||
DynamicList<label>& faceVerts
|
dynamicLabelList& faceVerts
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Same as walkFaceToMid but now walk back.
|
//- Same as walkFaceToMid but now walk back.
|
||||||
|
@ -287,7 +287,7 @@ class hexRef8
|
||||||
const label cLevel,
|
const label cLevel,
|
||||||
const label faceI,
|
const label faceI,
|
||||||
const label startFp,
|
const label startFp,
|
||||||
DynamicList<label>& faceVerts
|
dynamicLabelList& faceVerts
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
//- Updates refineCell so consistent 2:1 refinement. Returns local
|
//- Updates refineCell so consistent 2:1 refinement. Returns local
|
||||||
|
|
|
@ -144,7 +144,7 @@ Foam::labelList Foam::removeCells::getExposedFaces
|
||||||
// 2 : unaffected internal face
|
// 2 : unaffected internal face
|
||||||
// unaffected coupled boundary face
|
// unaffected coupled boundary face
|
||||||
|
|
||||||
DynamicList<label> exposedFaces(mesh_.nFaces()/10);
|
dynamicLabelList exposedFaces(mesh_.nFaces()/10);
|
||||||
|
|
||||||
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -339,7 +339,7 @@ void Foam::removeFaces::mergeFaces
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
DynamicList<label> faceVerts(edgeLoop.size());
|
dynamicLabelList faceVerts(edgeLoop.size());
|
||||||
|
|
||||||
forAll(edgeLoop, i)
|
forAll(edgeLoop, i)
|
||||||
{
|
{
|
||||||
|
@ -740,7 +740,7 @@ Foam::label Foam::removeFaces::compatibleRemoves
|
||||||
}
|
}
|
||||||
|
|
||||||
// Recreate facesToRemove to be consistent with the cellRegions.
|
// Recreate facesToRemove to be consistent with the cellRegions.
|
||||||
DynamicList<label> allFacesToRemove(facesToRemove.size());
|
dynamicLabelList allFacesToRemove(facesToRemove.size());
|
||||||
|
|
||||||
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
|
||||||
{
|
{
|
||||||
|
|
|
@ -60,7 +60,7 @@ const Foam::point Foam::directTopoChange::greatPoint
|
||||||
void Foam::directTopoChange::renumber
|
void Foam::directTopoChange::renumber
|
||||||
(
|
(
|
||||||
const labelList& map,
|
const labelList& map,
|
||||||
DynamicList<label>& elems
|
dynamicLabelList& elems
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
forAll (elems, elemI)
|
forAll (elems, elemI)
|
||||||
|
@ -77,7 +77,7 @@ void Foam::directTopoChange::renumber
|
||||||
void Foam::directTopoChange::renumberReverseMap
|
void Foam::directTopoChange::renumberReverseMap
|
||||||
(
|
(
|
||||||
const labelList& map,
|
const labelList& map,
|
||||||
DynamicList<label>& elems
|
dynamicLabelList& elems
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
forAll (elems, elemI)
|
forAll (elems, elemI)
|
||||||
|
|
|
@ -125,11 +125,11 @@ class directTopoChange
|
||||||
DynamicList<point> points_;
|
DynamicList<point> points_;
|
||||||
|
|
||||||
//- Original point label (or masterpoint for added points)
|
//- Original point label (or masterpoint for added points)
|
||||||
DynamicList<label> pointMap_;
|
dynamicLabelList pointMap_;
|
||||||
|
|
||||||
//- For all original and added points contains new point label.
|
//- For all original and added points contains new point label.
|
||||||
// (used to map return value of addPoint to new mesh point)
|
// (used to map return value of addPoint to new mesh point)
|
||||||
DynamicList<label> reversePointMap_;
|
dynamicLabelList reversePointMap_;
|
||||||
|
|
||||||
//- Zone of point
|
//- Zone of point
|
||||||
Map<label> pointZone_;
|
Map<label> pointZone_;
|
||||||
|
@ -144,21 +144,21 @@ class directTopoChange
|
||||||
DynamicList<face> faces_;
|
DynamicList<face> faces_;
|
||||||
|
|
||||||
//- Patch for every external face (-1 for internal faces)
|
//- Patch for every external face (-1 for internal faces)
|
||||||
DynamicList<label> region_;
|
dynamicLabelList region_;
|
||||||
|
|
||||||
//- Owner for all faces
|
//- Owner for all faces
|
||||||
DynamicList<label> faceOwner_;
|
dynamicLabelList faceOwner_;
|
||||||
|
|
||||||
//- Neighbour for internal faces (-1 for external faces)
|
//- Neighbour for internal faces (-1 for external faces)
|
||||||
DynamicList<label> faceNeighbour_;
|
dynamicLabelList faceNeighbour_;
|
||||||
|
|
||||||
//- Original face label. Or master face for added-from-faces;
|
//- Original face label. Or master face for added-from-faces;
|
||||||
// -1 for faces added-from-edge or added-from-point)
|
// -1 for faces added-from-edge or added-from-point)
|
||||||
DynamicList<label> faceMap_;
|
dynamicLabelList faceMap_;
|
||||||
|
|
||||||
//- For all original and added faces contains new face label
|
//- For all original and added faces contains new face label
|
||||||
// (used to map return value of addFace to new mesh face)
|
// (used to map return value of addFace to new mesh face)
|
||||||
DynamicList<label> reverseFaceMap_;
|
dynamicLabelList reverseFaceMap_;
|
||||||
|
|
||||||
//- Faces added from point (corresponding faceMap_ will
|
//- Faces added from point (corresponding faceMap_ will
|
||||||
// be -1)
|
// be -1)
|
||||||
|
@ -185,11 +185,11 @@ class directTopoChange
|
||||||
|
|
||||||
//- Original cell label or master cell for added-from-cell;
|
//- Original cell label or master cell for added-from-cell;
|
||||||
// -1 for cells added from face or edge.
|
// -1 for cells added from face or edge.
|
||||||
DynamicList<label> cellMap_;
|
dynamicLabelList cellMap_;
|
||||||
|
|
||||||
//- For all original and added cells contains new cell label
|
//- For all original and added cells contains new cell label
|
||||||
// (used to map return value of addCell to new mesh cell)
|
// (used to map return value of addCell to new mesh cell)
|
||||||
DynamicList<label> reverseCellMap_;
|
dynamicLabelList reverseCellMap_;
|
||||||
|
|
||||||
//- Cells added from point
|
//- Cells added from point
|
||||||
Map<label> cellFromPoint_;
|
Map<label> cellFromPoint_;
|
||||||
|
@ -201,7 +201,7 @@ class directTopoChange
|
||||||
Map<label> cellFromFace_;
|
Map<label> cellFromFace_;
|
||||||
|
|
||||||
//- Zone of cell
|
//- Zone of cell
|
||||||
DynamicList<label> cellZone_;
|
dynamicLabelList cellZone_;
|
||||||
|
|
||||||
|
|
||||||
// Private Member Functions
|
// Private Member Functions
|
||||||
|
@ -215,10 +215,10 @@ class directTopoChange
|
||||||
static void renumberKey(const labelList& map, Map<T>&);
|
static void renumberKey(const labelList& map, Map<T>&);
|
||||||
|
|
||||||
//- Renumber elements of list according to map
|
//- Renumber elements of list according to map
|
||||||
static void renumber(const labelList&, DynamicList<label>&);
|
static void renumber(const labelList&, dynamicLabelList&);
|
||||||
static void renumber(const labelList&, labelHashSet&);
|
static void renumber(const labelList&, labelHashSet&);
|
||||||
//- Special handling of reverse maps which have <-1 in them
|
//- Special handling of reverse maps which have <-1 in them
|
||||||
static void renumberReverseMap(const labelList&, DynamicList<label>&);
|
static void renumberReverseMap(const labelList&, dynamicLabelList&);
|
||||||
|
|
||||||
//- Renumber & compact elements of list according to map
|
//- Renumber & compact elements of list according to map
|
||||||
static void renumberCompact(const labelList&, labelList&);
|
static void renumberCompact(const labelList&, labelList&);
|
||||||
|
@ -430,19 +430,19 @@ public:
|
||||||
return faces_;
|
return faces_;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DynamicList<label>& region() const
|
const dynamicLabelList& region() const
|
||||||
{
|
{
|
||||||
return region_;
|
return region_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Owner
|
//- Owner
|
||||||
const DynamicList<label>& faceOwner() const
|
const dynamicLabelList& faceOwner() const
|
||||||
{
|
{
|
||||||
return faceOwner_;
|
return faceOwner_;
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Neighbour
|
//- Neighbour
|
||||||
const DynamicList<label>& faceNeighbour()const
|
const dynamicLabelList& faceNeighbour()const
|
||||||
{
|
{
|
||||||
return faceNeighbour_;
|
return faceNeighbour_;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1352,8 +1352,8 @@ bool Foam::cellCuts::calcAnchors
|
||||||
walkEdges(cellI, cPoints[uncutIndex], 2, edgeStatus, pointStatus);
|
walkEdges(cellI, cPoints[uncutIndex], 2, edgeStatus, pointStatus);
|
||||||
|
|
||||||
// Collect both sets in lists.
|
// Collect both sets in lists.
|
||||||
DynamicList<label> connectedPoints(cPoints.size());
|
dynamicLabelList connectedPoints(cPoints.size());
|
||||||
DynamicList<label> otherPoints(cPoints.size());
|
dynamicLabelList otherPoints(cPoints.size());
|
||||||
|
|
||||||
forAllConstIter(Map<label>, pointStatus, iter)
|
forAllConstIter(Map<label>, pointStatus, iter)
|
||||||
{
|
{
|
||||||
|
@ -2238,7 +2238,7 @@ void Foam::cellCuts::setFromCellCutter
|
||||||
scalarField cellLoopWeights;
|
scalarField cellLoopWeights;
|
||||||
|
|
||||||
// For debugging purposes
|
// For debugging purposes
|
||||||
DynamicList<label> invalidCutCells(2);
|
dynamicLabelList invalidCutCells(2);
|
||||||
DynamicList<labelList> invalidCutLoops(2);
|
DynamicList<labelList> invalidCutLoops(2);
|
||||||
DynamicList<scalarField> invalidCutLoopWeights(2);
|
DynamicList<scalarField> invalidCutLoopWeights(2);
|
||||||
|
|
||||||
|
@ -2355,7 +2355,7 @@ void Foam::cellCuts::setFromCellCutter
|
||||||
scalarField cellLoopWeights;
|
scalarField cellLoopWeights;
|
||||||
|
|
||||||
// For debugging purposes
|
// For debugging purposes
|
||||||
DynamicList<label> invalidCutCells(2);
|
dynamicLabelList invalidCutCells(2);
|
||||||
DynamicList<labelList> invalidCutLoops(2);
|
DynamicList<labelList> invalidCutLoops(2);
|
||||||
DynamicList<scalarField> invalidCutLoopWeights(2);
|
DynamicList<scalarField> invalidCutLoopWeights(2);
|
||||||
|
|
||||||
|
|
|
@ -280,7 +280,7 @@ bool Foam::geomCellLooper::cut
|
||||||
// Size overly big.
|
// Size overly big.
|
||||||
label nEstCuts = 2*mesh().cells()[cellI].size();
|
label nEstCuts = 2*mesh().cells()[cellI].size();
|
||||||
|
|
||||||
DynamicList<label> localLoop(nEstCuts);
|
dynamicLabelList localLoop(nEstCuts);
|
||||||
DynamicList<scalar> localLoopWeights(nEstCuts);
|
DynamicList<scalar> localLoopWeights(nEstCuts);
|
||||||
|
|
||||||
// Points checked. Used to make sure we don't cut edge and edge endpoints
|
// Points checked. Used to make sure we don't cut edge and edge endpoints
|
||||||
|
|
|
@ -386,7 +386,7 @@ void Foam::topoCellLooper::walkSplitHex
|
||||||
const label fromEdgeI,
|
const label fromEdgeI,
|
||||||
const label fromVertI,
|
const label fromVertI,
|
||||||
|
|
||||||
DynamicList<label>& loop,
|
dynamicLabelList& loop,
|
||||||
DynamicList<scalar>& loopWeights
|
DynamicList<scalar>& loopWeights
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
|
@ -770,7 +770,7 @@ bool Foam::topoCellLooper::cut
|
||||||
|
|
||||||
label nEstCuts = 2*mesh().cells()[cellI].size();
|
label nEstCuts = 2*mesh().cells()[cellI].size();
|
||||||
|
|
||||||
DynamicList<label> localLoop(nEstCuts);
|
dynamicLabelList localLoop(nEstCuts);
|
||||||
DynamicList<scalar> localLoopWeights(nEstCuts);
|
DynamicList<scalar> localLoopWeights(nEstCuts);
|
||||||
|
|
||||||
walkSplitHex
|
walkSplitHex
|
||||||
|
|
|
@ -139,7 +139,7 @@ class topoCellLooper
|
||||||
const label fromEdgeI,
|
const label fromEdgeI,
|
||||||
const label fromVertI,
|
const label fromVertI,
|
||||||
|
|
||||||
DynamicList<label>& loop,
|
dynamicLabelList& loop,
|
||||||
DynamicList<scalar>& loopWeights
|
DynamicList<scalar>& loopWeights
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
|
@ -92,7 +92,7 @@ Foam::face Foam::boundaryCutter::addEdgeCutsToFace
|
||||||
const labelList& fEdges = mesh_.faceEdges()[faceI];
|
const labelList& fEdges = mesh_.faceEdges()[faceI];
|
||||||
|
|
||||||
// Storage for face
|
// Storage for face
|
||||||
DynamicList<label> newFace(2 * f.size());
|
dynamicLabelList newFace(2 * f.size());
|
||||||
|
|
||||||
forAll(f, fp)
|
forAll(f, fp)
|
||||||
{
|
{
|
||||||
|
@ -339,7 +339,7 @@ bool Foam::boundaryCutter::splitFace
|
||||||
|
|
||||||
|
|
||||||
// Storage for new face
|
// Storage for new face
|
||||||
DynamicList<label> newFace(extendedFace.size());
|
dynamicLabelList newFace(extendedFace.size());
|
||||||
|
|
||||||
label fp = startFp;
|
label fp = startFp;
|
||||||
|
|
||||||
|
@ -683,7 +683,7 @@ void Foam::boundaryCutter::setRefinement
|
||||||
// Replace existing face by newFace from fp0 to fp1 and add new one
|
// Replace existing face by newFace from fp0 to fp1 and add new one
|
||||||
// from fp1 to fp0.
|
// from fp1 to fp0.
|
||||||
|
|
||||||
DynamicList<label> newVerts(newFace.size());
|
dynamicLabelList newVerts(newFace.size());
|
||||||
|
|
||||||
// Get vertices from fp0 to (and including) fp1
|
// Get vertices from fp0 to (and including) fp1
|
||||||
label fp = fp0;
|
label fp = fp0;
|
||||||
|
|
|
@ -357,7 +357,7 @@ Foam::labelList Foam::undoableMeshCutter::getSplitFaces() const
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
}
|
}
|
||||||
|
|
||||||
DynamicList<label> liveSplitFaces(liveSplitCells_.size());
|
dynamicLabelList liveSplitFaces(liveSplitCells_.size());
|
||||||
|
|
||||||
forAllConstIter(Map<splitCell*>, liveSplitCells_, iter)
|
forAllConstIter(Map<splitCell*>, liveSplitCells_, iter)
|
||||||
{
|
{
|
||||||
|
|
|
@ -562,7 +562,7 @@ void Foam::faceCoupleInfo::setCutEdgeToPoints(const labelList& cutToMasterEdges)
|
||||||
// String up the edges between e[0] and e[1]. Store the points
|
// String up the edges between e[0] and e[1]. Store the points
|
||||||
// inbetween e[0] and e[1] (all in cutFaces() labels)
|
// inbetween e[0] and e[1] (all in cutFaces() labels)
|
||||||
|
|
||||||
DynamicList<label> splitPoints(stringedEdges.size()-1);
|
dynamicLabelList splitPoints(stringedEdges.size()-1);
|
||||||
|
|
||||||
// Unsplit edge endpoints
|
// Unsplit edge endpoints
|
||||||
const edge unsplitEdge
|
const edge unsplitEdge
|
||||||
|
@ -766,7 +766,7 @@ bool Foam::faceCoupleInfo::matchPointsThroughFaces
|
||||||
// Compaction list for cut points: either -1 or index into master which
|
// Compaction list for cut points: either -1 or index into master which
|
||||||
// gives the point to compact to.
|
// gives the point to compact to.
|
||||||
labelList cutPointRegion(cutPoints.size(), -1);
|
labelList cutPointRegion(cutPoints.size(), -1);
|
||||||
DynamicList<label> cutPointRegionMaster;
|
dynamicLabelList cutPointRegionMaster;
|
||||||
|
|
||||||
forAll(patchFaces, patchFaceI)
|
forAll(patchFaces, patchFaceI)
|
||||||
{
|
{
|
||||||
|
@ -1327,7 +1327,7 @@ Foam::label Foam::faceCoupleInfo::matchEdgeFaces
|
||||||
// the current set of master faces.
|
// the current set of master faces.
|
||||||
const labelList& masterFaces = fnd();
|
const labelList& masterFaces = fnd();
|
||||||
|
|
||||||
DynamicList<label> newCandidates(masterFaces.size());
|
dynamicLabelList newCandidates(masterFaces.size());
|
||||||
|
|
||||||
forAll(masterEFaces, j)
|
forAll(masterEFaces, j)
|
||||||
{
|
{
|
||||||
|
|
|
@ -43,7 +43,7 @@ void Foam::polyMeshAdder::append
|
||||||
(
|
(
|
||||||
const labelList& map,
|
const labelList& map,
|
||||||
const labelList& lst,
|
const labelList& lst,
|
||||||
DynamicList<label>& dynLst
|
dynamicLabelList& dynLst
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
dynLst.setSize(dynLst.size() + lst.size());
|
dynLst.setSize(dynLst.size() + lst.size());
|
||||||
|
@ -427,7 +427,7 @@ void Foam::polyMeshAdder::insertVertices
|
||||||
const labelList& masterToCutPoints,
|
const labelList& masterToCutPoints,
|
||||||
const face& masterF,
|
const face& masterF,
|
||||||
|
|
||||||
DynamicList<label>& workFace,
|
dynamicLabelList& workFace,
|
||||||
face& allF
|
face& allF
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -797,7 +797,7 @@ void Foam::polyMeshAdder::mergePrimitives
|
||||||
masterCutFaces.insert(meshFaceI);
|
masterCutFaces.insert(meshFaceI);
|
||||||
}
|
}
|
||||||
|
|
||||||
DynamicList<label> workFace(100);
|
dynamicLabelList workFace(100);
|
||||||
|
|
||||||
forAll(from0ToAllFaces, face0)
|
forAll(from0ToAllFaces, face0)
|
||||||
{
|
{
|
||||||
|
@ -896,7 +896,7 @@ void Foam::polyMeshAdder::mergePointZones
|
||||||
|
|
||||||
DynamicList<word>& zoneNames,
|
DynamicList<word>& zoneNames,
|
||||||
labelList& from1ToAll,
|
labelList& from1ToAll,
|
||||||
List<DynamicList<label> >& pzPoints
|
List<dynamicLabelList >& pzPoints
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
zoneNames.setSize(pz0.size() + pz1.size());
|
zoneNames.setSize(pz0.size() + pz1.size());
|
||||||
|
@ -917,7 +917,7 @@ void Foam::polyMeshAdder::mergePointZones
|
||||||
|
|
||||||
forAll(pz0, zoneI)
|
forAll(pz0, zoneI)
|
||||||
{
|
{
|
||||||
DynamicList<label>& newZone = pzPoints[zoneI];
|
dynamicLabelList& newZone = pzPoints[zoneI];
|
||||||
|
|
||||||
newZone.setSize(pz0[zoneI].size());
|
newZone.setSize(pz0[zoneI].size());
|
||||||
|
|
||||||
|
@ -928,7 +928,7 @@ void Foam::polyMeshAdder::mergePointZones
|
||||||
forAll(pz1, zoneI)
|
forAll(pz1, zoneI)
|
||||||
{
|
{
|
||||||
// Relabel all points of zone and add to correct pzPoints.
|
// Relabel all points of zone and add to correct pzPoints.
|
||||||
DynamicList<label>& newZone = pzPoints[from1ToAll[zoneI]];
|
dynamicLabelList& newZone = pzPoints[from1ToAll[zoneI]];
|
||||||
|
|
||||||
newZone.setSize(newZone.size() + pz1[zoneI].size());
|
newZone.setSize(newZone.size() + pz1[zoneI].size());
|
||||||
|
|
||||||
|
@ -951,7 +951,7 @@ void Foam::polyMeshAdder::mergeFaceZones
|
||||||
|
|
||||||
DynamicList<word>& zoneNames,
|
DynamicList<word>& zoneNames,
|
||||||
labelList& from1ToAll,
|
labelList& from1ToAll,
|
||||||
List<DynamicList<label> >& fzFaces,
|
List<dynamicLabelList >& fzFaces,
|
||||||
List<DynamicList<bool> >& fzFlips
|
List<DynamicList<bool> >& fzFlips
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
|
@ -973,7 +973,7 @@ void Foam::polyMeshAdder::mergeFaceZones
|
||||||
fzFlips.setSize(zoneNames.size());
|
fzFlips.setSize(zoneNames.size());
|
||||||
forAll(fz0, zoneI)
|
forAll(fz0, zoneI)
|
||||||
{
|
{
|
||||||
DynamicList<label>& newZone = fzFaces[zoneI];
|
dynamicLabelList& newZone = fzFaces[zoneI];
|
||||||
DynamicList<bool>& newFlip = fzFlips[zoneI];
|
DynamicList<bool>& newFlip = fzFlips[zoneI];
|
||||||
|
|
||||||
newZone.setSize(fz0[zoneI].size());
|
newZone.setSize(fz0[zoneI].size());
|
||||||
|
@ -997,7 +997,7 @@ void Foam::polyMeshAdder::mergeFaceZones
|
||||||
// Now we have full addressing for faces so do the faceZones of mesh1.
|
// Now we have full addressing for faces so do the faceZones of mesh1.
|
||||||
forAll(fz1, zoneI)
|
forAll(fz1, zoneI)
|
||||||
{
|
{
|
||||||
DynamicList<label>& newZone = fzFaces[from1ToAll[zoneI]];
|
dynamicLabelList& newZone = fzFaces[from1ToAll[zoneI]];
|
||||||
DynamicList<bool>& newFlip = fzFlips[from1ToAll[zoneI]];
|
DynamicList<bool>& newFlip = fzFlips[from1ToAll[zoneI]];
|
||||||
|
|
||||||
newZone.setSize(newZone.size() + fz1[zoneI].size());
|
newZone.setSize(newZone.size() + fz1[zoneI].size());
|
||||||
|
@ -1034,7 +1034,7 @@ void Foam::polyMeshAdder::mergeCellZones
|
||||||
|
|
||||||
DynamicList<word>& zoneNames,
|
DynamicList<word>& zoneNames,
|
||||||
labelList& from1ToAll,
|
labelList& from1ToAll,
|
||||||
List<DynamicList<label> >& czCells
|
List<dynamicLabelList >& czCells
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
zoneNames.setSize(cz0.size() + cz1.size());
|
zoneNames.setSize(cz0.size() + cz1.size());
|
||||||
|
@ -1062,7 +1062,7 @@ void Foam::polyMeshAdder::mergeCellZones
|
||||||
// Cell mapping is trivial.
|
// Cell mapping is trivial.
|
||||||
forAll(cz1, zoneI)
|
forAll(cz1, zoneI)
|
||||||
{
|
{
|
||||||
DynamicList<label>& newZone = czCells[from1ToAll[zoneI]];
|
dynamicLabelList& newZone = czCells[from1ToAll[zoneI]];
|
||||||
|
|
||||||
newZone.setSize(newZone.size() + cz1[zoneI].size());
|
newZone.setSize(newZone.size() + cz1[zoneI].size());
|
||||||
|
|
||||||
|
@ -1088,14 +1088,14 @@ void Foam::polyMeshAdder::mergeZones
|
||||||
const labelList& from1ToAllCells,
|
const labelList& from1ToAllCells,
|
||||||
|
|
||||||
DynamicList<word>& pointZoneNames,
|
DynamicList<word>& pointZoneNames,
|
||||||
List<DynamicList<label> >& pzPoints,
|
List<dynamicLabelList >& pzPoints,
|
||||||
|
|
||||||
DynamicList<word>& faceZoneNames,
|
DynamicList<word>& faceZoneNames,
|
||||||
List<DynamicList<label> >& fzFaces,
|
List<dynamicLabelList >& fzFaces,
|
||||||
List<DynamicList<bool> >& fzFlips,
|
List<DynamicList<bool> >& fzFlips,
|
||||||
|
|
||||||
DynamicList<word>& cellZoneNames,
|
DynamicList<word>& cellZoneNames,
|
||||||
List<DynamicList<label> >& czCells
|
List<dynamicLabelList >& czCells
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
labelList from1ToAllPZones;
|
labelList from1ToAllPZones;
|
||||||
|
@ -1142,14 +1142,14 @@ void Foam::polyMeshAdder::mergeZones
|
||||||
void Foam::polyMeshAdder::addZones
|
void Foam::polyMeshAdder::addZones
|
||||||
(
|
(
|
||||||
const DynamicList<word>& pointZoneNames,
|
const DynamicList<word>& pointZoneNames,
|
||||||
const List<DynamicList<label> >& pzPoints,
|
const List<dynamicLabelList >& pzPoints,
|
||||||
|
|
||||||
const DynamicList<word>& faceZoneNames,
|
const DynamicList<word>& faceZoneNames,
|
||||||
const List<DynamicList<label> >& fzFaces,
|
const List<dynamicLabelList >& fzFaces,
|
||||||
const List<DynamicList<bool> >& fzFlips,
|
const List<DynamicList<bool> >& fzFlips,
|
||||||
|
|
||||||
const DynamicList<word>& cellZoneNames,
|
const DynamicList<word>& cellZoneNames,
|
||||||
const List<DynamicList<label> >& czCells,
|
const List<dynamicLabelList >& czCells,
|
||||||
|
|
||||||
polyMesh& mesh
|
polyMesh& mesh
|
||||||
)
|
)
|
||||||
|
@ -1295,14 +1295,14 @@ Foam::autoPtr<Foam::polyMesh> Foam::polyMeshAdder::add
|
||||||
// ~~~~~
|
// ~~~~~
|
||||||
|
|
||||||
DynamicList<word> pointZoneNames;
|
DynamicList<word> pointZoneNames;
|
||||||
List<DynamicList<label> > pzPoints;
|
List<dynamicLabelList > pzPoints;
|
||||||
|
|
||||||
DynamicList<word> faceZoneNames;
|
DynamicList<word> faceZoneNames;
|
||||||
List<DynamicList<label> > fzFaces;
|
List<dynamicLabelList > fzFaces;
|
||||||
List<DynamicList<bool> > fzFlips;
|
List<DynamicList<bool> > fzFlips;
|
||||||
|
|
||||||
DynamicList<word> cellZoneNames;
|
DynamicList<word> cellZoneNames;
|
||||||
List<DynamicList<label> > czCells;
|
List<dynamicLabelList > czCells;
|
||||||
|
|
||||||
mergeZones
|
mergeZones
|
||||||
(
|
(
|
||||||
|
@ -1508,14 +1508,14 @@ Foam::autoPtr<Foam::mapAddedPolyMesh> Foam::polyMeshAdder::add
|
||||||
// ~~~~~
|
// ~~~~~
|
||||||
|
|
||||||
DynamicList<word> pointZoneNames;
|
DynamicList<word> pointZoneNames;
|
||||||
List<DynamicList<label> > pzPoints;
|
List<dynamicLabelList > pzPoints;
|
||||||
|
|
||||||
DynamicList<word> faceZoneNames;
|
DynamicList<word> faceZoneNames;
|
||||||
List<DynamicList<label> > fzFaces;
|
List<dynamicLabelList > fzFaces;
|
||||||
List<DynamicList<bool> > fzFlips;
|
List<DynamicList<bool> > fzFlips;
|
||||||
|
|
||||||
DynamicList<word> cellZoneNames;
|
DynamicList<word> cellZoneNames;
|
||||||
List<DynamicList<label> > czCells;
|
List<dynamicLabelList > czCells;
|
||||||
|
|
||||||
mergeZones
|
mergeZones
|
||||||
(
|
(
|
||||||
|
|
|
@ -74,7 +74,7 @@ private:
|
||||||
(
|
(
|
||||||
const labelList& map,
|
const labelList& map,
|
||||||
const labelList& lst,
|
const labelList& lst,
|
||||||
DynamicList<label>&
|
dynamicLabelList&
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Index of patch in allPatches. Add if nonexisting.
|
//- Index of patch in allPatches. Add if nonexisting.
|
||||||
|
@ -139,7 +139,7 @@ private:
|
||||||
const labelList& masterToCutPoints,
|
const labelList& masterToCutPoints,
|
||||||
const face& masterFace,
|
const face& masterFace,
|
||||||
|
|
||||||
DynamicList<label>& workFace,
|
dynamicLabelList& workFace,
|
||||||
face& f
|
face& f
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ private:
|
||||||
|
|
||||||
DynamicList<word>& zoneNames,
|
DynamicList<word>& zoneNames,
|
||||||
labelList& from1ToAll,
|
labelList& from1ToAll,
|
||||||
List<DynamicList<label> >& pzPoints
|
List<dynamicLabelList >& pzPoints
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Merge face zones
|
//- Merge face zones
|
||||||
|
@ -193,7 +193,7 @@ private:
|
||||||
|
|
||||||
DynamicList<word>& zoneNames,
|
DynamicList<word>& zoneNames,
|
||||||
labelList& from1ToAll,
|
labelList& from1ToAll,
|
||||||
List<DynamicList<label> >& fzFaces,
|
List<dynamicLabelList >& fzFaces,
|
||||||
List<DynamicList<bool> >& fzFlips
|
List<DynamicList<bool> >& fzFlips
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@ -206,7 +206,7 @@ private:
|
||||||
|
|
||||||
DynamicList<word>& zoneNames,
|
DynamicList<word>& zoneNames,
|
||||||
labelList& from1ToAll,
|
labelList& from1ToAll,
|
||||||
List<DynamicList<label> >& czCells
|
List<dynamicLabelList >& czCells
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Merge point/face/cell zone information
|
//- Merge point/face/cell zone information
|
||||||
|
@ -221,28 +221,28 @@ private:
|
||||||
const labelList& from1ToAllCells,
|
const labelList& from1ToAllCells,
|
||||||
|
|
||||||
DynamicList<word>& pointZoneNames,
|
DynamicList<word>& pointZoneNames,
|
||||||
List<DynamicList<label> >& pzPoints,
|
List<dynamicLabelList >& pzPoints,
|
||||||
|
|
||||||
DynamicList<word>& faceZoneNames,
|
DynamicList<word>& faceZoneNames,
|
||||||
List<DynamicList<label> >& fzFaces,
|
List<dynamicLabelList >& fzFaces,
|
||||||
List<DynamicList<bool> >& fzFlips,
|
List<DynamicList<bool> >& fzFlips,
|
||||||
|
|
||||||
DynamicList<word>& cellZoneNames,
|
DynamicList<word>& cellZoneNames,
|
||||||
List<DynamicList<label> >& czCells
|
List<dynamicLabelList >& czCells
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Create new zones and add to new mesh.
|
//- Create new zones and add to new mesh.
|
||||||
static void addZones
|
static void addZones
|
||||||
(
|
(
|
||||||
const DynamicList<word>& pointZoneNames,
|
const DynamicList<word>& pointZoneNames,
|
||||||
const List<DynamicList<label> >& pzPoints,
|
const List<dynamicLabelList >& pzPoints,
|
||||||
|
|
||||||
const DynamicList<word>& faceZoneNames,
|
const DynamicList<word>& faceZoneNames,
|
||||||
const List<DynamicList<label> >& fzFaces,
|
const List<dynamicLabelList >& fzFaces,
|
||||||
const List<DynamicList<bool> >& fzFlips,
|
const List<DynamicList<bool> >& fzFlips,
|
||||||
|
|
||||||
const DynamicList<word>& cellZoneNames,
|
const DynamicList<word>& cellZoneNames,
|
||||||
const List<DynamicList<label> >& czCells,
|
const List<dynamicLabelList >& czCells,
|
||||||
|
|
||||||
polyMesh& mesh
|
polyMesh& mesh
|
||||||
);
|
);
|
||||||
|
|
|
@ -110,7 +110,7 @@ void Foam::attachDetach::checkDefinition()
|
||||||
{
|
{
|
||||||
const labelList& addr = mesh.faceZones()[faceZoneID_.index()];
|
const labelList& addr = mesh.faceZones()[faceZoneID_.index()];
|
||||||
|
|
||||||
DynamicList<label> bouFacesInZone(addr.size());
|
dynamicLabelList bouFacesInZone(addr.size());
|
||||||
|
|
||||||
forAll (addr, faceI)
|
forAll (addr, faceI)
|
||||||
{
|
{
|
||||||
|
@ -178,7 +178,7 @@ void Foam::attachDetach::checkDefinition()
|
||||||
{
|
{
|
||||||
const labelList& addr = mesh.faceZones()[faceZoneID_.index()];
|
const labelList& addr = mesh.faceZones()[faceZoneID_.index()];
|
||||||
|
|
||||||
DynamicList<label> zoneProblemFaces(addr.size());
|
dynamicLabelList zoneProblemFaces(addr.size());
|
||||||
|
|
||||||
forAll (addr, faceI)
|
forAll (addr, faceI)
|
||||||
{
|
{
|
||||||
|
|
|
@ -250,8 +250,8 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||||
|
|
||||||
// For every master and slave edge make a list of points to be added into
|
// For every master and slave edge make a list of points to be added into
|
||||||
// that edge.
|
// that edge.
|
||||||
List<DynamicList<label> > pointsIntoMasterEdges(masterEdges.size());
|
List<dynamicLabelList > pointsIntoMasterEdges(masterEdges.size());
|
||||||
List<DynamicList<label> > pointsIntoSlaveEdges(slaveEdges.size());
|
List<dynamicLabelList > pointsIntoSlaveEdges(slaveEdges.size());
|
||||||
|
|
||||||
// Add all points from the slave patch that have hit the edge
|
// Add all points from the slave patch that have hit the edge
|
||||||
forAll (slavePointEdgeHits, pointI)
|
forAll (slavePointEdgeHits, pointI)
|
||||||
|
@ -1304,7 +1304,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||||
|
|
||||||
// Pout<< "old rich master face: " << oldRichFace
|
// Pout<< "old rich master face: " << oldRichFace
|
||||||
// << " old face: " << oldFace << endl;
|
// << " old face: " << oldFace << endl;
|
||||||
DynamicList<label> newFaceLabels(2*oldFace.size());
|
dynamicLabelList newFaceLabels(2*oldFace.size());
|
||||||
|
|
||||||
forAll (oldFace, pointI)
|
forAll (oldFace, pointI)
|
||||||
{
|
{
|
||||||
|
@ -1579,7 +1579,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
|
||||||
|
|
||||||
oldFace.setSize(nOldFace);
|
oldFace.setSize(nOldFace);
|
||||||
|
|
||||||
DynamicList<label> newFaceLabels(2*oldFace.size());
|
dynamicLabelList newFaceLabels(2*oldFace.size());
|
||||||
|
|
||||||
// Pout << "old rich slave face: " << oldRichFace << " old face: " << oldFace << endl;
|
// Pout << "old rich slave face: " << oldRichFace << " old face: " << oldFace << endl;
|
||||||
forAll (oldFace, pointI)
|
forAll (oldFace, pointI)
|
||||||
|
|
|
@ -188,7 +188,7 @@ void Foam::slidingInterface::decoupleInterface
|
||||||
|
|
||||||
const face& oldFace = faces[curFaceID];
|
const face& oldFace = faces[curFaceID];
|
||||||
|
|
||||||
DynamicList<label> newFaceLabels(oldFace.size());
|
dynamicLabelList newFaceLabels(oldFace.size());
|
||||||
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
|
|
||||||
|
@ -305,7 +305,7 @@ void Foam::slidingInterface::decoupleInterface
|
||||||
|
|
||||||
const face& oldFace = faces[curFaceID];
|
const face& oldFace = faces[curFaceID];
|
||||||
|
|
||||||
DynamicList<label> newFaceLabels(oldFace.size());
|
dynamicLabelList newFaceLabels(oldFace.size());
|
||||||
|
|
||||||
bool changed = false;
|
bool changed = false;
|
||||||
|
|
||||||
|
|
|
@ -75,8 +75,8 @@ void Foam::enrichedPatch::calcCutFaces() const
|
||||||
|
|
||||||
// Prepare the storage
|
// Prepare the storage
|
||||||
DynamicList<face> cf(2*lf.size());
|
DynamicList<face> cf(2*lf.size());
|
||||||
DynamicList<label> cfMaster(2*lf.size());
|
dynamicLabelList cfMaster(2*lf.size());
|
||||||
DynamicList<label> cfSlave(2*lf.size());
|
dynamicLabelList cfSlave(2*lf.size());
|
||||||
|
|
||||||
// Algorithm
|
// Algorithm
|
||||||
// Go through all the faces
|
// Go through all the faces
|
||||||
|
@ -184,8 +184,8 @@ void Foam::enrichedPatch::calcCutFaces() const
|
||||||
// Pout << "Trying new edge (" << mp[curEdge.start()] << ", " << mp[curEdge.end()] << ") seed: " << curEdge << " used: " << edgesUsedTwice.found(curEdge) << endl;
|
// Pout << "Trying new edge (" << mp[curEdge.start()] << ", " << mp[curEdge.end()] << ") seed: " << curEdge << " used: " << edgesUsedTwice.found(curEdge) << endl;
|
||||||
|
|
||||||
// Estimate the size of cut face as twice the size of original face
|
// Estimate the size of cut face as twice the size of original face
|
||||||
DynamicList<label> cutFaceGlobalPoints(2*curLocalFace.size());
|
dynamicLabelList cutFaceGlobalPoints(2*curLocalFace.size());
|
||||||
DynamicList<label> cutFaceLocalPoints(2*curLocalFace.size());
|
dynamicLabelList cutFaceLocalPoints(2*curLocalFace.size());
|
||||||
|
|
||||||
// Found unused edge.
|
// Found unused edge.
|
||||||
label prevPointLabel = curEdge.start();
|
label prevPointLabel = curEdge.start();
|
||||||
|
|
Some files were not shown because too many files have changed in this diff Show more
Reference in a new issue