Merge branch 'nextRelease' of git://git.code.sf.net/p/foam-extend/foam-extend-3.2 into nextRelease

This commit is contained in:
Vuko Vukcevic 2016-04-11 09:08:36 +02:00
commit 2812bab769
517 changed files with 13126 additions and 2310 deletions

View 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

View file

@ -85,3 +85,4 @@ Contents:
Alexander Vakhrushev
Inno Gatin
Alexey Matveichev
Vuko Vukcevic

View file

@ -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 )
}
# 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
#
[ ! -z "$WM_THIRD_PARTY_USE_GCC_484" ] && {

View file

@ -151,13 +151,14 @@ build_library() {
system)
cd $INSTALL_DIR
patch system
patch $PACKAGE
;;
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
unzip_dir $PACKAGE >> $LOG_FILE 2>&1
patch $PACKAGE
mv $PACKAGE $INSTALL_DIR
;;
metis-5.1.0)
@ -222,7 +223,7 @@ build_library() {
;;
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
extract "$PACKAGE.tar.gz" gzip >> $LOG_FILE 2>&1
patch $PACKAGE

View file

@ -46,7 +46,7 @@ LDFLAGS += -L$(MPI_ROOTDIR)/bin -lm -lmpi -lmpid
#PTHREAD_ROOTDIR = $(PGMFILES)/pthread-win32
#CFLAGS_INC += -I$(PTHREAD_ROOTDIR)/include
#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_ROOTDIR = $(PGMFILES)/zlib-1.2.3

View file

@ -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 $
@@ -34,6 +34,11 @@
@@ -34,6 +34,12 @@
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 ;;
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-darwin13-null) echo i386-apple-darwin13 ;;
+ i386-apple-darwin14-null) echo i386-apple-darwin14 ;;
+ i386-apple-darwin15-null) echo i386-apple-darwin15 ;;
*) echo unknown ;;
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 $
@@ -87,6 +87,24 @@
@@ -87,6 +87,27 @@
i386-apple-darwin8.11.1)
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.* )
+ echo i386-apple-darwin14 ;;
+
+ i386-apple-darwin15.* )
+ echo i386-apple-darwin15 ;;
+
*)
echo unknown

View file

@ -45,8 +45,8 @@
# Will install the package directly $WM_THIRD_PARTY_DIR
# Some comments about package relocation:
# By using this prefix for the Prefix: parameter in this file, you will make this
# package relocatable.
# By using this prefix for the Prefix: parameter in this file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
@ -55,7 +55,7 @@
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
@ -115,6 +115,14 @@ Patch1: ParMGridGen-1.0.patch
cp ./MGridGen/IMlib/libIMlib.* $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"
echo ""
@ -161,7 +169,7 @@ DOT_CSH_EOF
#finally, generate a .tgz file for systems where using rpm for installing packages
# as a non-root user might be a problem.
(mkdir -p %{_topdir}/TGZS/%{_target_cpu}; cd $RPM_BUILD_ROOT/%{_prefix}; tar -zcvf %{_topdir}/TGZS/%{_target_cpu}/%{name}-%{version}.tgz packages/%{name}-%{version})
%clean
rm -rf %{buildroot}

View file

@ -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-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-darwin15 ] && cp -r config/i386-apple-darwin8 config/i386-apple-darwin15
%endif
# Warning:
# 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
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"
echo ""

View file

@ -137,7 +137,7 @@ Group: Development/Tools
--enable-mpirun-prefix-by-default \
--enable-orterun-prefix-by-default \
--enable-shared \
--disable-static \
--disable-static \
--disable-mpi-f77 \
--disable-mpi-f90 \
--disable-mpi-cxx \

View file

@ -44,8 +44,8 @@
# Will install the package directly $WM_THIRD_PARTY_DIR
# Some comments about package relocation:
# By using this prefix for the Prefix: parameter in this file, you will make this
# package relocatable.
# By using this prefix for the Prefix: parameter in this file, you will make this
# package relocatable.
#
# This is fine, as long as your software is itself relocatable.
#
@ -54,7 +54,7 @@
# Ref: http://sourceware.org/autobook/autobook/autobook_80.html
#
# In that case, if you ever change the value of the $WM_THIRD_PARTY_DIR, you will
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# not be able to reutilize this RPM, even though it is relocatable. You will need to
# regenerate the RPM.
#
%define _prefix %{_WM_THIRD_PARTY_DIR}
@ -113,6 +113,12 @@ Patch1: scotch-6.0.4_patch_darwin
make -j $WM_NCOMPPROCS ptscotch AR="$WM_CC"
%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
mkdir -p $RPM_BUILD_ROOT%{_installPrefix}
make install prefix=$RPM_BUILD_ROOT%{_installPrefix}

View file

@ -52,17 +52,17 @@ int main(int argc, char *argv[])
{
Info<< "Time = " << runTime.timeName() << nl << endl;
#include "readSIMPLEControls.H"
#include "initConvergenceCheck.H"
# include "readSIMPLEControls.H"
# include "initConvergenceCheck.H"
p.storePrevIter();
rho.storePrevIter();
// Pressure-velocity SIMPLE corrector
{
#include "UEqn.H"
#include "hEqn.H"
#include "pEqn.H"
# include "UEqn.H"
# include "hEqn.H"
# include "pEqn.H"
}
turbulence->correct();

View file

@ -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;
}

View file

@ -9,7 +9,9 @@
volScalarField& T = const_cast<volScalarField&>(thermo.T());
volScalarField& p = thermo.p();
volScalarField& e = thermo.e();
const volScalarField& psi = thermo.psi();
volScalarField psis("psi", thermo.psi()/thermo.Cp()*thermo.Cv());
psis.oldTime();
volScalarField rho
(
@ -38,20 +40,6 @@
# 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;
autoPtr<compressible::turbulenceModel> turbulence
(

View file

@ -5,7 +5,15 @@
+ fvm::div(phi, 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?
);
@ -40,4 +48,10 @@
}
thermo.correct();
// Recalculate compressibility
psis = thermo.psi()/thermo.Cp()*thermo.Cv();
// Recalculate density
rho = thermo.rho();
}

View file

@ -3,26 +3,37 @@
# include "limitU.H"
surfaceScalarField phid
(
"phid",
fvc::interpolate(psi)*
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
{
// Calculate phi for boundary conditions
phi = rhof*
(
(fvc::interpolate(U) & mesh.Sf())
- fvc::meshPhi(rho, U)
)
);
);
surfaceScalarField phid2 = rhoReff/rhof*phi;
surfaceScalarField phid("phid", psisf/rhof*phi);
for (int nonOrth=0; nonOrth<=nNonOrthCorr; nonOrth++)
{
// Store pressure for under-relaxation
p.storePrevIter();
volScalarField divPhid
(
"divPhid",
fvc::div(phid)
);
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
fvm::ddt(psis, 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
@ -42,9 +53,10 @@
pEqn.solve(mesh.solutionDict().solver(p.name()));
}
// Calculate the flux
if (nonOrth == nNonOrthCorr)
{
phi = pEqn.flux();
phi = phid2 + pEqn.flux();
}

View file

@ -27,10 +27,11 @@ Application
Description
Transient solver for trans-sonic/supersonic for laminar or turbulent
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
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.
@ -70,7 +71,7 @@ int main(int argc, char *argv[])
# include "setDeltaT.H"
runTime++;
Info<< "deltaT = " << runTime.deltaT().value() << nl << endl;
Info<< "Time = " << runTime.timeName() << nl << endl;
bool meshChanged = mesh.update();
@ -107,31 +108,25 @@ int main(int argc, char *argv[])
label oCorr = 0;
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 "eEqn.H"
# include "UEqn.H"
// --- 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++)
{
# include "pEqn.H"
}
// Recalculate density
rho = thermo.rho();
turbulence->correct();
} while (++oCorr < nOuterCorr);

View file

@ -1,8 +1,24 @@
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, U)
+ turbulence->divDevRhoReff(U)
);
fvVectorMatrix UEqn
(
fvm::ddt(rho, U)
+ fvm::div(phi, 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));

View file

@ -8,7 +8,9 @@
volScalarField& p = thermo.p();
volScalarField& e = thermo.e();
const volScalarField& psi = thermo.psi();
volScalarField psis("psi", thermo.psi()/thermo.Cp()*thermo.Cv());
psis.oldTime();
volScalarField rho
(
@ -35,8 +37,7 @@
mesh
);
#include "compressibleCreatePhi.H"
# include "compressibleCreatePhi.H"
Info<< "Creating turbulence model\n" << endl;
autoPtr<compressible::turbulenceModel> turbulence

View file

