Merge remote-tracking branch 'origin/master' into develop

This commit is contained in:
Mark Olesen 2020-04-06 12:38:57 +02:00
commit f644d78bde
8 changed files with 79 additions and 44 deletions

View File

@ -1,2 +1,2 @@
api=2002
patch=200316
patch=200403

View File

@ -9,8 +9,13 @@
type forces;
libs ("libforces.so");
writeControl timeStep;
writeInterval 1;
// How often force and moment volume fields will be written
writeControl writeTime; // none
// How often the forces force.dat and moment.dat data files are updated
// Note: .dat files are always updated on writeControl times
executeControl timeStep;
executeInterval 1;
log off;

View File

@ -50,13 +50,30 @@ namespace surfaceWriters
namespace Foam
{
//- A (0-1) range for colouring
inline scalar srange01(const scalarMinMax& range, scalar x)
{
if (x >= range.max())
{
return 1;
}
x -= range.min();
if (x < VSMALL)
{
return 0;
}
return x / (range.max() - range.min());
}
//- A (0-1) range for colouring
template<class Type>
static inline scalar rangex(const scalarMinMax& range, const Type& val)
{
scalar x = Foam::mag(val);
return (x - range.min()) / (range.max() - range.min());
return srange01(range, Foam::mag(val));
}
@ -64,8 +81,7 @@ static inline scalar rangex(const scalarMinMax& range, const Type& val)
template<>
inline scalar rangex(const scalarMinMax& range, const scalar& val)
{
scalar x = val;
return (x - range.min()) / (range.max() - range.min());
return srange01(range, val);
}
@ -73,8 +89,7 @@ inline scalar rangex(const scalarMinMax& range, const scalar& val)
template<>
inline scalar rangex(const scalarMinMax& range, const label& val)
{
scalar x = val;
return (x - range.min()) / (range.max() - range.min());
return srange01(range, val);
}
@ -273,8 +288,17 @@ Foam::fileName Foam::surfaceWriters::x3dWriter::writeTemplate
if (!range.valid())
{
range = minMaxMag(values);
if (equal(range.mag(), 0))
{
range.add(range.centre());
}
}
// Slight rounding
range.min() -= VSMALL;
range.max() += VSMALL;
if (!isDir(outputFile.path()))
{
mkDir(outputFile.path());

View File

@ -6,7 +6,7 @@
\\/ M anipulation |
-------------------------------------------------------------------------------
Copyright (C) 2011-2017 OpenFOAM Foundation
Copyright (C) 2019 OpenCFD Ltd.
Copyright (C) 2019-2020 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
@ -72,7 +72,7 @@ Foam::radiation::P1::P1(const volScalarField& T)
"qr",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh_,
@ -142,7 +142,7 @@ Foam::radiation::P1::P1(const dictionary& dict, const volScalarField& T)
"qr",
mesh_.time().timeName(),
mesh_,
IOobject::NO_READ,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
mesh_,
@ -190,12 +190,6 @@ Foam::radiation::P1::P1(const dictionary& dict, const volScalarField& T)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::radiation::P1::~P1()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
bool Foam::radiation::P1::read()
@ -240,19 +234,19 @@ void Foam::radiation::P1::calculate()
fvm::laplacian(gamma, G_)
- fvm::Sp(a_, G_)
==
- 4.0*(e_*physicoChemical::sigma*pow4(T_) ) - E_
- 4.0*(e_*physicoChemical::sigma*pow4(T_)) - E_
);
volScalarField::Boundary& qrBf = qr_.boundaryFieldRef();
// Calculate radiative heat flux on boundaries.
volScalarField::Boundary& qrBf = qr_.boundaryFieldRef();
const volScalarField::Boundary& GBf = G_.boundaryField();
const volScalarField::Boundary& gammaBf = gamma.boundaryField();
forAll(mesh_.boundaryMesh(), patchi)
{
if (!G_.boundaryField()[patchi].coupled())
if (!GBf[patchi].coupled())
{
qrBf[patchi] =
-gamma.boundaryField()[patchi]
*G_.boundaryField()[patchi].snGrad();
qrBf[patchi] = -gammaBf[patchi]*GBf[patchi].snGrad();
}
}
}
@ -282,12 +276,9 @@ Foam::tmp<Foam::volScalarField> Foam::radiation::P1::Rp() const
Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>
Foam::radiation::P1::Ru() const
{
const volScalarField::Internal& G =
G_();
const volScalarField::Internal E =
absorptionEmission_->ECont()()();
const volScalarField::Internal a =
absorptionEmission_->aCont()()();
const volScalarField::Internal& G = G_();
const volScalarField::Internal E = absorptionEmission_->ECont()()();
const volScalarField::Internal a = absorptionEmission_->aCont()()();
return a*G - E;
}
@ -298,4 +289,5 @@ Foam::label Foam::radiation::P1::nBands() const
return absorptionEmission_->nBands();
}
// ************************************************************************* //

