mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev
This commit is contained in:
@ -52,11 +52,11 @@ USAGE
|
||||
case "$1" in
|
||||
(-s | -source | source)
|
||||
shift
|
||||
$WM_PROJECT_DIR/etc/codeTemplates/source/foamNewSource $*
|
||||
$WM_PROJECT_DIR/etc/codeTemplates/source/foamNewSource "$@"
|
||||
;;
|
||||
(-t | -template | template)
|
||||
shift
|
||||
$WM_PROJECT_DIR/etc/codeTemplates/template/foamNewTemplate $*
|
||||
$WM_PROJECT_DIR/etc/codeTemplates/template/foamNewTemplate "$@"
|
||||
;;
|
||||
(*)
|
||||
usage "unknown type '$1'"
|
||||
|
||||
@ -391,22 +391,12 @@ case SYSTEMOPENMPI:
|
||||
# Use the system installed openmpi, get library directory via mpicc
|
||||
setenv FOAM_MPI openmpi-system
|
||||
|
||||
# Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI
|
||||
setenv PINC "`mpicc --showme:compile`"
|
||||
setenv PLIBS "`mpicc --showme:link`"
|
||||
set libDir=`echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'`
|
||||
set libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'`
|
||||
|
||||
# Bit of a hack: strip off 'lib' and hope this is the path to openmpi
|
||||
# include files and libraries.
|
||||
setenv MPI_ARCH_PATH "${libDir:h}"
|
||||
|
||||
if ($?FOAM_VERBOSE && $?prompt) then
|
||||
echo "Using system installed MPI:"
|
||||
echo " compile flags : $PINC"
|
||||
echo " link flags : $PLIBS"
|
||||
echo " libmpi dir : $libDir"
|
||||
endif
|
||||
|
||||
_foamAddLib $libDir
|
||||
unset libDir
|
||||
breaksw
|
||||
|
||||
@ -418,23 +418,12 @@ SYSTEMOPENMPI)
|
||||
# Use the system installed openmpi, get library directory via mpicc
|
||||
export FOAM_MPI=openmpi-system
|
||||
|
||||
# Set compilation flags here instead of in wmake/rules/../mplibSYSTEMOPENMPI
|
||||
export PINC="`mpicc --showme:compile`"
|
||||
export PLIBS="`mpicc --showme:link`"
|
||||
libDir=`echo "$PLIBS" | sed -e 's/.*-L\([^ ]*\).*/\1/'`
|
||||
libDir=`mpicc --showme:link | sed -e 's/.*-L\([^ ]*\).*/\1/'`
|
||||
|
||||
# Bit of a hack: strip off 'lib' and hope this is the path to openmpi
|
||||
# include files and libraries.
|
||||
export MPI_ARCH_PATH="${libDir%/*}"
|
||||
|
||||
if [ "$FOAM_VERBOSE" -a "$PS1" ]
|
||||
then
|
||||
echo "Using system installed MPI:" 1>&2
|
||||
echo " compile flags : $PINC" 1>&2
|
||||
echo " link flags : $PLIBS" 1>&2
|
||||
echo " libmpi dir : $libDir" 1>&2
|
||||
fi
|
||||
|
||||
_foamAddLib $libDir
|
||||
unset libDir
|
||||
;;
|
||||
|
||||
@ -25,15 +25,10 @@ License
|
||||
|
||||
#include "jumpCyclicFvPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
|
||||
Foam::jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
@ -44,7 +39,7 @@ jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
|
||||
|
||||
|
||||
template<class Type>
|
||||
jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
|
||||
Foam::jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
|
||||
(
|
||||
const jumpCyclicFvPatchField<Type>& ptf,
|
||||
const fvPatch& p,
|
||||
@ -57,7 +52,7 @@ jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
|
||||
|
||||
|
||||
template<class Type>
|
||||
jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
|
||||
Foam::jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
|
||||
(
|
||||
const fvPatch& p,
|
||||
const DimensionedField<Type, volMesh>& iF,
|
||||
@ -72,7 +67,7 @@ jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
|
||||
|
||||
|
||||
template<class Type>
|
||||
jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
|
||||
Foam::jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
|
||||
(
|
||||
const jumpCyclicFvPatchField<Type>& ptf
|
||||
)
|
||||
@ -82,7 +77,7 @@ jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
|
||||
|
||||
|
||||
template<class Type>
|
||||
jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
|
||||
Foam::jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
|
||||
(
|
||||
const jumpCyclicFvPatchField<Type>& ptf,
|
||||
const DimensionedField<Type, volMesh>& iF
|
||||
@ -95,7 +90,8 @@ jumpCyclicFvPatchField<Type>::jumpCyclicFvPatchField
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
tmp<Field<Type> > jumpCyclicFvPatchField<Type>::patchNeighbourField() const
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::jumpCyclicFvPatchField<Type>::patchNeighbourField() const
|
||||
{
|
||||
const Field<Type>& iField = this->internalField();
|
||||
const labelUList& nbrFaceCells =
|
||||
@ -133,7 +129,7 @@ tmp<Field<Type> > jumpCyclicFvPatchField<Type>::patchNeighbourField() const
|
||||
|
||||
|
||||
template<class Type>
|
||||
void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||
void Foam::jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
scalarField& result,
|
||||
const scalarField& psiInternal,
|
||||
@ -142,48 +138,22 @@ void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||
const Pstream::commsTypes
|
||||
) const
|
||||
{
|
||||
scalarField pnf(this->size());
|
||||
|
||||
const labelUList& nbrFaceCells =
|
||||
this->cyclicPatch().neighbFvPatch().faceCells();
|
||||
|
||||
// for AMG solve - only apply jump to finest level
|
||||
if (psiInternal.size() == this->internalField().size())
|
||||
{
|
||||
Field<scalar> jf(this->jump()().component(cmpt));
|
||||
|
||||
if (!this->cyclicPatch().owner())
|
||||
{
|
||||
jf *= -1.0;
|
||||
}
|
||||
|
||||
forAll(*this, facei)
|
||||
{
|
||||
pnf[facei] = psiInternal[nbrFaceCells[facei]] - jf[facei];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(*this, facei)
|
||||
{
|
||||
pnf[facei] = psiInternal[nbrFaceCells[facei]];
|
||||
}
|
||||
}
|
||||
|
||||
// Transform according to the transformation tensors
|
||||
this->transformCoupleField(pnf, cmpt);
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
const labelUList& faceCells = this->cyclicPatch().faceCells();
|
||||
forAll(faceCells, elemI)
|
||||
{
|
||||
result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
|
||||
}
|
||||
notImplemented
|
||||
(
|
||||
"void Foam::jumpCyclicFvPatchField<Type>::updateInterfaceMatrix"
|
||||
"("
|
||||
"scalarField&, "
|
||||
"const scalarField&, "
|
||||
"const scalarField&, "
|
||||
"const direction, "
|
||||
"const Pstream::commsTypes"
|
||||
") const"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class Type>
|
||||
void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||
void Foam::jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||
(
|
||||
Field<Type>& result,
|
||||
const Field<Type>& psiInternal,
|
||||
@ -196,8 +166,8 @@ void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||
const labelUList& nbrFaceCells =
|
||||
this->cyclicPatch().neighbFvPatch().faceCells();
|
||||
|
||||
// for AMG solve - only apply jump to finest level
|
||||
if (psiInternal.size() == this->internalField().size())
|
||||
// only apply jump to original field
|
||||
if (&psiInternal == &this->internalField())
|
||||
{
|
||||
Field<Type> jf(this->jump());
|
||||
|
||||
@ -231,8 +201,4 @@ void jumpCyclicFvPatchField<Type>::updateInterfaceMatrix
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -144,6 +144,17 @@ public:
|
||||
) const;
|
||||
};
|
||||
|
||||
//- Update result field based on interface functionality
|
||||
template<>
|
||||
void jumpCyclicFvPatchField<scalar>::updateInterfaceMatrix
|
||||
(
|
||||
scalarField& result,
|
||||
const scalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
const Pstream::commsTypes commsType
|
||||
) const;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -2,7 +2,7 @@
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation
|
||||
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
License
|
||||
@ -27,17 +27,63 @@ License
|
||||
#include "addToRunTimeSelectionTable.H"
|
||||
#include "volFields.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
makePatchFieldsTypeName(jumpCyclic);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
makePatchFieldsTypeName(jumpCyclic);
|
||||
template<>
|
||||
void Foam::jumpCyclicFvPatchField<Foam::scalar>::updateInterfaceMatrix
|
||||
(
|
||||
scalarField& result,
|
||||
const scalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
const Pstream::commsTypes
|
||||
) const
|
||||
{
|
||||
scalarField pnf(this->size());
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
const labelUList& nbrFaceCells =
|
||||
this->cyclicPatch().neighbFvPatch().faceCells();
|
||||
|
||||
// only apply jump to original field
|
||||
if (&psiInternal == &this->internalField())
|
||||
{
|
||||
Field<scalar> jf(this->jump());
|
||||
|
||||
if (!this->cyclicPatch().owner())
|
||||
{
|
||||
jf *= -1.0;
|
||||
}
|
||||
|
||||
forAll(*this, facei)
|
||||
{
|
||||
pnf[facei] = psiInternal[nbrFaceCells[facei]] - jf[facei];
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
forAll(*this, facei)
|
||||
{
|
||||
pnf[facei] = psiInternal[nbrFaceCells[facei]];
|
||||
}
|
||||
}
|
||||
|
||||
// Transform according to the transformation tensors
|
||||
this->transformCoupleField(pnf, cmpt);
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
const labelUList& faceCells = this->cyclicPatch().faceCells();
|
||||
forAll(faceCells, elemI)
|
||||
{
|
||||
result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
|
||||
}
|
||||
}
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -129,33 +129,17 @@ void Foam::jumpCyclicAMIFvPatchField<Type>::updateInterfaceMatrix
|
||||
const Pstream::commsTypes
|
||||
) const
|
||||
{
|
||||
const labelUList& nbrFaceCells =
|
||||
this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells();
|
||||
|
||||
scalarField pnf(psiInternal, nbrFaceCells);
|
||||
|
||||
pnf = this->cyclicAMIPatch().interpolate(pnf);
|
||||
|
||||
// for AMG solve - only apply jump to finest level
|
||||
if (psiInternal.size() == this->internalField().size())
|
||||
{
|
||||
tmp<Field<scalar> > tjf = jump()().component(cmpt);
|
||||
if (!this->cyclicAMIPatch().owner())
|
||||
{
|
||||
tjf = -tjf;
|
||||
}
|
||||
pnf -= tjf;
|
||||
}
|
||||
|
||||
// Transform according to the transformation tensors
|
||||
this->transformCoupleField(pnf, cmpt);
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
const labelUList& faceCells = this->cyclicAMIPatch().faceCells();
|
||||
forAll(faceCells, elemI)
|
||||
{
|
||||
result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
|
||||
}
|
||||
notImplemented
|
||||
(
|
||||
"void Foam::jumpCyclicAMIFvPatchField<Type>::updateInterfaceMatrix"
|
||||
"("
|
||||
"scalarField&, "
|
||||
"const scalarField&, "
|
||||
"const scalarField& coeffs,"
|
||||
"const direction, "
|
||||
"const Pstream::commsTypes"
|
||||
") const"
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
@ -175,15 +159,16 @@ void Foam::jumpCyclicAMIFvPatchField<Type>::updateInterfaceMatrix
|
||||
|
||||
pnf = this->cyclicAMIPatch().interpolate(pnf);
|
||||
|
||||
// for AMG solve - only apply jump to finest level
|
||||
if (psiInternal.size() == this->internalField().size())
|
||||
// only apply jump to original field
|
||||
if (&psiInternal == &this->internalField())
|
||||
{
|
||||
tmp<Field<Type> > tjf = jump();
|
||||
Field<Type> jf(this->jump());
|
||||
if (!this->cyclicAMIPatch().owner())
|
||||
{
|
||||
tjf = -tjf;
|
||||
jf *= -1.0;
|
||||
}
|
||||
pnf -= tjf;
|
||||
|
||||
pnf -= jf;
|
||||
}
|
||||
|
||||
// Transform according to the transformation tensors
|
||||
|
||||
@ -148,6 +148,18 @@ public:
|
||||
};
|
||||
|
||||
|
||||
//- Update result field based on interface functionality
|
||||
template<>
|
||||
void jumpCyclicAMIFvPatchField<scalar>::updateInterfaceMatrix
|
||||
(
|
||||
scalarField& result,
|
||||
const scalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
const Pstream::commsTypes commsType
|
||||
) const;
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -36,6 +36,50 @@ namespace Foam
|
||||
|
||||
makePatchFieldsTypeName(jumpCyclicAMI);
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<>
|
||||
void Foam::jumpCyclicAMIFvPatchField<scalar>::updateInterfaceMatrix
|
||||
(
|
||||
scalarField& result,
|
||||
const scalarField& psiInternal,
|
||||
const scalarField& coeffs,
|
||||
const direction cmpt,
|
||||
const Pstream::commsTypes
|
||||
) const
|
||||
{
|
||||
const labelUList& nbrFaceCells =
|
||||
this->cyclicAMIPatch().cyclicAMIPatch().neighbPatch().faceCells();
|
||||
|
||||
scalarField pnf(psiInternal, nbrFaceCells);
|
||||
|
||||
pnf = this->cyclicAMIPatch().interpolate(pnf);
|
||||
|
||||
// only apply jump to original field
|
||||
if (&psiInternal == &this->internalField())
|
||||
{
|
||||
Field<scalar> jf(this->jump());
|
||||
|
||||
if (!this->cyclicAMIPatch().owner())
|
||||
{
|
||||
jf *= -1.0;
|
||||
}
|
||||
|
||||
pnf -= jf;
|
||||
}
|
||||
|
||||
// Transform according to the transformation tensors
|
||||
this->transformCoupleField(pnf, cmpt);
|
||||
|
||||
// Multiply the field by coefficients and add into the result
|
||||
const labelUList& faceCells = this->cyclicAMIPatch().faceCells();
|
||||
forAll(faceCells, elemI)
|
||||
{
|
||||
result[faceCells[elemI]] -= coeffs[elemI]*pnf[elemI];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace Foam
|
||||
|
||||
@ -25,6 +25,18 @@ License
|
||||
|
||||
#include "fanFvPatchField.H"
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
void Foam::fanFvPatchField<Type>::calcFanJump()
|
||||
{
|
||||
if (this->cyclicPatch().owner())
|
||||
{
|
||||
this->jump_ = this->jumpTable_->value(this->db().time().value());
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
@ -87,9 +99,17 @@ Foam::fanFvPatchField<Type>::fanFvPatchField
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> > Foam::fanFvPatchField<Type>::jump() const
|
||||
void Foam::fanFvPatchField<Type>::updateCoeffs()
|
||||
{
|
||||
return uniformJumpFvPatchField<Type>::jump();
|
||||
if (this->updated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
calcFanJump();
|
||||
|
||||
// call fixedJump variant - uniformJump will overwrite the jump value
|
||||
fixedJumpFvPatchField<scalar>::updateCoeffs();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -39,7 +39,6 @@ Description
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
patchType | underlying patch type should be \c cyclic| yes |
|
||||
jump | current jump value | yes |
|
||||
jumpTable | jump data, e.g. \c csvFile | yes |
|
||||
\endtable
|
||||
|
||||
@ -49,7 +48,6 @@ Description
|
||||
{
|
||||
type fan;
|
||||
patchType cyclic;
|
||||
jump uniform 0;
|
||||
jumpTable csvFile;
|
||||
csvFileCoeffs
|
||||
{
|
||||
@ -101,6 +99,12 @@ class fanFvPatchField
|
||||
public uniformJumpFvPatchField<Type>
|
||||
{
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Calculate the fan pressure jump
|
||||
void calcFanJump();
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
@ -170,17 +174,15 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
// Evaluation functions
|
||||
|
||||
//- Return the "jump" across the patch
|
||||
tmp<Field<Type> > jump() const;
|
||||
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
//- Update the coefficients associated with the patch field
|
||||
virtual void updateCoeffs();
|
||||
};
|
||||
|
||||
|
||||
//- Specialisation of the jump-condition for the pressure
|
||||
template<>
|
||||
void fanFvPatchField<scalar>::calcFanJump();
|
||||
|
||||
template<>
|
||||
fanFvPatchField<scalar>::fanFvPatchField
|
||||
(
|
||||
@ -189,12 +191,6 @@ fanFvPatchField<scalar>::fanFvPatchField
|
||||
const dictionary&
|
||||
);
|
||||
|
||||
template<>
|
||||
tmp<Field<scalar> > fanFvPatchField<scalar>::jump() const;
|
||||
|
||||
template<>
|
||||
void fanFvPatchField<scalar>::updateCoeffs();
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
|
||||
@ -41,6 +41,31 @@ namespace Foam
|
||||
);
|
||||
}
|
||||
|
||||
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
|
||||
|
||||
template<>
|
||||
void Foam::fanFvPatchField<Foam::scalar>::calcFanJump()
|
||||
{
|
||||
if (this->cyclicPatch().owner())
|
||||
{
|
||||
const surfaceScalarField& phi =
|
||||
db().lookupObject<surfaceScalarField>("phi");
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||
|
||||
scalarField Un(max(phip/patch().magSf(), scalar(0)));
|
||||
|
||||
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
||||
{
|
||||
Un /= patch().lookupPatchField<volScalarField, scalar>("rho");
|
||||
}
|
||||
|
||||
this->jump_ = this->jumpTable_->value(Un);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<>
|
||||
@ -91,11 +116,6 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField
|
||||
this->jumpTable_ = DataEntry<scalar>::New("jumpTable", dict);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// Dummy jump table
|
||||
this->jumpTable_.reset(new DataEntry<scalar>("jumpTable"));
|
||||
}
|
||||
|
||||
if (dict.found("value"))
|
||||
{
|
||||
@ -111,54 +131,4 @@ Foam::fanFvPatchField<Foam::scalar>::fanFvPatchField
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<>
|
||||
Foam::tmp<Foam::Field<Foam::scalar> >
|
||||
Foam::fanFvPatchField<Foam::scalar>::jump() const
|
||||
{
|
||||
if (this->cyclicPatch().owner())
|
||||
{
|
||||
const surfaceScalarField& phi =
|
||||
db().lookupObject<surfaceScalarField>("phi");
|
||||
|
||||
const fvsPatchField<scalar>& phip =
|
||||
patch().patchField<surfaceScalarField, scalar>(phi);
|
||||
|
||||
scalarField Un(max(phip/patch().magSf(), scalar(0)));
|
||||
|
||||
if (phi.dimensions() == dimDensity*dimVelocity*dimArea)
|
||||
{
|
||||
Un /= patch().lookupPatchField<volScalarField, scalar>("rho");
|
||||
}
|
||||
|
||||
return this->jumpTable_->value(Un);
|
||||
}
|
||||
else
|
||||
{
|
||||
return refCast<const fanFvPatchField<scalar> >
|
||||
(
|
||||
this->neighbourPatchField()
|
||||
).jump();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
template<>
|
||||
void Foam::fanFvPatchField<Foam::scalar>::updateCoeffs()
|
||||
{
|
||||
if (this->updated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->cyclicPatch().owner())
|
||||
{
|
||||
this->jump_ = jump();
|
||||
}
|
||||
|
||||
uniformJumpFvPatchField<scalar>::updateCoeffs();
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
|
||||
@ -35,7 +35,7 @@ Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
|
||||
)
|
||||
:
|
||||
fixedJumpFvPatchField<Type>(p, iF),
|
||||
jumpTable_(0)
|
||||
jumpTable_(new DataEntry<Type>("jumpTable"))
|
||||
{}
|
||||
|
||||
|
||||
@ -76,6 +76,10 @@ Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
|
||||
Field<Type>("value", dict, p.size())
|
||||
);
|
||||
}
|
||||
else
|
||||
{
|
||||
this->evaluate(Pstream::blocking);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@ -105,24 +109,19 @@ Foam::uniformJumpFvPatchField<Type>::uniformJumpFvPatchField
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> > Foam::uniformJumpFvPatchField<Type>::jump() const
|
||||
void Foam::uniformJumpFvPatchField<Type>::updateCoeffs()
|
||||
{
|
||||
if (this->updated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->cyclicPatch().owner())
|
||||
{
|
||||
const Type value = jumpTable_->value(this->db().time().value());
|
||||
|
||||
return tmp<Field<Type> >(new Field<Type>(this->patch().size(), value));
|
||||
this->jump_ = jumpTable_->value(this->db().time().value());
|
||||
}
|
||||
else
|
||||
{
|
||||
const uniformJumpFvPatchField& nbrPatch =
|
||||
refCast<const uniformJumpFvPatchField<Type> >
|
||||
(
|
||||
this->neighbourPatchField()
|
||||
);
|
||||
|
||||
return nbrPatch.jump();
|
||||
}
|
||||
fixedJumpFvPatchField<Type>::updateCoeffs();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -165,11 +165,8 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return the "jump" across the patch.
|
||||
virtual tmp<Field<Type> > jump() const;
|
||||
|
||||
//- Update the coefficients
|
||||
virtual void updateCoeffs();
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
|
||||
@ -102,25 +102,19 @@ Foam::uniformJumpAMIFvPatchField<Type>::uniformJumpAMIFvPatchField
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class Type>
|
||||
Foam::tmp<Foam::Field<Type> >
|
||||
Foam::uniformJumpAMIFvPatchField<Type>::jump() const
|
||||
void Foam::uniformJumpAMIFvPatchField<Type>::updateCoeffs()
|
||||
{
|
||||
if (this->updated())
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if (this->cyclicAMIPatch().owner())
|
||||
{
|
||||
Type j = jumpTable_->value(this->db().time().value());
|
||||
|
||||
return tmp<Field<Type> >(new Field<Type>(this->size(), j));
|
||||
this->jump_ = jumpTable_->value(this->db().time().value());
|
||||
}
|
||||
else
|
||||
{
|
||||
const uniformJumpAMIFvPatchField& nbrPatch =
|
||||
refCast<const uniformJumpAMIFvPatchField<Type> >
|
||||
(
|
||||
this->neighbourPatchField()
|
||||
);
|
||||
|
||||
return this->cyclicAMIPatch().interpolate(nbrPatch.jump());
|
||||
}
|
||||
fixedJumpAMIFvPatchField<Type>::updateCoeffs();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@ -165,11 +165,8 @@ public:
|
||||
|
||||
// Member functions
|
||||
|
||||
// Access
|
||||
|
||||
//- Return the "jump" across the patch.
|
||||
virtual tmp<Field<Type> > jump() const;
|
||||
|
||||
//- Update the coefficients
|
||||
virtual void updateCoeffs();
|
||||
|
||||
//- Write
|
||||
virtual void write(Ostream&) const;
|
||||
|
||||
@ -45,31 +45,56 @@ void Foam::fieldMinMax::calcMinMaxFields
|
||||
const label procI = Pstream::myProcNo();
|
||||
|
||||
const fieldType& field = obr_.lookupObject<fieldType>(fieldName);
|
||||
const fvMesh& mesh = field.mesh();
|
||||
|
||||
const volVectorField::GeometricBoundaryField& CfBoundary =
|
||||
mesh.C().boundaryField();
|
||||
|
||||
switch (mode)
|
||||
{
|
||||
case mdMag:
|
||||
{
|
||||
const scalarField magField(mag(field));
|
||||
const volScalarField magField(mag(field));
|
||||
const volScalarField::GeometricBoundaryField& magFieldBoundary =
|
||||
magField.boundaryField();
|
||||
|
||||
labelList minIs(Pstream::nProcs());
|
||||
scalarList minVs(Pstream::nProcs());
|
||||
List<vector> minCs(Pstream::nProcs());
|
||||
minIs[procI] = findMin(magField);
|
||||
minVs[procI] = magField[minIs[procI]];
|
||||
minCs[procI] = field.mesh().C()[minIs[procI]];
|
||||
label minProcI = findMin(magField);
|
||||
minVs[procI] = magField[minProcI];
|
||||
minCs[procI] = field.mesh().C()[minProcI];
|
||||
|
||||
Pstream::gatherList(minIs);
|
||||
Pstream::gatherList(minVs);
|
||||
Pstream::gatherList(minCs);
|
||||
|
||||
labelList maxIs(Pstream::nProcs());
|
||||
scalarList maxVs(Pstream::nProcs());
|
||||
List<vector> maxCs(Pstream::nProcs());
|
||||
maxIs[procI] = findMax(magField);
|
||||
maxVs[procI] = magField[maxIs[procI]];
|
||||
maxCs[procI] = field.mesh().C()[maxIs[procI]];
|
||||
label maxProcI = findMax(magField);
|
||||
maxVs[procI] = magField[maxProcI];
|
||||
maxCs[procI] = field.mesh().C()[maxProcI];
|
||||
|
||||
forAll(magFieldBoundary, patchI)
|
||||
{
|
||||
const scalarField& mfp = magFieldBoundary[patchI];
|
||||
const vectorField& Cfp = CfBoundary[patchI];
|
||||
|
||||
label minPI = findMin(mfp);
|
||||
if (mfp[minPI] < minVs[procI])
|
||||
{
|
||||
minVs[procI] = mfp[minPI];
|
||||
minCs[procI] = Cfp[minPI];
|
||||
}
|
||||
|
||||
label maxPI = findMax(mfp);
|
||||
if (mfp[maxPI] > maxVs[procI])
|
||||
{
|
||||
maxVs[procI] = mfp[maxPI];
|
||||
maxCs[procI] = Cfp[maxPI];
|
||||
}
|
||||
}
|
||||
|
||||
Pstream::gatherList(minVs);
|
||||
Pstream::gatherList(minCs);
|
||||
|
||||
Pstream::gatherList(maxIs);
|
||||
Pstream::gatherList(maxVs);
|
||||
Pstream::gatherList(maxCs);
|
||||
|
||||
@ -127,25 +152,47 @@ void Foam::fieldMinMax::calcMinMaxFields
|
||||
}
|
||||
case mdCmpt:
|
||||
{
|
||||
List<Type> minVs(Pstream::nProcs());
|
||||
labelList minIs(Pstream::nProcs());
|
||||
List<vector> minCs(Pstream::nProcs());
|
||||
minIs[procI] = findMin(field);
|
||||
minVs[procI] = field[minIs[procI]];
|
||||
minCs[procI] = field.mesh().C()[minIs[procI]];
|
||||
const typename fieldType::GeometricBoundaryField&
|
||||
fieldBoundary = field.boundaryField();
|
||||
|
||||
List<Type> minVs(Pstream::nProcs());
|
||||
List<vector> minCs(Pstream::nProcs());
|
||||
label minProcI = findMin(field);
|
||||
minVs[procI] = field[minProcI];
|
||||
minCs[procI] = field.mesh().C()[minProcI];
|
||||
|
||||
Pstream::gatherList(minIs);
|
||||
Pstream::gatherList(minVs);
|
||||
Pstream::gatherList(minCs);
|
||||
|
||||
List<Type> maxVs(Pstream::nProcs());
|
||||
labelList maxIs(Pstream::nProcs());
|
||||
List<vector> maxCs(Pstream::nProcs());
|
||||
maxIs[procI] = findMax(field);
|
||||
maxVs[procI] = field[maxIs[procI]];
|
||||
maxCs[procI] = field.mesh().C()[maxIs[procI]];
|
||||
label maxProcI = findMax(field);
|
||||
maxVs[procI] = field[maxProcI];
|
||||
maxCs[procI] = field.mesh().C()[maxProcI];
|
||||
|
||||
forAll(fieldBoundary, patchI)
|
||||
{
|
||||
const Field<Type>& fp = fieldBoundary[patchI];
|
||||
const vectorField& Cfp = CfBoundary[patchI];
|
||||
|
||||
label minPI = findMin(fp);
|
||||
if (fp[minPI] < minVs[procI])
|
||||
{
|
||||
minVs[procI] = fp[minPI];
|
||||
minCs[procI] = Cfp[minPI];
|
||||
}
|
||||
|
||||
label maxPI = findMax(fp);
|
||||
if (fp[maxPI] > maxVs[procI])
|
||||
{
|
||||
maxVs[procI] = fp[maxPI];
|
||||
maxCs[procI] = Cfp[maxPI];
|
||||
}
|
||||
}
|
||||
|
||||
Pstream::gatherList(minVs);
|
||||
Pstream::gatherList(minCs);
|
||||
|
||||
Pstream::gatherList(maxIs);
|
||||
Pstream::gatherList(maxVs);
|
||||
Pstream::gatherList(maxCs);
|
||||
|
||||
|
||||
@ -113,9 +113,15 @@ void Foam::energyJumpFvPatchScalarField::updateCoeffs()
|
||||
thermo.T().boundaryField()[patchID]
|
||||
);
|
||||
|
||||
fixedJumpFvPatchScalarField& Tbp =
|
||||
const_cast<fixedJumpFvPatchScalarField&>(TbPatch);
|
||||
|
||||
// force update of jump
|
||||
Tbp.updateCoeffs();
|
||||
|
||||
const labelUList& faceCells = this->patch().faceCells();
|
||||
|
||||
jump_ = thermo.he(pp, TbPatch.jump(), faceCells);
|
||||
jump_ = thermo.he(pp, Tbp.jump(), faceCells);
|
||||
}
|
||||
|
||||
fixedJumpFvPatchField<scalar>::updateCoeffs();
|
||||
|
||||
@ -113,9 +113,15 @@ void Foam::energyJumpAMIFvPatchScalarField::updateCoeffs()
|
||||
thermo.T().boundaryField()[patchID]
|
||||
);
|
||||
|
||||
fixedJumpAMIFvPatchScalarField& Tbp =
|
||||
const_cast<fixedJumpAMIFvPatchScalarField&>(TbPatch);
|
||||
|
||||
// force update of jump
|
||||
Tbp.updateCoeffs();
|
||||
|
||||
const labelUList& faceCells = this->patch().faceCells();
|
||||
|
||||
jump_ = thermo.he(pp, TbPatch.jump(), faceCells);
|
||||
jump_ = thermo.he(pp, Tbp.jump(), faceCells);
|
||||
}
|
||||
|
||||
fixedJumpAMIFvPatchField<scalar>::updateCoeffs();
|
||||
|
||||
@ -12,11 +12,11 @@ runApplication surfaceClean \
|
||||
constant/triSurface/coneAndSphere_clean.obj
|
||||
mv log.surfaceClean log.surfaceClean.coneAndSphere
|
||||
# Orient so point to be meshed is inside surface
|
||||
surfaceOrient \
|
||||
runApplication surfaceOrient \
|
||||
constant/triSurface/coneAndSphere_clean.obj \
|
||||
-inside '(0 -0.5 0)' \
|
||||
constant/triSurface/coneAndSphere_clean_orient.obj \
|
||||
> log.surfaceOrient.coneAndSphere 2>&1
|
||||
constant/triSurface/coneAndSphere_clean_orient.obj
|
||||
mv log.surfaceOrient log.surfaceOrient.coneAndSphere
|
||||
|
||||
# Same for outside
|
||||
runApplication surfaceClean \
|
||||
@ -24,11 +24,11 @@ runApplication surfaceClean \
|
||||
1e-4 1e-6 \
|
||||
constant/triSurface/domain_clean.stl
|
||||
mv log.surfaceClean log.surfaceClean.domain
|
||||
surfaceOrient \
|
||||
runApplication surfaceOrient \
|
||||
constant/triSurface/domain_clean.stl \
|
||||
-inside '(0 -0.5 0)' \
|
||||
constant/triSurface/domain_clean_orient.stl
|
||||
> log.surfaceOrient.domain 2>&1
|
||||
mv log.surfaceOrient log.surfaceOrient.domain
|
||||
|
||||
runApplication surfaceFeatureExtract
|
||||
mv log.surfaceFeatureExtract log.surfaceFeatureExtract.coneAndSphere_clean
|
||||
|
||||
Reference in New Issue
Block a user