@ -1,12 +1,42 @@
{
solve
fvScalarMatrix eEqn
(
fvm::ddt(rho, e)
+ fvm::div(phi, e)
- fvm::laplacian(turbulence->alphaEff(), e)
==
==
- 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();
// Recalculate compressibility
psis = thermo.psi()/thermo.Cp()*thermo.Cv();
// Recalculate density
rho = thermo.rho();
}

View file

@ -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++)
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
+ fvm::div(phid, p)
- fvm::laplacian(rho*rUA, p)
);
U = UEqn.H()/UEqn.A();
pEqn.solve();
if (nonOrth == nNonOrthCorr)
for (int nonOrth = 0; nonOrth <= nNonOrthCorr; nonOrth++)
{
phi = pEqn.flux();
// 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
(
fvm::ddt(psis, p)
+ fvm::div(phid, p)
// Convective flux relaxation terms
+ fvm::SuSp(-divPhid, p)
+ divPhid*p
+ fvc::div(phid2)
- fvm::laplacian(rho*rUA, p)
);
pEqn.solve();
// Calculate the flux
if (nonOrth == nNonOrthCorr)
{
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();

View file

@ -25,8 +25,17 @@ Application
sonicFoam
Description
Transient solver for trans-sonic/supersonic, laminar or turbulent flow
of a compressible gas.
Transient solver for trans-sonic/supersonic for laminar or turbulent
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,30 +57,42 @@ int main(int argc, char *argv[])
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;
# include "readPISOControls.H"
# include "compressibleCourantNo.H"
# include "rhoEqn.H"
# include "UEqn.H"
# include "eEqn.H"
// --- PISO loop
for (int corr = 0; corr < nCorr; corr++)
// --- PIMPLE loop
label oCorr = 0;
do
{
# include "pEqn.H"
}
# include "rhoEqn.H"
# include "eEqn.H"
# include "UEqn.H"
turbulence->correct();
// --- PISO loop
volScalarField rUA = 1.0/UEqn.A();
rho = thermo.rho();
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++)
{
# include "pEqn.H"
}
turbulence->correct();
} while (++oCorr < nOuterCorr);
runTime.write();
@ -82,7 +103,7 @@ int main(int argc, char *argv[])
Info<< "End\n" << endl;
return 0;
return(0);
}

View file

@ -2,7 +2,7 @@ EXE_INC = \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel
EXE_LIBS = \
-lfiniteVolume \

View file

@ -9,7 +9,8 @@
volScalarField& p = thermo.p();
volScalarField& h = thermo.h();
const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi();
volScalarField psis("psi", thermo.psi()/thermo.Cp()*thermo.Cv());
psis.oldTime();
volScalarField rho
(

View file

@ -14,9 +14,10 @@
fvm::ddt(rho, h)
+ fvm::div(phi, 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
fvc::div(faceU, p, "div(U,p)")
- p*fvc::div(faceU)
// Viscous heating: note sign (devRhoReff has a minus in it)
- (turbulence->devRhoReff() && fvc::grad(U))
);
@ -26,12 +27,7 @@
eqnResidual = hEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
// 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();
// Bounding of enthalpy taken out
thermo.correct();
psis = thermo.psi()/thermo.Cp()*thermo.Cv();
}

View file

@ -1,24 +1,23 @@
{
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++)
{
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
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();
@ -26,8 +25,9 @@
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
fvm::ddt(psis, p)
+ fvm::div(phid, p)
+ fvc::div(phid2)
- fvm::laplacian(rho*rUA, p)
);
@ -42,7 +42,7 @@
// Calculate the flux
if (nonOrth == nNonOrthCorr)
{
phi = pEqn.flux();
phi = phid2 + pEqn.flux();
}
}

View file

@ -2,19 +2,19 @@
dictionary fieldBounds = mesh.solutionDict().subDict("fieldBounds");
// Pressure bounds
dimensionedScalar pMin("pMin", dimPressure, 0);
dimensionedScalar pMax("pMax", dimPressure, GREAT);
dimensionedScalar pMin("pMin", p.dimensions(), 0);
dimensionedScalar pMax("pMax", p.dimensions(), GREAT);
fieldBounds.lookup("p") >> pMin.value() >> pMax.value();
fieldBounds.lookup(p.name()) >> pMin.value() >> pMax.value();
// Temperature bounds
dimensionedScalar TMin("TMin", dimTemperature, 0);
dimensionedScalar TMax("TMax", dimTemperature, GREAT);
dimensionedScalar TMin("TMin", T.dimensions(), 0);
dimensionedScalar TMax("TMax", T.dimensions(), GREAT);
fieldBounds.lookup("T") >> TMin.value() >> TMax.value();
fieldBounds.lookup(T.name()) >> TMin.value() >> TMax.value();
// Velocity bound
dimensionedScalar UMax("UMax", dimVelocity, GREAT);
dimensionedScalar UMax("UMax", U.dimensions(), GREAT);
fieldBounds.lookup(U.name()) >> UMax.value();
dimensionedScalar smallU("smallU", dimVelocity, 1e-10);

View file

@ -1,7 +1,7 @@
{
// Calculate density from pressure
rho.storePrevIter();
rho = thermo.rho();
rho = thermo.rho()();
// Bound rho
volScalarField R = thermo.Cp() - thermo.Cv();

View file

@ -9,7 +9,8 @@
volScalarField& p = thermo.p();
volScalarField& h = thermo.h();
const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi();
volScalarField psis("psi", thermo.psi()/thermo.Cp()*thermo.Cv());
psis.oldTime();
volScalarField rho
(

View file

@ -10,10 +10,9 @@
+ fvm::div(phi, 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)")
// Note: div flux correction is zero so there is no need to
// carry it. HJ, 4/Dec/2015
- p*fvc::div(faceU)
// Viscous heating: note sign (devRhoReff has a minus in it)
- (turbulence->devRhoReff() && fvc::grad(U))
@ -24,12 +23,7 @@
eqnResidual = hEqn.solve().initialResidual();
maxResidual = max(eqnResidual, maxResidual);
// 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();
// Bounding of enthalpy taken out
thermo.correct();
psis = thermo.psi()/thermo.Cp()*thermo.Cv();
}

View file

@ -53,4 +53,5 @@
i = h - 0.5*magSqr(Urot);
thermo.correct();
psis = thermo.psi()/thermo.Cp()*thermo.Cv();
}

View file

@ -1,29 +1,27 @@
{
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++)
{
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
phi = fvc::interpolate(rho*U) & mesh.Sf();
phi = rhof*fvc::interpolate(U) & mesh.Sf();
// Make flux relative within the MRF zone
mrfZones.relativeFlux(rhof, phi);
surfaceScalarField phid2 = rhoReff/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();
@ -31,8 +29,9 @@
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
fvm::ddt(psis, p)
+ fvm::div(phid, p)
+ fvc::div(phid2)
- fvm::laplacian(rho*rUA, p)
);
@ -47,13 +46,13 @@
// Calculate the flux
if (nonOrth == nNonOrthCorr)
{
phi = pEqn.flux();
phi = phid2 + pEqn.flux();
}
}
# include "compressibleContinuityErrs.H"
// Explicitly relax the pressure for momentum corrector
// Relax the pressure
p.relax();
U -= rUA*fvc::grad(p);

View file

@ -2,19 +2,19 @@
dictionary fieldBounds = mesh.solutionDict().subDict("fieldBounds");
// Pressure bounds
dimensionedScalar pMin("pMin", dimPressure, 0);
dimensionedScalar pMax("pMax", dimPressure, GREAT);
dimensionedScalar pMin("pMin", p.dimensions(), 0);
dimensionedScalar pMax("pMax", p.dimensions(), GREAT);
fieldBounds.lookup("p") >> pMin.value() >> pMax.value();
fieldBounds.lookup(p.name()) >> pMin.value() >> pMax.value();
// Temperature bounds
dimensionedScalar TMin("TMin", dimTemperature, 0);
dimensionedScalar TMax("TMax", dimTemperature, GREAT);
dimensionedScalar TMin("TMin", T.dimensions(), 0);
dimensionedScalar TMax("TMax", T.dimensions(), GREAT);
fieldBounds.lookup("T") >> TMin.value() >> TMax.value();
fieldBounds.lookup(T.name()) >> TMin.value() >> TMax.value();
// Velocity bound
dimensionedScalar UMax("UMax", dimVelocity, GREAT);
dimensionedScalar UMax("UMax", U.dimensions(), GREAT);
fieldBounds.lookup(U.name()) >> UMax.value();
dimensionedScalar smallU("smallU", dimVelocity, 1e-10);

View file