View File

@ -107,7 +107,7 @@ public:
//- Destructor
virtual ~P1();
virtual ~P1() = default;
// Member functions

View File

@ -17,7 +17,7 @@ GLIB_LIBS =
COMPILER_FAMILY = $(shell echo "$(WM_COMPILER)" | sed -e 's/[0-9].*//')
DEFAULT_RULES = $(WM_DIR)/rules/$(WM_ARCH)$(COMPILER_FAMILY)
RULES = $(WM_DIR)/rules/$(WM_ARCH)$(WM_COMPILER)
WMAKE_BIN = $(WM_DIR)/platforms/$(WM_ARCH)$(WM_COMPILER)
WMAKE_BIN = $(WM_PROJECT_DIR)/platforms/tools/$(WM_ARCH)$(WM_COMPILER)
# Default compilation is 'Opt' - never permit an empty value
ifeq ($(WM_COMPILE_OPTION),)

View File

@ -6,11 +6,10 @@
# \\ / A nd | www.openfoam.com
# \\/ M anipulation |
#-------------------------------------------------------------------------------
# Copyright (C) 2019 OpenCFD Ltd.
# Copyright (C) 2019-2020 OpenCFD Ltd.
#-------------------------------------------------------------------------------
# License
# This file is part of OpenFOAM, licensed under GNU General Public License
# <http://www.gnu.org/licenses/>.
# This file is part of OpenFOAM, distributed under GPL-3.0-or-later.
#
# Script
# wrap-lemon
@ -31,7 +30,7 @@
#
#------------------------------------------------------------------------------
binDir="${WMAKE_BIN:-$WM_PROJECT_DIR/wmake/platforms/$WM_ARCH$WM_COMPILER}"
binDir="${WMAKE_BIN:-$WM_PROJECT_DIR/platforms/tools/$WM_ARCH$WM_COMPILER}"
etcDir="${WM_DIR:-$WM_PROJECT_DIR/wmake}/etc"
# Executable and skeleton locations

View File

@ -1,23 +1,38 @@
#!/bin/sh
cd "${0%/*}" || exit # Run from this directory
cd "${0%/*}" || exit # This directory (/path/project/wmake/src)
if [ -z "$WM_DIR" ] # Require WM_DIR
if [ -z "$WM_DIR" ] # Require WM_DIR (/path/project/wmake)
then
WM_DIR="$(\cd $(dirname $0)/.. && \pwd -L)"
WM_DIR="$(dirname "$(pwd -L)")"
export WM_DIR
fi
if [ -z "$WM_PROJECT_DIR" ] # Expect WM_PROJECT_DIR (/path/project)
then
echo "Warning (${0##*/}) : No WM_PROJECT_DIR set" 1>&2
WM_PROJECT_DIR="${WM_DIR%/*}"
export WM_PROJECT_DIR
fi
if [ -z "$WM_ARCH" ] || [ -z "$WM_COMPILER" ]
then
echo "Error (${0##*/}) : No WM_ARCH or WM_COMPILER set"
echo " Check your OpenFOAM environment and installation"
exit 1
fi
case "$WM_COMPILER" in
Mingw*)
# Host wmake toolchain with system gcc (when cross-compiling)
make \
WM_COMPILER=Gcc WM_COMPILER_TYPE=system \
WMAKE_BIN="${WM_DIR}/platforms/${WM_ARCH}${WM_COMPILER}"
WMAKE_BIN="${WM_PROJECT_DIR}/platforms/tools/${WM_ARCH}${WM_COMPILER}" \
"$@"
;;
*)
# Compile wmake toolchain
make
# Regular wmake toolchain
make "$@"
;;
esac