@ -1,7 +1,7 @@
{
// Calculate density from pressure
rho.storePrevIter();
rho = thermo.rho();
rho = thermo.rho()();
// Bound rho
volScalarField R = thermo.Cp() - thermo.Cv();

View file

@ -9,7 +9,8 @@
volScalarField& p = thermo.p();
volScalarField& h = thermo.h();
const volScalarField& T = thermo.T();
const volScalarField& psi = thermo.psi();
volScalarField psis("psi", thermo.psi()/thermo.Cp()*thermo.Cv());
psis.oldTime();
volScalarField rho
(

View file

@ -1,5 +1,5 @@
{
// Solve the enthalpy equation
// Solve the rothalpy equation
T.storePrevIter();
// Calculate face velocity from flux
@ -14,10 +14,10 @@
fvm::ddt(rho, i)
+ fvm::div(phi, 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
fvc::div(faceU, p, "div(U,p)")
- p*fvc::div(faceU)
// Viscous heating: note sign (devRhoReff has a minus in it)
- (turbulence->devRhoReff() && fvc::grad(Urel))
);
@ -33,15 +33,10 @@
h = i + 0.5*magSqr(Urot);
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
i = h - 0.5*magSqr(Urot);
// Bounding of enthalpy taken out
thermo.correct();
psis = thermo.psi()/thermo.Cp()*thermo.Cv();
}

View file

@ -1,24 +1,22 @@
{
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++)
{
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
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();
@ -26,8 +24,9 @@
{
fvScalarMatrix pEqn
(
fvm::ddt(psi, p)
fvm::ddt(psis, p)
+ fvm::div(phid, p)
+ fvc::div(phid2)
- fvm::laplacian(rho*rUrelA, p)
);
@ -42,14 +41,13 @@
// Calculate the flux
if (nonOrth == nNonOrthCorr)
{
phi = pEqn.flux();
phi = phid2 + pEqn.flux();
}
}
# include "compressibleContinuityErrs.H"
// Explicitly relax the pressure for momentum corrector
// Relax the pressure
p.relax();
Urel -= rUrelA*fvc::grad(p);

View file

@ -2,19 +2,19 @@
dictionary fieldBounds = mesh.solutionDict().subDict("fieldBounds");
// Pressure bounds
dimensionedScalar pMin("pMin", dimPressure, 0);
dimensionedScalar pMax("pMax", dimPressure, GREAT);
dimensionedScalar pMin("pMin", p.dimensions(), 0);
dimensionedScalar pMax("pMax", p.dimensions(), GREAT);
fieldBounds.lookup("p") >> pMin.value() >> pMax.value();
fieldBounds.lookup(p.name()) >> pMin.value() >> pMax.value();
// Temperature bounds
dimensionedScalar TMin("TMin", dimTemperature, 0);
dimensionedScalar TMax("TMax", dimTemperature, GREAT);
dimensionedScalar TMin("TMin", T.dimensions(), 0);
dimensionedScalar TMax("TMax", T.dimensions(), GREAT);
fieldBounds.lookup("T") >> TMin.value() >> TMax.value();
fieldBounds.lookup(T.name()) >> TMin.value() >> TMax.value();
// Velocity bound
dimensionedScalar UrelMax("UrelMax", dimVelocity, GREAT);
dimensionedScalar UrelMax("UrelMax", Urel.dimensions(), GREAT);
fieldBounds.lookup(Urel.name()) >> UrelMax.value();
dimensionedScalar smallUrel("smallUrel", dimVelocity, 1e-10);

View file

@ -1,7 +1,7 @@
{
// Calculate density from pressure
rho.storePrevIter();
rho = thermo.rho();
rho = thermo.rho()();
// Bound rho
volScalarField R = thermo.Cp() - thermo.Cv();

View file

@ -1,5 +1,5 @@
// Momentum equation
fvVectorMatrix UEqn
tmp<fvVectorMatrix> UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
@ -7,9 +7,9 @@
);
// Add MRF and porous sources
mrfZones.addCoriolis(UEqn);
pZones.addResistance(UEqn);
mrfZones.addCoriolis(UEqn());
pZones.addResistance(UEqn());
UEqn.relax();
UEqn().relax();
UpEqn.insertEquation(0, UEqn);
UpEqn.insertEquation(0, UEqn());

View file

@ -2,9 +2,11 @@
surfaceScalarField rUAf
(
"rUAf",
fvc::interpolate(1.0/UEqn.A())
fvc::interpolate(1.0/UEqn().A())
);
UEqn.clear();
surfaceScalarField presSource
(
"presSource",

View file

@ -1,11 +1,11 @@
// Momentum equation
fvVectorMatrix UEqn
tmp<fvVectorMatrix> UEqn
(
fvm::ddt(U)
+ fvm::div(phi, U)
+ turbulence->divDevReff(U)
);
UEqn.relax();
UEqn().relax();
UpEqn.insertEquation(0, UEqn);
UpEqn.insertEquation(0, UEqn());

View file

@ -2,9 +2,11 @@
surfaceScalarField rUAf
(
"rUAf",
fvc::interpolate(1.0/UEqn.A())
fvc::interpolate(1.0/UEqn().A())
);
UEqn.clear();
surfaceScalarField presSource
(
"presSource",

View file

@ -1,4 +1,4 @@
// Solve the Momentum equation
// Solve the momentum equation
tmp<fvVectorMatrix> UEqn
(

View file

@ -1,4 +1,4 @@
if(divSigmaExpMethod == "standard")
if (divSigmaExpMethod == "standard")
{
divSigmaExp = fvc::div
(

View file

@ -52,6 +52,7 @@ int main(int argc, char *argv[])
# include "setRootCase.H"
# include "createTime.H"
# include "createMesh.H"
# include "readGravitationalAcceleration.H"
# include "createFields.H"
# include "createHistory.H"
# include "readDivSigmaExpMethod.H"
@ -61,7 +62,7 @@ int main(int argc, char *argv[])
Info<< "\nStarting time loop\n" << endl;
while(runTime.loop())
while(runTime.loop())
{
Info<< "Time = " << runTime.timeName() << nl << endl;
@ -71,7 +72,7 @@ int main(int argc, char *argv[])
lduMatrix::solverPerformance solverPerf;
scalar initialResidual = 1.0;
scalar relativeResidual = 1.0;
lduMatrix::debug = 0;
// lduMatrix::debug = 0;
if (predictor)
{
@ -95,6 +96,7 @@ int main(int argc, char *argv[])
==
fvm::laplacian(2*muf + lambdaf, U, "laplacian(DU,U)")
+ divSigmaExp
+ rho*g
);
if (solidInterfaceCorr)

View file

@ -1,110 +1,36 @@
if (runTime.outputTime())
{
{
volScalarField epsilonEq
(
IOobject
(
"epsilonEq",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
sqrt((2.0/3.0)*magSqr(dev(epsilon)))
);
(
IOobject
(
"epsilonEq",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
sqrt((2.0/3.0)*magSqr(dev(epsilon)))
);
Info<< "Max epsilonEq = " << max(epsilonEq).value()
<< endl;
<< endl;
volScalarField sigmaEq
(
IOobject
(
"sigmaEq",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
sqrt((3.0/2.0)*magSqr(dev(sigma)))
);
(
IOobject
(
"sigmaEq",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
sqrt((3.0/2.0)*magSqr(dev(sigma)))
);
Info<< "Max sigmaEq = " << max(sigmaEq).value()
<< 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;
// }
<< endl;
runTime.write();
}
}

View file

@ -30,41 +30,41 @@ Description
\*---------------------------------------------------------------------------*/
#include "argList.H"
#include "fvMesh.H"
#include "fvCFD.H"
#include "pointFields.H"
#include "IStringStream.H"
#include "volPointInterpolation.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
int main(int argc, char *argv[])
{
timeSelector::addOptions();
# include "addRegionOption.H"
argList::validArgs.append("scaling factor");
# include "setRootCase.H"
# include "createTime.H"
# include "createNamedMesh.H"
scalar scaleFactor(readScalar(IStringStream(args.additionalArgs()[0])()));
# include "createTime.H"
# include "createMesh.H"
instantList timeDirs = timeSelector::select0(runTime, args);
volPointInterpolation pInterp(mesh);
// Get times list
instantList Times = runTime.times();
pointField zeroPoints(mesh.points());
// skip "constant" time
for (label timeI = 1; timeI < Times.size(); ++timeI)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[timeI], timeI);
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;
fvMesh::readUpdateState state = mesh.readUpdate();
IOobject Uheader
(
"U",

View file

@ -32,6 +32,7 @@ Description
#include "argList.H"
#include "polyMesh.H"
#include "timeSelector.H"
#include "pointFields.H"
#include "tetFemMatrix.H"
#include "tetPointFields.H"
@ -43,30 +44,32 @@ using namespace Foam;
int main(int argc, char *argv[])
{
timeSelector::addOptions();
# include "addRegionOption.H"
argList::validArgs.append("scaling factor");
# include "setRootCase.H"
scalar scaleFactor(readScalar(IStringStream(args.additionalArgs()[0])()));
# include "createTime.H"
# include "createPolyMesh.H"
tetPolyMesh tetMesh(mesh);
scalar scaleFactor(readScalar(IStringStream(args.additionalArgs()[0])()));
// Get times list
instantList Times = runTime.times();
instantList timeDirs = timeSelector::select0(runTime, args);
tetPolyMesh tetMesh(mesh);
pointField zeroPoints(mesh.points());
runTime.setTime(Times[0], 0);
for (int i = 1; i<Times.size(); i++)
forAll(timeDirs, timeI)
{
runTime.setTime(Times[i], i);
runTime.setTime(timeDirs[timeI], timeI);
Info<< "Time = " << runTime.timeName() << endl;
polyMesh::readUpdateState state = mesh.readUpdate();
IOobject Uheader
(
"U",

View file

@ -10,6 +10,7 @@ print 'Reading file', logfilename
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]*)"
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]*)"
tUp = []
@ -24,6 +25,11 @@ k = []
omega = []
ikomega = 0
tkepsilon = []
k = []
epsilon = []
ikepsilon = 0
#HJ take name of log file as script argument
pipefile=open(logfilename,'r')
lines = pipefile.readlines()
@ -37,6 +43,12 @@ for line in lines:
Uy.append(float(matchUp.group(3)))
Uz.append(float(matchUp.group(4)))
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)
if matchkomega:
ikomega = ikomega + 1
@ -46,15 +58,15 @@ for line in lines:
outfile=open('residual.dat','w')
print 'hits = ', ikomega
#HJ need better way of combining lists
if ikomega > 0:
for index in range(0,ikomega):
outfile.write(str(tUp[index])+' '+str(Ux[index])+' '+str(Uy[index])+' '+str(Uz[index])+' '+str(p[index])+' '+str(k[index])+' '+str(omega[index])+'\n')
for data in zip(tUp,Ux,Uy,Uz,p,k,omega):
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:
for index in range(0,iUp):
outfile.write(str(tUp[index])+' '+str(Ux[index])+' '+str(Uy[index])+' '+str(Uz[index])+' '+str(p[index])+'\n')
for data in zip(tUp,Ux,Uy,Uz,p):
outfile.write(' '.join([str(d) for d in data])+'\n')
outfile.close()
@ -71,6 +83,10 @@ if iUp > 0:
pylab.semilogy(tUp,Uz,'-',label="Uz")
pylab.semilogy(tUp,p,'-',label="p")
if ikepsilon > 0:
pylab.semilogy(tkepsilon,k,'-',label="k")
pylab.semilogy(tkepsilon,epsilon,'-',label="epsilon")
if ikomega > 0:
pylab.semilogy(tkomega,k,'-',label="k")
pylab.semilogy(tkomega,omega,'-',label="omega")

View file

@ -64,16 +64,15 @@ for line in lines:
outfile=open('residual.dat','w')
#HJ need better way of combining lists
if iomega > 0:
for index in range(0,iomega):
outfile.write(str(tUp[index])+' '+str(Ux[index])+' '+str(Uy[index])+' '+str(Uz[index])+' '+str(p[index])+' '+str(k[index])+' '+str(omega[index])+'\n')
for data in zip(tUp,Ux,Uy,Uz,p,k,omega):
outfile.write(' '.join([str(d) for d in data])+'\n')
elif iepsilon > 0:
for index in range(0,iepsilon):
outfile.write(str(tUp[index])+' '+str(Ux[index])+' '+str(Uy[index])+' '+str(Uz[index])+' '+str(p[index])+' '+str(k[index])+' '+str(epsilon[index])+'\n')
for data in zip(tUp,Ux,Uy,Uz,p,k,epsilon):
outfile.write(' '.join([str(d) for d in data])+'\n')
elif iUp > 0:
for index in range(0,iUp):
outfile.write(str(tUp[index])+' '+str(Ux[index])+' '+str(Uy[index])+' '+str(Uz[index])+' '+str(p[index])+'\n')
for data in zip(tUp,Ux,Uy,Uz,p):
outfile.write(' '.join([str(d) for d in data])+'\n')
outfile.close()

View 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.

View 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.

View file

@ -219,6 +219,42 @@ MINGW32_NT-6.2)
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)
WM_ARCH=linux
@ -270,6 +306,16 @@ Linux)
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
;;

View file

@ -228,6 +228,16 @@ case Linux:
setenv WM_LDFLAGS '-m64'
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:
echo Unknown processor type `uname -m` for Linux
breaksw

View file

@ -191,6 +191,7 @@
# For AllMake.stage1
#setenv WM_THIRD_PARTY_USE_GCC_492 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_451 1
#setenv WM_THIRD_PARTY_USE_GCC_445 1

View file

@ -201,6 +201,7 @@ export FOAM_VERBOSE=1
# 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

View file

@ -105,7 +105,7 @@ export PARMGRIDGEN_INCLUDE_DIR=$PARMGRIDGEN_DIR/include
# System installed Scotch
#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_LIB_DIR=$SCOTCH_DIR/lib
export SCOTCH_INCLUDE_DIR=$SCOTCH_DIR/include

View file

@ -103,6 +103,10 @@ case FOAM:
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
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:
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

View file

@ -1,9 +1,9 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 3.2
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
\\ / O peration |
\\ / A nd | For copyright notice see file Copyright
\\/ M anipulation |
-------------------------------------------------------------------------------
License
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)
{
// 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;
scalar& rollAngle = eulerAngles.x();
@ -82,7 +82,9 @@ Foam::vector Foam::finiteRotation::eulerAngles(const tensor& rotT)
// Calculate roll angle
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
pitchAngle = atan2(-rotT.xz(), c2);

View file

@ -1,9 +1,9 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | foam-extend: Open Source CFD
\\ / O peration | Version: 3.2
\\ / A nd | Web: http://www.foam-extend.org
\\/ M anipulation | For copyright notice see file Copyright
\\ / O peration |
\\ / A nd | For copyright notice see file Copyright
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of foam-extend.
@ -69,7 +69,7 @@ class finiteRotation
//- Calculate rotation angle from given rotation tensor
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,
// Extracting Euler Angles from a Rotation Matrix.
static vector eulerAngles(const tensor& rotT);

View file

@ -74,11 +74,17 @@ Foam::dimensionedVector Foam::sixDOFqODE::A
const HamiltonRodriguezRot& rotation
) const
{
// Fix the global force for global rotation constraints
dimensionedVector fAbs = force();
// Constrain translation
constrainTranslation(fAbs.value());
return
(
- (linSpringCoeffs_ & xR) // spring
- (linDampingCoeffs_ & uR) // damping
+ force()
+ fAbs
// To absolute
+ (rotation.invR() & forceRelative())
)/mass_;
@ -91,12 +97,18 @@ Foam::dimensionedVector Foam::sixDOFqODE::OmegaDot
const dimensionedVector& omega
) const
{
// Fix the global moment for global rotation constraints
dimensionedVector mAbs = moment();
// Constrain rotation
constrainRotation(mAbs.value());
return
inv(momentOfInertia_)
& (
E(omega)
// To relative
+ (rotation.R() & moment())
+ (rotation.R() & mAbs)
+ 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 * * * * * * * * * * * * * * //
@ -118,11 +213,14 @@ Foam::dimensionedVector Foam::sixDOFqODE::E
Foam::sixDOFqODE::sixDOFqODE(const IOobject& io)
:
IOdictionary(io),
mass_(lookup("mass")),
momentOfInertia_(lookup("momentOfInertia")),
Xequilibrium_(lookup("equilibriumPosition")),
linSpringCoeffs_(lookup("linearSpring")),
linDampingCoeffs_(lookup("linearDamping")),
Xrel_(lookup("Xrel")),
U_(lookup("U")),
Uaverage_(U_),
@ -134,11 +232,29 @@ Foam::sixDOFqODE::sixDOFqODE(const IOobject& io)
omega_(lookup("omega")),
omegaAverage_(omega_),
omegaAverageAbsolute_(omega_),
force_(lookup("force")),
moment_(lookup("moment")),
forceRelative_(lookup("forceRelative")),
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();
}
@ -163,11 +279,14 @@ Foam::sixDOFqODE::sixDOFqODE
IOobject::NO_WRITE
)
),
mass_(sd.mass_.name(), sd.mass_),
momentOfInertia_(sd.momentOfInertia_.name(), sd.momentOfInertia_),
Xequilibrium_(sd.Xequilibrium_.name(), sd.Xequilibrium_),
linSpringCoeffs_(sd.linSpringCoeffs_.name(), sd.linSpringCoeffs_),
linDampingCoeffs_(sd.linDampingCoeffs_.name(), sd.linDampingCoeffs_),
Xrel_(sd.Xrel_.name(), sd.Xrel_),
U_(sd.U_.name(), sd.U_),
Uaverage_(sd.Uaverage_.name(), sd.Uaverage_),
@ -179,11 +298,22 @@ Foam::sixDOFqODE::sixDOFqODE
sd.omegaAverageAbsolute_.name(),
sd.omegaAverageAbsolute_
),
force_(sd.force_.name(), sd.force_),
moment_(sd.moment_.name(), sd.moment_),
forceRelative_(sd.forceRelative_.name(), sd.forceRelative_),
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_;
momentOfInertia_ = sd.momentOfInertia_;
Xequilibrium_ = sd.Xequilibrium_;
linSpringCoeffs_ = sd.linSpringCoeffs_;
linDampingCoeffs_ = sd.linDampingCoeffs_;
Xrel_ = sd.Xrel_;
U_ = sd.U_;
Uaverage_ = sd.Uaverage_;
@ -209,6 +341,7 @@ void Foam::sixDOFqODE::setState(const sixDOFqODE& sd)
omega_ = sd.omega_;
omegaAverage_ = sd.omegaAverage_;
omegaAverageAbsolute_ = sd.omegaAverageAbsolute_;
force_ = sd.force_;
moment_ = sd.moment_;
forceRelative_ = sd.forceRelative_;
@ -217,6 +350,13 @@ void Foam::sixDOFqODE::setState(const sixDOFqODE& sd)
// Copy ODE coefficients: this carries actual ODE state
// HJ, 23/Mar/2015
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[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
dimensionedVector curOmega
(
@ -256,9 +413,28 @@ void Foam::sixDOFqODE::derivatives
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();
dydx[6] = omegaDot.x();
dydx[6] = omegaDot.x();
dydx[7] = omegaDot.y();
dydx[8] = omegaDot.z();
@ -266,6 +442,20 @@ void Foam::sixDOFqODE::derivatives
dydx[10] = curRotation.eDot(curOmega.value(), 1);
dydx[11] = curRotation.eDot(curOmega.value(), 2);
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.z() = coeffs_[5];
// Constrain velocity
constrainTranslation(Uval);
coeffs_[3] = Uval.x();
coeffs_[4] = Uval.y();
coeffs_[5] = Uval.z();
// Update omega
vector& omegaVal = omega_.value();
@ -309,6 +505,12 @@ void Foam::sixDOFqODE::update(const scalar delta)
omegaVal.y() = coeffs_[7];
omegaVal.z() = coeffs_[8];
// Constrain omega
constrainRotation(omegaVal);
coeffs_[6] = omegaVal.x();
coeffs_[7] = omegaVal.y();
coeffs_[8] = omegaVal.z();
rotation_.updateRotation
(
HamiltonRodriguezRot
@ -321,7 +523,23 @@ void Foam::sixDOFqODE::update(const scalar 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()
<< 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;
}

View file

@ -131,6 +131,33 @@ class sixDOFqODE
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
//- Disallow default bitwise copy construct
@ -170,6 +197,14 @@ class sixDOFqODE
const dimensionedVector& omega
) 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:
@ -265,6 +300,9 @@ public:
// coordinate system
inline void setOmega(const vector& omega);
//- Set referent coordinate system to apply constraints
inline void setReferentRotation(const HamiltonRodriguezRot& rot);
// Average motion per time-step

View file

@ -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
{
return Uaverage_;

View file

@ -46,7 +46,7 @@ SourceFiles
#include "OSspecific.H"
#include <signal.h>
#if defined(linux) || defined(linuxAMD64) || defined(linuxIA64)
#if defined(linux) || defined(linuxAMD64) || defined(linuxIA64) || defined(linuxARM7)
# define LINUX
#endif

View file

@ -446,7 +446,7 @@ void Foam::cellTable::addCellZones
) const
{
Map<label> typeToZone = zoneMap();
List<DynamicList<label> > zoneCells(size());
List<dynamicLabelList > zoneCells(size());
forAll(tableIds, cellI)
{

View file

@ -230,7 +230,7 @@ Foam::labelList Foam::polyDualMesh::collectPatchSideFace
label meshPointI = patch.meshPoints()[pointI];
const labelList& pFaces = patch.pointFaces()[pointI];
DynamicList<label> dualFace;
dynamicLabelList dualFace;
if (pointToDualPoint[meshPointI] >= 0)
{
@ -345,9 +345,9 @@ void Foam::polyDualMesh::collectPatchInternalFace
const labelList& pFaces = patch.pointFaces()[pointI];
// Vertices of dualFace
DynamicList<label> dualFace(pFaces.size());
dynamicLabelList dualFace(pFaces.size());
// Indices in dualFace of vertices added because of feature edge
DynamicList<label> featEdgeIndices(dualFace.size());
dynamicLabelList featEdgeIndices(dualFace.size());
label edgeI = startEdgeI;
@ -440,9 +440,9 @@ void Foam::polyDualMesh::splitFace
const labelList& featEdgeIndices,
DynamicList<face>& dualFaces,
DynamicList<label>& dualOwner,
DynamicList<label>& dualNeighbour,
DynamicList<label>& dualRegion
dynamicLabelList& dualOwner,
dynamicLabelList& dualNeighbour,
dynamicLabelList& dualRegion
)
{
@ -522,7 +522,7 @@ void Foam::polyDualMesh::splitFace
// number of feature edges > 2.
// Storage for new face
DynamicList<label> subFace(dualFace.size());
dynamicLabelList subFace(dualFace.size());
forAll(featEdgeIndices, featI)
{
@ -587,9 +587,9 @@ void Foam::polyDualMesh::dualPatch
const pointField& dualPoints,
DynamicList<face>& dualFaces,
DynamicList<label>& dualOwner,
DynamicList<label>& dualNeighbour,
DynamicList<label>& dualRegion
dynamicLabelList& dualOwner,
dynamicLabelList& dualNeighbour,
dynamicLabelList& dualRegion
)
{
const labelList& meshEdges = patch.meshEdges();
@ -885,9 +885,9 @@ void Foam::polyDualMesh::calcDual
// Dynamic sized since we don't know size.
DynamicList<face> dynDualFaces(mesh.nEdges());
DynamicList<label> dynDualOwner(mesh.nEdges());
DynamicList<label> dynDualNeighbour(mesh.nEdges());
DynamicList<label> dynDualRegion(mesh.nEdges());
dynamicLabelList dynDualOwner(mesh.nEdges());
dynamicLabelList dynDualNeighbour(mesh.nEdges());
dynamicLabelList dynDualRegion(mesh.nEdges());
// 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
DynamicList<label> dualFace;
dynamicLabelList dualFace;
if (edgeToDualPoint[edgeI] >= 0)
{
@ -1084,7 +1084,7 @@ void Foam::polyDualMesh::calcDual
}
// Walk face-cell-face until starting face reached.
DynamicList<label> dualFace(mesh.edgeCells()[edgeI].size());
dynamicLabelList dualFace(mesh.edgeCells()[edgeI].size());
label faceI = startFaceI;
@ -1566,7 +1566,7 @@ void Foam::polyDualMesh::calcFeatures
const labelListList& pointEdges = allBoundary.pointEdges();
DynamicList<label> allFeaturePoints(pointEdges.size());
dynamicLabelList allFeaturePoints(pointEdges.size());
forAll(pointEdges, pointI)
{
@ -1620,7 +1620,7 @@ void Foam::polyDualMesh::calcFeatures
)
);
DynamicList<label> allFeatureEdges(isFeatureEdge.size());
dynamicLabelList allFeatureEdges(isFeatureEdge.size());
forAll(isFeatureEdge, edgeI)
{
if (isFeatureEdge[edgeI])

View file

@ -119,9 +119,9 @@ class polyDualMesh
const labelList& featEdgeIndices,
DynamicList<face>& dualFaces,
DynamicList<label>& dualOwner,
DynamicList<label>& dualNeighbour,
DynamicList<label>& dualRegion
dynamicLabelList& dualOwner,
dynamicLabelList& dualNeighbour,
dynamicLabelList& dualRegion
);
static void dualPatch
@ -134,9 +134,9 @@ class polyDualMesh
const pointField& dualPoints,
DynamicList<face>& dualFaces,
DynamicList<label>& dualOwner,
DynamicList<label>& dualNeighbour,
DynamicList<label>& dualRegion
dynamicLabelList& dualOwner,
dynamicLabelList& dualNeighbour,
dynamicLabelList& dualRegion
);
void calcDual

View file

@ -161,7 +161,7 @@ void Foam::mgMeshLevel::makeChild() const
options[3] = nGeometricD(); // Dimensionality of the grid
// Output: cell to coarse clusted addressing
label nCoarseCells = 0;
int nCoarseCells = 0;
child_.setSize(nCells());
int nMoves = -1;
@ -214,8 +214,8 @@ void Foam::mgMeshLevel::makeChild() const
dblAreas.begin(),
cellCells.begin(),
dblFaceWeights.begin(),
mgMinClusterSize_,
mgMaxClusterSize_,
mgMinClusterSize_(),
mgMaxClusterSize_(),
options.begin(),
&nMoves,
&nCoarseCells_,

View file

@ -341,7 +341,7 @@ void Foam::decompositionMethod::calcCellCells
) << "Only valid for mesh agglomeration." << exit(FatalError);
}
List<DynamicList<label> > dynCellCells(nCoarse);
List<dynamicLabelList > dynCellCells(nCoarse);
forAll(mesh.faceNeighbour(), faceI)
{

View file

@ -11,5 +11,4 @@ LIB_LIBS = \
-L$(METIS_LIB_DIR) -lmetis \
-L$(PARMETIS_LIB_DIR) -lmetis -lparmetis \
-ldecompositionMethods \
-lmetisDecomp \
-L$(OPENMPI_DIR)/lib -lmpi
-lmetisDecomp

View file

@ -665,7 +665,7 @@ Foam::labelList Foam::parMetisDecomp::decompose
labelListList globalRegionRegions;
{
List<DynamicList<label> > dynRegionRegions(regionPoints.size());
List<dynamicLabelList > dynRegionRegions(regionPoints.size());
// Internal faces first
forAll(faceNeighbour, faceI)

View file

@ -17,6 +17,7 @@ LIB_LIBS = \
-ldecompositionMethods \
-L$(SCOTCH_LIB_DIR) -lscotch \
-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
#else

View file

@ -695,7 +695,7 @@ labelList dynamicRefineFvMesh::selectRefineCells
label nCandidates = returnReduce(count(candidateCell, 1), sumOp<label>());
// Collect all cells
DynamicList<label> candidates(nCells());
dynamicLabelList candidates(nCells());
if (nCandidates < nTotToRefine)
{
@ -771,7 +771,7 @@ labelList dynamicRefineFvMesh::selectUnrefinePoints
// All points that can be unrefined
const labelList splitPoints(meshCutter_.getSplitPoints());
DynamicList<label> newSplitPoints(splitPoints.size());
dynamicLabelList newSplitPoints(splitPoints.size());
forAll(splitPoints, i)
{

View file

@ -322,8 +322,9 @@ bool Foam::mixerGgiFvMesh::update()
)
);
// The mesh is not morphing
return false;
// The mesh is not morphing, but flux re-calculation is required
// HJ, 25/Jan/2016
return true;
}

View file

@ -235,8 +235,9 @@ bool Foam::turboFvMesh::update()
)
);
// The mesh is not morphing
return false;
// The mesh is not morphing, but flux re-calculation is required
// HJ, 25/Jan/2016
return true;
}

View file

@ -195,7 +195,7 @@ void Foam::boundaryMesh::markEdges
const label edgeI,
const label distance,
labelList& minDistance,
DynamicList<label>& visited
dynamicLabelList& visited
) const
{
if (distance < maxDistance)
@ -868,8 +868,8 @@ Foam::labelList Foam::boundaryMesh::getNearest
// Divide faces into two bins acc. to normal
// - left of splitNormal
// - right ,,
DynamicList<label> leftFaces(mesh().size()/2);
DynamicList<label> rightFaces(mesh().size()/2);
dynamicLabelList leftFaces(mesh().size()/2);
dynamicLabelList rightFaces(mesh().size()/2);
forAll(mesh(), bFaceI)
{
@ -1241,7 +1241,7 @@ void Foam::boundaryMesh::patchify
if (newPatchPtrList.size() > 0)
{
List<DynamicList<label> > patchFaces(nNewPatches);
List<dynamicLabelList > patchFaces(nNewPatches);
// Give reasonable estimate for size of patches
label nAvgFaces =
@ -1505,7 +1505,7 @@ void Foam::boundaryMesh::setExtraEdges(const label edgeI)
// All edge labels encountered
DynamicList<label> visitedEdges;
dynamicLabelList visitedEdges;
// Floodfill from edgeI starting from distance 0. Stop at distance.
markEdges(8, edgeI, 0, minDistance, visitedEdges);

View file

@ -132,7 +132,7 @@ class boundaryMesh
const label edgeI,
const label distance,
labelList& minDistance,
DynamicList<label>& visited
dynamicLabelList& visited
) const;
//- Get index of polypatch by name

View file

@ -235,7 +235,7 @@ bool Foam::combineFaces::faceNeighboursValid
// to be 3 or more.
// Unregioned neighbouring faces
DynamicList<label> neighbourFaces(cFaces.size());
dynamicLabelList neighbourFaces(cFaces.size());
// Regioned neighbouring faces
labelHashSet neighbourRegions;

View file

@ -38,7 +38,7 @@ SourceFiles
#define edgeCollapser_H
#include "labelList.H"
#include "DynamicList.H"
#include "dynamicLabelList.H"
#include "typeInfo.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -67,7 +67,7 @@ class edgeCollapser
labelList pointRegion_;
//- -1 or master vertex for region number
DynamicList<label> pointRegionMaster_;
dynamicLabelList pointRegionMaster_;
//- Stack of free region numbers. Corresponds to -1 in pointRegionMaster
SLList<label> freeRegions_;
@ -139,7 +139,7 @@ public:
//- For every region the master (i.e. the point the region will
// be replaced by)
const DynamicList<label>& pointRegionMaster() const
const dynamicLabelList& pointRegionMaster() const
{
return pointRegionMaster_;
}

View file

@ -103,7 +103,7 @@ void Foam::faceCollapser::filterFace
const labelList& fEdges = mesh_.faceEdges()[faceI];
// Space for replaced vertices and split edges.
DynamicList<label> newFace(10 * f.size());
dynamicLabelList newFace(10 * f.size());
forAll(f, fp)
{
@ -416,7 +416,7 @@ void Foam::faceCollapser::setRefinement
label sorted1 = sortedFp[fp1];
// Get indices in increasing order
DynamicList<label> edgePoints(f.size());
dynamicLabelList edgePoints(f.size());
// Whether edgePoints are from fp to fp1
bool fpToFp1;

View file

@ -881,7 +881,7 @@ void Foam::hexRef8::insertEdgeSplit
const labelList& edgeMidPoint,
const label p0,
const label p1,
DynamicList<label>& verts
dynamicLabelList& verts
) const
{
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
// be between cellMid and face mids.
DynamicList<label> newFaceVerts(4);
dynamicLabelList newFaceVerts(4);
if (faceOrder == (mesh_.faceOwner()[faceI] == cellI))
{
newFaceVerts.append(faceMidPointI);
@ -1388,7 +1388,7 @@ void Foam::hexRef8::walkFaceToMid
const label cLevel,
const label faceI,
const label startFp,
DynamicList<label>& faceVerts
dynamicLabelList& faceVerts
) const
{
const face& f = mesh_.faces()[faceI];
@ -1437,7 +1437,7 @@ void Foam::hexRef8::walkFaceFromMid
const label cLevel,
const label faceI,
const label startFp,
DynamicList<label>& faceVerts
dynamicLabelList& faceVerts
) const
{
const face& f = mesh_.faces()[faceI];
@ -2104,7 +2104,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement
// Labels of seed faces
DynamicList<label> seedFaces(mesh_.nFaces()/100);
dynamicLabelList seedFaces(mesh_.nFaces()/100);
// refinementLevel data on seed faces
DynamicList<refinementData> seedFacesInfo(mesh_.nFaces()/100);
@ -2597,7 +2597,7 @@ Foam::labelList Foam::hexRef8::consistentSlowRefinement2
// Labels of seed faces
DynamicList<label> seedFaces(mesh_.nFaces()/100);
dynamicLabelList seedFaces(mesh_.nFaces()/100);
// refinementLevel data on seed faces
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.
DynamicList<label> newCellLevel(cellLevel_.size());
dynamicLabelList newCellLevel(cellLevel_.size());
forAll(cellLevel_, cellI)
{
newCellLevel.append(cellLevel_[cellI]);
}
DynamicList<label> newPointLevel(pointLevel_.size());
dynamicLabelList newPointLevel(pointLevel_.size());
forAll(pointLevel_, pointI)
{
newPointLevel.append(pointLevel_[pointI]);
@ -3608,7 +3608,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
{
// point is anchor. Start collecting face.
DynamicList<label> faceVerts(4);
dynamicLabelList faceVerts(4);
faceVerts.append(pointI);
@ -3740,7 +3740,7 @@ Foam::labelListList Foam::hexRef8::setRefinement
const face& f = mesh_.faces()[faceI];
const labelList& fEdges = mesh_.faceEdges()[faceI];
DynamicList<label> newFaceVerts(f.size());
dynamicLabelList newFaceVerts(f.size());
forAll(f, fp)
{

View file

@ -217,7 +217,7 @@ class hexRef8
const labelList& edgeMidPoint,
const label p0,
const label p1,
DynamicList<label>& verts
dynamicLabelList& verts
) const;
//- Store in maps correspondence from midpoint to anchors and faces.
@ -277,7 +277,7 @@ class hexRef8
const label cLevel,
const label faceI,
const label startFp,
DynamicList<label>& faceVerts
dynamicLabelList& faceVerts
) const;
//- Same as walkFaceToMid but now walk back.
@ -287,7 +287,7 @@ class hexRef8
const label cLevel,
const label faceI,
const label startFp,
DynamicList<label>& faceVerts
dynamicLabelList& faceVerts
) const;
//- Updates refineCell so consistent 2:1 refinement. Returns local

View file

@ -144,7 +144,7 @@ Foam::labelList Foam::removeCells::getExposedFaces
// 2 : unaffected internal face
// unaffected coupled boundary face
DynamicList<label> exposedFaces(mesh_.nFaces()/10);
dynamicLabelList exposedFaces(mesh_.nFaces()/10);
for (label faceI = 0; faceI < mesh_.nInternalFaces(); faceI++)
{

View file

@ -339,7 +339,7 @@ void Foam::removeFaces::mergeFaces
}
DynamicList<label> faceVerts(edgeLoop.size());
dynamicLabelList faceVerts(edgeLoop.size());
forAll(edgeLoop, i)
{
@ -740,7 +740,7 @@ Foam::label Foam::removeFaces::compatibleRemoves
}
// 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++)
{

View file

@ -60,7 +60,7 @@ const Foam::point Foam::directTopoChange::greatPoint
void Foam::directTopoChange::renumber
(
const labelList& map,
DynamicList<label>& elems
dynamicLabelList& elems
)
{
forAll (elems, elemI)
@ -77,7 +77,7 @@ void Foam::directTopoChange::renumber
void Foam::directTopoChange::renumberReverseMap
(
const labelList& map,
DynamicList<label>& elems
dynamicLabelList& elems
)
{
forAll (elems, elemI)

View file

@ -125,11 +125,11 @@ class directTopoChange
DynamicList<point> points_;
//- Original point label (or masterpoint for added points)
DynamicList<label> pointMap_;
dynamicLabelList pointMap_;
//- For all original and added points contains new point label.
// (used to map return value of addPoint to new mesh point)
DynamicList<label> reversePointMap_;
dynamicLabelList reversePointMap_;
//- Zone of point
Map<label> pointZone_;
@ -144,21 +144,21 @@ class directTopoChange
DynamicList<face> faces_;
//- Patch for every external face (-1 for internal faces)
DynamicList<label> region_;
dynamicLabelList region_;
//- Owner for all faces
DynamicList<label> faceOwner_;
dynamicLabelList faceOwner_;
//- Neighbour for internal faces (-1 for external faces)
DynamicList<label> faceNeighbour_;
dynamicLabelList faceNeighbour_;
//- Original face label. Or master face for added-from-faces;
// -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
// (used to map return value of addFace to new mesh face)
DynamicList<label> reverseFaceMap_;
dynamicLabelList reverseFaceMap_;
//- Faces added from point (corresponding faceMap_ will
// be -1)
@ -185,11 +185,11 @@ class directTopoChange
//- Original cell label or master cell for added-from-cell;
// -1 for cells added from face or edge.
DynamicList<label> cellMap_;
dynamicLabelList cellMap_;
//- For all original and added cells contains new cell label
// (used to map return value of addCell to new mesh cell)
DynamicList<label> reverseCellMap_;
dynamicLabelList reverseCellMap_;
//- Cells added from point
Map<label> cellFromPoint_;
@ -201,7 +201,7 @@ class directTopoChange
Map<label> cellFromFace_;
//- Zone of cell
DynamicList<label> cellZone_;
dynamicLabelList cellZone_;
// Private Member Functions
@ -215,10 +215,10 @@ class directTopoChange
static void renumberKey(const labelList& map, Map<T>&);
//- 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&);
//- 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
static void renumberCompact(const labelList&, labelList&);
@ -430,19 +430,19 @@ public:
return faces_;
}
const DynamicList<label>& region() const
const dynamicLabelList& region() const
{
return region_;
}
//- Owner
const DynamicList<label>& faceOwner() const
const dynamicLabelList& faceOwner() const
{
return faceOwner_;
}
//- Neighbour
const DynamicList<label>& faceNeighbour()const
const dynamicLabelList& faceNeighbour()const
{
return faceNeighbour_;
}

View file

@ -1352,8 +1352,8 @@ bool Foam::cellCuts::calcAnchors
walkEdges(cellI, cPoints[uncutIndex], 2, edgeStatus, pointStatus);
// Collect both sets in lists.
DynamicList<label> connectedPoints(cPoints.size());
DynamicList<label> otherPoints(cPoints.size());
dynamicLabelList connectedPoints(cPoints.size());
dynamicLabelList otherPoints(cPoints.size());
forAllConstIter(Map<label>, pointStatus, iter)
{
@ -2238,7 +2238,7 @@ void Foam::cellCuts::setFromCellCutter
scalarField cellLoopWeights;
// For debugging purposes
DynamicList<label> invalidCutCells(2);
dynamicLabelList invalidCutCells(2);
DynamicList<labelList> invalidCutLoops(2);
DynamicList<scalarField> invalidCutLoopWeights(2);
@ -2355,7 +2355,7 @@ void Foam::cellCuts::setFromCellCutter
scalarField cellLoopWeights;
// For debugging purposes
DynamicList<label> invalidCutCells(2);
dynamicLabelList invalidCutCells(2);
DynamicList<labelList> invalidCutLoops(2);
DynamicList<scalarField> invalidCutLoopWeights(2);

View file

@ -280,7 +280,7 @@ bool Foam::geomCellLooper::cut
// Size overly big.
label nEstCuts = 2*mesh().cells()[cellI].size();
DynamicList<label> localLoop(nEstCuts);
dynamicLabelList localLoop(nEstCuts);
DynamicList<scalar> localLoopWeights(nEstCuts);
// Points checked. Used to make sure we don't cut edge and edge endpoints

View file

@ -386,7 +386,7 @@ void Foam::topoCellLooper::walkSplitHex
const label fromEdgeI,
const label fromVertI,
DynamicList<label>& loop,
dynamicLabelList& loop,
DynamicList<scalar>& loopWeights
) const
{
@ -770,7 +770,7 @@ bool Foam::topoCellLooper::cut
label nEstCuts = 2*mesh().cells()[cellI].size();
DynamicList<label> localLoop(nEstCuts);
dynamicLabelList localLoop(nEstCuts);
DynamicList<scalar> localLoopWeights(nEstCuts);
walkSplitHex

View file

@ -139,7 +139,7 @@ class topoCellLooper
const label fromEdgeI,
const label fromVertI,
DynamicList<label>& loop,
dynamicLabelList& loop,
DynamicList<scalar>& loopWeights
) const;

View file

@ -92,7 +92,7 @@ Foam::face Foam::boundaryCutter::addEdgeCutsToFace
const labelList& fEdges = mesh_.faceEdges()[faceI];
// Storage for face
DynamicList<label> newFace(2 * f.size());
dynamicLabelList newFace(2 * f.size());
forAll(f, fp)
{
@ -339,7 +339,7 @@ bool Foam::boundaryCutter::splitFace
// Storage for new face
DynamicList<label> newFace(extendedFace.size());
dynamicLabelList newFace(extendedFace.size());
label fp = startFp;
@ -683,7 +683,7 @@ void Foam::boundaryCutter::setRefinement
// Replace existing face by newFace from fp0 to fp1 and add new one
// from fp1 to fp0.
DynamicList<label> newVerts(newFace.size());
dynamicLabelList newVerts(newFace.size());
// Get vertices from fp0 to (and including) fp1
label fp = fp0;

View file

@ -357,7 +357,7 @@ Foam::labelList Foam::undoableMeshCutter::getSplitFaces() const
<< abort(FatalError);
}
DynamicList<label> liveSplitFaces(liveSplitCells_.size());
dynamicLabelList liveSplitFaces(liveSplitCells_.size());
forAllConstIter(Map<splitCell*>, liveSplitCells_, iter)
{

View file

@ -562,7 +562,7 @@ void Foam::faceCoupleInfo::setCutEdgeToPoints(const labelList& cutToMasterEdges)
// String up the edges between e[0] and e[1]. Store the points
// inbetween e[0] and e[1] (all in cutFaces() labels)
DynamicList<label> splitPoints(stringedEdges.size()-1);
dynamicLabelList splitPoints(stringedEdges.size()-1);
// Unsplit edge endpoints
const edge unsplitEdge
@ -766,7 +766,7 @@ bool Foam::faceCoupleInfo::matchPointsThroughFaces
// Compaction list for cut points: either -1 or index into master which
// gives the point to compact to.
labelList cutPointRegion(cutPoints.size(), -1);
DynamicList<label> cutPointRegionMaster;
dynamicLabelList cutPointRegionMaster;
forAll(patchFaces, patchFaceI)
{
@ -1327,7 +1327,7 @@ Foam::label Foam::faceCoupleInfo::matchEdgeFaces
// the current set of master faces.
const labelList& masterFaces = fnd();
DynamicList<label> newCandidates(masterFaces.size());
dynamicLabelList newCandidates(masterFaces.size());
forAll(masterEFaces, j)
{

View file

@ -43,7 +43,7 @@ void Foam::polyMeshAdder::append
(
const labelList& map,
const labelList& lst,
DynamicList<label>& dynLst
dynamicLabelList& dynLst
)
{
dynLst.setSize(dynLst.size() + lst.size());
@ -427,7 +427,7 @@ void Foam::polyMeshAdder::insertVertices
const labelList& masterToCutPoints,
const face& masterF,
DynamicList<label>& workFace,
dynamicLabelList& workFace,
face& allF
)
{
@ -797,7 +797,7 @@ void Foam::polyMeshAdder::mergePrimitives
masterCutFaces.insert(meshFaceI);
}
DynamicList<label> workFace(100);
dynamicLabelList workFace(100);
forAll(from0ToAllFaces, face0)
{
@ -896,7 +896,7 @@ void Foam::polyMeshAdder::mergePointZones
DynamicList<word>& zoneNames,
labelList& from1ToAll,
List<DynamicList<label> >& pzPoints
List<dynamicLabelList >& pzPoints
)
{
zoneNames.setSize(pz0.size() + pz1.size());
@ -917,7 +917,7 @@ void Foam::polyMeshAdder::mergePointZones
forAll(pz0, zoneI)
{
DynamicList<label>& newZone = pzPoints[zoneI];
dynamicLabelList& newZone = pzPoints[zoneI];
newZone.setSize(pz0[zoneI].size());
@ -928,7 +928,7 @@ void Foam::polyMeshAdder::mergePointZones
forAll(pz1, zoneI)
{
// 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());
@ -951,7 +951,7 @@ void Foam::polyMeshAdder::mergeFaceZones
DynamicList<word>& zoneNames,
labelList& from1ToAll,
List<DynamicList<label> >& fzFaces,
List<dynamicLabelList >& fzFaces,
List<DynamicList<bool> >& fzFlips
)
{
@ -973,7 +973,7 @@ void Foam::polyMeshAdder::mergeFaceZones
fzFlips.setSize(zoneNames.size());
forAll(fz0, zoneI)
{
DynamicList<label>& newZone = fzFaces[zoneI];
dynamicLabelList& newZone = fzFaces[zoneI];
DynamicList<bool>& newFlip = fzFlips[zoneI];
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.
forAll(fz1, zoneI)
{
DynamicList<label>& newZone = fzFaces[from1ToAll[zoneI]];
dynamicLabelList& newZone = fzFaces[from1ToAll[zoneI]];
DynamicList<bool>& newFlip = fzFlips[from1ToAll[zoneI]];
newZone.setSize(newZone.size() + fz1[zoneI].size());
@ -1034,7 +1034,7 @@ void Foam::polyMeshAdder::mergeCellZones
DynamicList<word>& zoneNames,
labelList& from1ToAll,
List<DynamicList<label> >& czCells
List<dynamicLabelList >& czCells
)
{
zoneNames.setSize(cz0.size() + cz1.size());
@ -1062,7 +1062,7 @@ void Foam::polyMeshAdder::mergeCellZones
// Cell mapping is trivial.
forAll(cz1, zoneI)
{
DynamicList<label>& newZone = czCells[from1ToAll[zoneI]];
dynamicLabelList& newZone = czCells[from1ToAll[zoneI]];
newZone.setSize(newZone.size() + cz1[zoneI].size());
@ -1088,14 +1088,14 @@ void Foam::polyMeshAdder::mergeZones
const labelList& from1ToAllCells,
DynamicList<word>& pointZoneNames,
List<DynamicList<label> >& pzPoints,
List<dynamicLabelList >& pzPoints,
DynamicList<word>& faceZoneNames,
List<DynamicList<label> >& fzFaces,
List<dynamicLabelList >& fzFaces,
List<DynamicList<bool> >& fzFlips,
DynamicList<word>& cellZoneNames,
List<DynamicList<label> >& czCells
List<dynamicLabelList >& czCells
)
{
labelList from1ToAllPZones;
@ -1142,14 +1142,14 @@ void Foam::polyMeshAdder::mergeZones
void Foam::polyMeshAdder::addZones
(
const DynamicList<word>& pointZoneNames,
const List<DynamicList<label> >& pzPoints,
const List<dynamicLabelList >& pzPoints,
const DynamicList<word>& faceZoneNames,
const List<DynamicList<label> >& fzFaces,
const List<dynamicLabelList >& fzFaces,
const List<DynamicList<bool> >& fzFlips,
const DynamicList<word>& cellZoneNames,
const List<DynamicList<label> >& czCells,
const List<dynamicLabelList >& czCells,
polyMesh& mesh
)
@ -1295,14 +1295,14 @@ Foam::autoPtr<Foam::polyMesh> Foam::polyMeshAdder::add
// ~~~~~
DynamicList<word> pointZoneNames;
List<DynamicList<label> > pzPoints;
List<dynamicLabelList > pzPoints;
DynamicList<word> faceZoneNames;
List<DynamicList<label> > fzFaces;
List<dynamicLabelList > fzFaces;
List<DynamicList<bool> > fzFlips;
DynamicList<word> cellZoneNames;
List<DynamicList<label> > czCells;
List<dynamicLabelList > czCells;
mergeZones
(
@ -1508,14 +1508,14 @@ Foam::autoPtr<Foam::mapAddedPolyMesh> Foam::polyMeshAdder::add
// ~~~~~
DynamicList<word> pointZoneNames;
List<DynamicList<label> > pzPoints;
List<dynamicLabelList > pzPoints;
DynamicList<word> faceZoneNames;
List<DynamicList<label> > fzFaces;
List<dynamicLabelList > fzFaces;
List<DynamicList<bool> > fzFlips;
DynamicList<word> cellZoneNames;
List<DynamicList<label> > czCells;
List<dynamicLabelList > czCells;
mergeZones
(

View file

@ -74,7 +74,7 @@ private:
(
const labelList& map,
const labelList& lst,
DynamicList<label>&
dynamicLabelList&
);
//- Index of patch in allPatches. Add if nonexisting.
@ -139,7 +139,7 @@ private:
const labelList& masterToCutPoints,
const face& masterFace,
DynamicList<label>& workFace,
dynamicLabelList& workFace,
face& f
);
@ -180,7 +180,7 @@ private:
DynamicList<word>& zoneNames,
labelList& from1ToAll,
List<DynamicList<label> >& pzPoints
List<dynamicLabelList >& pzPoints
);
//- Merge face zones
@ -193,7 +193,7 @@ private:
DynamicList<word>& zoneNames,
labelList& from1ToAll,
List<DynamicList<label> >& fzFaces,
List<dynamicLabelList >& fzFaces,
List<DynamicList<bool> >& fzFlips
);
@ -206,7 +206,7 @@ private:
DynamicList<word>& zoneNames,
labelList& from1ToAll,
List<DynamicList<label> >& czCells
List<dynamicLabelList >& czCells
);
//- Merge point/face/cell zone information
@ -221,28 +221,28 @@ private:
const labelList& from1ToAllCells,
DynamicList<word>& pointZoneNames,
List<DynamicList<label> >& pzPoints,
List<dynamicLabelList >& pzPoints,
DynamicList<word>& faceZoneNames,
List<DynamicList<label> >& fzFaces,
List<dynamicLabelList >& fzFaces,
List<DynamicList<bool> >& fzFlips,
DynamicList<word>& cellZoneNames,
List<DynamicList<label> >& czCells
List<dynamicLabelList >& czCells
);
//- Create new zones and add to new mesh.
static void addZones
(
const DynamicList<word>& pointZoneNames,
const List<DynamicList<label> >& pzPoints,
const List<dynamicLabelList >& pzPoints,
const DynamicList<word>& faceZoneNames,
const List<DynamicList<label> >& fzFaces,
const List<dynamicLabelList >& fzFaces,
const List<DynamicList<bool> >& fzFlips,
const DynamicList<word>& cellZoneNames,
const List<DynamicList<label> >& czCells,
const List<dynamicLabelList >& czCells,
polyMesh& mesh
);

View file

@ -110,7 +110,7 @@ void Foam::attachDetach::checkDefinition()
{
const labelList& addr = mesh.faceZones()[faceZoneID_.index()];
DynamicList<label> bouFacesInZone(addr.size());
dynamicLabelList bouFacesInZone(addr.size());
forAll (addr, faceI)
{
@ -178,7 +178,7 @@ void Foam::attachDetach::checkDefinition()
{
const labelList& addr = mesh.faceZones()[faceZoneID_.index()];
DynamicList<label> zoneProblemFaces(addr.size());
dynamicLabelList zoneProblemFaces(addr.size());
forAll (addr, faceI)
{

View file

@ -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
// that edge.
List<DynamicList<label> > pointsIntoMasterEdges(masterEdges.size());
List<DynamicList<label> > pointsIntoSlaveEdges(slaveEdges.size());
List<dynamicLabelList > pointsIntoMasterEdges(masterEdges.size());
List<dynamicLabelList > pointsIntoSlaveEdges(slaveEdges.size());
// Add all points from the slave patch that have hit the edge
forAll (slavePointEdgeHits, pointI)
@ -1304,7 +1304,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
// Pout<< "old rich master face: " << oldRichFace
// << " old face: " << oldFace << endl;
DynamicList<label> newFaceLabels(2*oldFace.size());
dynamicLabelList newFaceLabels(2*oldFace.size());
forAll (oldFace, pointI)
{
@ -1579,7 +1579,7 @@ void Foam::slidingInterface::coupleInterface(polyTopoChange& ref) const
oldFace.setSize(nOldFace);
DynamicList<label> newFaceLabels(2*oldFace.size());
dynamicLabelList newFaceLabels(2*oldFace.size());
// Pout << "old rich slave face: " << oldRichFace << " old face: " << oldFace << endl;
forAll (oldFace, pointI)

View file

@ -188,7 +188,7 @@ void Foam::slidingInterface::decoupleInterface
const face& oldFace = faces[curFaceID];
DynamicList<label> newFaceLabels(oldFace.size());
dynamicLabelList newFaceLabels(oldFace.size());
bool changed = false;
@ -305,7 +305,7 @@ void Foam::slidingInterface::decoupleInterface
const face& oldFace = faces[curFaceID];
DynamicList<label> newFaceLabels(oldFace.size());
dynamicLabelList newFaceLabels(oldFace.size());
bool changed = false;

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