Merge branch 'master' of /home/dm4/OpenFOAM/OpenFOAM-dev

This commit is contained in:
andy
2013-06-20 11:30:40 +01:00
62 changed files with 869 additions and 581 deletions

View File

@ -1,8 +0,0 @@
FieldField<fvsPatchField, scalar>& phibf = phi.boundaryField();
const FieldField<fvPatchField, vector>& Ubf = U.boundaryField();
const FieldField<fvsPatchField, vector>& Sfbf = mesh.Sf().boundaryField();
forAll(phibf, patchI)
{
phibf[patchI] = (Ubf[patchI] & Sfbf[patchI]);
}

View File

@ -1,5 +1,3 @@
#include "resetPhiPatches.H"
volScalarField rAU(1.0/UEqn().A()); volScalarField rAU(1.0/UEqn().A());
surfaceScalarField rAUf("Dp", fvc::interpolate(rAU)); surfaceScalarField rAUf("Dp", fvc::interpolate(rAU));
@ -22,6 +20,9 @@ adjustPhi(phiHbyA, U, p_gh);
fvOptions.relativeFlux(phiHbyA); fvOptions.relativeFlux(phiHbyA);
// Update the phi BCs from U before p BCs are updated
phi.boundaryField() = mesh.Sf().boundaryField() & U.boundaryField();
// Non-orthogonal pressure corrector loop // Non-orthogonal pressure corrector loop
while (pimple.correctNonOrthogonal()) while (pimple.correctNonOrthogonal())
{ {

View File

@ -1783,7 +1783,7 @@ int main(int argc, char *argv[])
{ {
extrudeMeshShadowFaces[nShadowFaces] = fz[j]; extrudeMeshShadowFaces[nShadowFaces] = fz[j];
zoneShadowFlipMap[nShadowFaces] = fz.flipMap()[j]; zoneShadowFlipMap[nShadowFaces] = fz.flipMap()[j];
zoneShadowID[nShadowFaces] = zoneShadowIDs[i]; zoneShadowID[nShadowFaces] = i;
nShadowFaces++; nShadowFaces++;
} }
} }

View File

@ -111,6 +111,8 @@ int main(int argc, char *argv[])
conformalVoronoiMesh::debug = true; conformalVoronoiMesh::debug = true;
Info<< "Create mesh for time = " << runTime.timeName() << nl << endl;
conformalVoronoiMesh mesh(runTime, foamyHexMeshDict); conformalVoronoiMesh mesh(runTime, foamyHexMeshDict);

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -79,6 +79,9 @@ public:
class const_iterator; class const_iterator;
friend class const_iterator; friend class const_iterator;
class const_reverse_iterator;
friend class const_reverse_iterator;
// Constructors // Constructors
@ -254,6 +257,48 @@ public:
}; };
// STL const_reverse_iterator
typedef typename LListBase::const_reverse_iterator
LListBase_const_reverse_iterator;
//- An STL-conforming const_reverse_iterator
class const_reverse_iterator
:
public LListBase_const_reverse_iterator
{
public:
//- Construct from base const_reverse_iterator
const_reverse_iterator(LListBase_const_reverse_iterator baseIter)
:
LListBase_const_reverse_iterator(baseIter)
{}
// Member operators
const T& operator*()
{
return
static_cast<const T&>
(LListBase_const_reverse_iterator::operator*());
}
const T& operator()()
{
return operator*();
}
const_reverse_iterator& operator++()
{
LListBase_const_reverse_iterator::operator++();
return *this;
}
};
// STL member operators // STL member operators
//- Equality operation on ULists of the same type. //- Equality operation on ULists of the same type.

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -42,6 +42,12 @@ Foam::DLListBase::const_iterator Foam::DLListBase::endConstIter_
reinterpret_cast<const link*>(0) reinterpret_cast<const link*>(0)
); );
Foam::DLListBase::const_reverse_iterator Foam::DLListBase::endConstRevIter_
(
static_cast<const DLListBase&>(DLListBase()),
reinterpret_cast<const link*>(0)
);
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -100,6 +100,9 @@ public:
class const_iterator; class const_iterator;
friend class const_iterator; friend class const_iterator;
class const_reverse_iterator;
friend class const_reverse_iterator;
// Constructors // Constructors
@ -260,6 +263,43 @@ public:
inline const_iterator begin() const; inline const_iterator begin() const;
inline const const_iterator& end() const; inline const const_iterator& end() const;
// STL const_reverse_iterator
//- An STL-conforming const_reverse_iterator
class const_reverse_iterator
{
// Private data
//- Reference to the list this is an reverse_iterator for
const DLListBase& curList_;
//- Current element
const link* curElmt_;
public:
//- Construct for a given DLListBase and link
inline const_reverse_iterator(const DLListBase&, const link*);
// Member operators
inline void operator=(const const_reverse_iterator&);
inline bool operator==(const const_reverse_iterator&) const;
inline bool operator!=(const const_reverse_iterator&) const;
inline const link& operator*();
inline const_reverse_iterator& operator++();
inline const_reverse_iterator operator++(int);
};
inline const_reverse_iterator crbegin() const;
inline const const_reverse_iterator& crend() const;
inline const_reverse_iterator rbegin() const;
inline const const_reverse_iterator& rend() const;
private: private:
//- iterator returned by end() //- iterator returned by end()
@ -268,6 +308,9 @@ private:
//- const_iterator returned by end() //- const_iterator returned by end()
static const_iterator endConstIter_; static const_iterator endConstIter_;
//- const_reverse_iterator returned by end()
static const_reverse_iterator endConstRevIter_;
}; };

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -383,4 +383,111 @@ Foam::DLListBase::end() const
} }
// * * * * * * * * * * STL const_reverse_iterator * * * * * * * * * * * * * //
inline Foam::DLListBase::const_reverse_iterator::const_reverse_iterator
(
const DLListBase& s,
const link* elmt
)
:
curList_(s),
curElmt_(elmt)
{}
inline void Foam::DLListBase::const_reverse_iterator::operator=
(
const const_reverse_iterator& iter
)
{
curElmt_ = iter.curElmt_;
}
inline bool Foam::DLListBase::const_reverse_iterator::operator==
(
const const_reverse_iterator& iter
) const
{
return curElmt_ == iter.curElmt_;
}
inline bool Foam::DLListBase::const_reverse_iterator::operator!=
(
const const_reverse_iterator& iter
) const
{
return curElmt_ != iter.curElmt_;
}
inline const Foam::DLListBase::link&
Foam::DLListBase::const_reverse_iterator::operator*()
{
return *curElmt_;
}
inline Foam::DLListBase::const_reverse_iterator&
Foam::DLListBase::const_reverse_iterator::operator++()
{
if (curElmt_ == curList_.first_)
{
curElmt_ = 0;
}
else
{
curElmt_ = curElmt_->prev_;
}
return *this;
}
inline Foam::DLListBase::const_reverse_iterator
Foam::DLListBase::const_reverse_iterator::operator++(int)
{
const_reverse_iterator tmp = *this;
++*this;
return tmp;
}
inline Foam::DLListBase::const_reverse_iterator
Foam::DLListBase::crbegin() const
{
if (size())
{
return const_reverse_iterator(*this, last());
}
else
{
return endConstRevIter_;
}
}
inline const Foam::DLListBase::const_reverse_iterator&
Foam::DLListBase::crend() const
{
return endConstRevIter_;
}
inline Foam::DLListBase::const_reverse_iterator
Foam::DLListBase::rbegin() const
{
return this->crbegin();
}
inline const Foam::DLListBase::const_reverse_iterator&
Foam::DLListBase::rend() const
{
return endConstRevIter_;
}
// ************************************************************************* // // ************************************************************************* //

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -628,197 +628,245 @@ BINARY_TYPE_OPERATOR_FS(Type, Type, scalar, /, divide)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define PRODUCT_OPERATOR(product, op, opFunc) \ #define PRODUCT_OPERATOR(product, op, opFunc) \
\ \
template<template<class> class Field, class Type1, class Type2> \ template \
void opFunc \ < \
( \ template<class> class Field1, \
FieldField<Field, typename product<Type1, Type2>::type>& f, \ template<class> class Field2, \
const FieldField<Field, Type1>& f1, \ class Type1, \
const FieldField<Field, Type2>& f2 \ class Type2 \
) \ > \
{ \ void opFunc \
forAll(f, i) \ ( \
{ \ FieldField<Field1, typename product<Type1, Type2>::type>& f, \
opFunc(f[i], f1[i], f2[i]); \ const FieldField<Field1, Type1>& f1, \
} \ const FieldField<Field2, Type2>& f2 \
} \ ) \
\ { \
template<template<class> class Field, class Type1, class Type2> \ forAll(f, i) \
tmp<FieldField<Field, typename product<Type1, Type2>::type> > \ { \
operator op \ opFunc(f[i], f1[i], f2[i]); \
( \ } \
const FieldField<Field, Type1>& f1, \ } \
const FieldField<Field, Type2>& f2 \ \
) \ template \
{ \ < \
typedef typename product<Type1, Type2>::type productType; \ template<class> class Field1, \
tmp<FieldField<Field, productType> > tRes \ template<class> class Field2, \
( \ class Type1, \
FieldField<Field, productType>::NewCalculatedType(f1) \ class Type2 \
); \ > \
opFunc(tRes(), f1, f2); \ tmp<FieldField<Field1, typename product<Type1, Type2>::type> > \
return tRes; \ operator op \
} \ ( \
\ const FieldField<Field1, Type1>& f1, \
template<template<class> class Field, class Type1, class Type2> \ const FieldField<Field2, Type2>& f2 \
tmp<FieldField<Field, typename product<Type1, Type2>::type> > \ ) \
operator op \ { \
( \ typedef typename product<Type1, Type2>::type productType; \
const FieldField<Field, Type1>& f1, \ tmp<FieldField<Field1, productType> > tRes \
const tmp<FieldField<Field, Type2> >& tf2 \ ( \
) \ FieldField<Field1, productType>::NewCalculatedType(f1) \
{ \ ); \
typedef typename product<Type1, Type2>::type productType; \ opFunc(tRes(), f1, f2); \
tmp<FieldField<Field, productType> > tRes \ return tRes; \
( \ } \
reuseTmpFieldField<Field, productType, Type2>::New(tf2) \ \
); \ template<template<class> class Field, class Type1, class Type2> \
opFunc(tRes(), f1, tf2()); \ tmp<FieldField<Field, typename product<Type1, Type2>::type> > \
reuseTmpFieldField<Field, productType, Type2>::clear(tf2); \ operator op \
return tRes; \ ( \
} \ const FieldField<Field, Type1>& f1, \
\ const tmp<FieldField<Field, Type2> >& tf2 \
template<template<class> class Field, class Type1, class Type2> \ ) \
tmp<FieldField<Field, typename product<Type1, Type2>::type> > \ { \
operator op \ typedef typename product<Type1, Type2>::type productType; \
( \ tmp<FieldField<Field, productType> > tRes \
const tmp<FieldField<Field, Type1> >& tf1, \ ( \
const FieldField<Field, Type2>& f2 \ reuseTmpFieldField<Field, productType, Type2>::New(tf2) \
) \ ); \
{ \ opFunc(tRes(), f1, tf2()); \
typedef typename product<Type1, Type2>::type productType; \ reuseTmpFieldField<Field, productType, Type2>::clear(tf2); \
tmp<FieldField<Field, productType> > tRes \ return tRes; \
( \ } \
reuseTmpFieldField<Field, productType, Type1>::New(tf1) \ \
); \ template \
opFunc(tRes(), tf1(), f2); \ < \
reuseTmpFieldField<Field, productType, Type1>::clear(tf1); \ template<class> class Field1, \
return tRes; \ template<class> class Field2, \
} \ class Type1, \
\ class Type2 \
template<template<class> class Field, class Type1, class Type2> \ > \
tmp<FieldField<Field, typename product<Type1, Type2>::type> > \ tmp<FieldField<Field, typename product<Type1, Type2>::type> > \
operator op \ operator op \
( \ ( \
const tmp<FieldField<Field, Type1> >& tf1, \ const FieldField<Field1, Type1>& f1, \
const tmp<FieldField<Field, Type2> >& tf2 \ const tmp<FieldField<Field2, Type2> >& tf2 \
) \ ) \
{ \ { \
typedef typename product<Type1, Type2>::type productType; \ typedef typename product<Type1, Type2>::type productType; \
tmp<FieldField<Field, productType> > tRes \ tmp<FieldField<Field1, productType> > tRes \
( \ ( \
reuseTmpTmpFieldField<Field, productType, Type1, Type1, Type2>::New \ FieldField<Field1, productType>::NewCalculatedType(f1) \
(tf1, tf2) \ ); \
); \ opFunc(tRes(), f1, tf2()); \
opFunc(tRes(), tf1(), tf2()); \ tf2.clear(); \
reuseTmpTmpFieldField<Field, productType, Type1, Type1, Type2>::clear \ return tRes; \
(tf1, tf2); \ } \
return tRes; \ \
} \ template \
\ < \
template \ template<class> class Field1, \
<template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \ template<class> class Field2, \
void opFunc \ class Type1, \
( \ class Type2 \
FieldField<Field, typename product<Type, Form>::type>& f, \ > \
const FieldField<Field, Type>& f1, \ tmp<FieldField<Field1, typename product<Type1, Type2>::type> > \
const VectorSpace<Form,Cmpt,nCmpt>& vs \ operator op \
) \ ( \
{ \ const tmp<FieldField<Field1, Type1> >& tf1, \
forAll(f, i) \ const FieldField<Field2, Type2>& f2 \
{ \ ) \
opFunc(f[i], f1[i], vs); \ { \
} \ typedef typename product<Type1, Type2>::type productType; \
} \ tmp<FieldField<Field1, productType> > tRes \
\ ( \
template \ reuseTmpFieldField<Field1, productType, Type1>::New(tf1) \
<template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \ ); \
tmp<FieldField<Field, typename product<Type, Form>::type> > \ opFunc(tRes(), tf1(), f2); \
operator op \ reuseTmpFieldField<Field1, productType, Type1>::clear(tf1); \
( \ return tRes; \
const FieldField<Field, Type>& f1, \ } \
const VectorSpace<Form,Cmpt,nCmpt>& vs \ \
) \ template \
{ \ < \
typedef typename product<Type, Form>::type productType; \ template<class> class Field1, \
tmp<FieldField<Field, productType> > tRes \ template<class> class Field2, \
( \ class Type1, \
FieldField<Field, productType>::NewCalculatedType(f1) \ class Type2 \
); \ > \
opFunc(tRes(), f1, static_cast<const Form&>(vs)); \ tmp<FieldField<Field1, typename product<Type1, Type2>::type> > \
return tRes; \ operator op \
} \ ( \
\ const tmp<FieldField<Field1, Type1> >& tf1, \
template \ const tmp<FieldField<Field2, Type2> >& tf2 \
<template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \ ) \
tmp<FieldField<Field, typename product<Type, Form>::type> > \ { \
operator op \ typedef typename product<Type1, Type2>::type productType; \
( \ tmp<FieldField<Field1, productType> > tRes \
const tmp<FieldField<Field, Type> >& tf1, \ ( \
const VectorSpace<Form,Cmpt,nCmpt>& vs \ reuseTmpTmpFieldField<Field1, productType, Type1, Type1, Type2>::New \
) \ (tf1, tf2) \
{ \ ); \
typedef typename product<Type, Form>::type productType; \ opFunc(tRes(), tf1(), tf2()); \
tmp<FieldField<Field, productType> > tRes \ reuseTmpTmpFieldField<Field1, productType, Type1, Type1, Type2>::clear \
( \ (tf1, tf2); \
reuseTmpFieldField<Field, productType, Type>::New(tf1) \ return tRes; \
); \ } \
opFunc(tRes(), tf1(), static_cast<const Form&>(vs)); \ \
reuseTmpFieldField<Field, productType, Type>::clear(tf1); \ template \
return tRes; \ <template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \
} \ void opFunc \
\ ( \
template \ FieldField<Field, typename product<Type, Form>::type>& f, \
<template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \ const FieldField<Field, Type>& f1, \
void opFunc \ const VectorSpace<Form,Cmpt,nCmpt>& vs \
( \ ) \
FieldField<Field, typename product<Form, Type>::type>& f, \ { \
const VectorSpace<Form,Cmpt,nCmpt>& vs, \ forAll(f, i) \
const FieldField<Field, Type>& f1 \ { \
) \ opFunc(f[i], f1[i], vs); \
{ \ } \
forAll(f, i) \ } \
{ \ \
opFunc(f[i], vs, f1[i]); \ template \
} \ <template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \
} \ tmp<FieldField<Field, typename product<Type, Form>::type> > \
\ operator op \
template \ ( \
<template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \ const FieldField<Field, Type>& f1, \
tmp<FieldField<Field, typename product<Form, Type>::type> > \ const VectorSpace<Form,Cmpt,nCmpt>& vs \
operator op \ ) \
( \ { \
const VectorSpace<Form,Cmpt,nCmpt>& vs, \ typedef typename product<Type, Form>::type productType; \
const FieldField<Field, Type>& f1 \ tmp<FieldField<Field, productType> > tRes \
) \ ( \
{ \ FieldField<Field, productType>::NewCalculatedType(f1) \
typedef typename product<Form, Type>::type productType; \ ); \
tmp<FieldField<Field, productType> > tRes \ opFunc(tRes(), f1, static_cast<const Form&>(vs)); \
( \ return tRes; \
FieldField<Field, productType>::NewCalculatedType(f1) \ } \
); \ \
opFunc(tRes(), static_cast<const Form&>(vs), f1); \ template \
return tRes; \ <template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \
} \ tmp<FieldField<Field, typename product<Type, Form>::type> > \
\ operator op \
template \ ( \
<template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \ const tmp<FieldField<Field, Type> >& tf1, \
tmp<FieldField<Field, typename product<Form, Type>::type> > \ const VectorSpace<Form,Cmpt,nCmpt>& vs \
operator op \ ) \
( \ { \
const VectorSpace<Form,Cmpt,nCmpt>& vs, \ typedef typename product<Type, Form>::type productType; \
const tmp<FieldField<Field, Type> >& tf1 \ tmp<FieldField<Field, productType> > tRes \
) \ ( \
{ \ reuseTmpFieldField<Field, productType, Type>::New(tf1) \
typedef typename product<Form, Type>::type productType; \ ); \
tmp<FieldField<Field, productType> > tRes \ opFunc(tRes(), tf1(), static_cast<const Form&>(vs)); \
( \ reuseTmpFieldField<Field, productType, Type>::clear(tf1); \
reuseTmpFieldField<Field, productType, Type>::New(tf1) \ return tRes; \
); \ } \
opFunc(tRes(), static_cast<const Form&>(vs), tf1()); \ \
reuseTmpFieldField<Field, productType, Type>::clear(tf1); \ template \
return tRes; \ <template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \
void opFunc \
( \
FieldField<Field, typename product<Form, Type>::type>& f, \
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
const FieldField<Field, Type>& f1 \
) \
{ \
forAll(f, i) \
{ \
opFunc(f[i], vs, f1[i]); \
} \
} \
\
template \
<template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \
tmp<FieldField<Field, typename product<Form, Type>::type> > \
operator op \
( \
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
const FieldField<Field, Type>& f1 \
) \
{ \
typedef typename product<Form, Type>::type productType; \
tmp<FieldField<Field, productType> > tRes \
( \
FieldField<Field, productType>::NewCalculatedType(f1) \
); \
opFunc(tRes(), static_cast<const Form&>(vs), f1); \
return tRes; \
} \
\
template \
<template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \
tmp<FieldField<Field, typename product<Form, Type>::type> > \
operator op \
( \
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
const tmp<FieldField<Field, Type> >& tf1 \
) \
{ \
typedef typename product<Form, Type>::type productType; \
tmp<FieldField<Field, productType> > tRes \
( \
reuseTmpFieldField<Field, productType, Type>::New(tf1) \
); \
opFunc(tRes(), static_cast<const Form&>(vs), tf1()); \
reuseTmpFieldField<Field, productType, Type>::clear(tf1); \
return tRes; \
} }
PRODUCT_OPERATOR(typeOfSum, +, add) PRODUCT_OPERATOR(typeOfSum, +, add)

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -267,100 +267,138 @@ BINARY_TYPE_OPERATOR_FS(Type, Type, scalar, /, divide)
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define PRODUCT_OPERATOR(product, op, opFunc) \ #define PRODUCT_OPERATOR(product, op, opFunc) \
\ \
template<template<class> class Field, class Type1, class Type2> \ template \
void opFunc \ < \
( \ template<class> class Field1, \
FieldField<Field, typename product<Type1, Type2>::type>& f, \ template<class> class Field2, \
const FieldField<Field, Type1>& f1, \ class Type1, \
const FieldField<Field, Type2>& f2 \ class Type2 \
); \ > \
\ void opFunc \
template<template<class> class Field, class Type1, class Type2> \ ( \
tmp<FieldField<Field, typename product<Type1, Type2>::type> > \ FieldField<Field1, typename product<Type1, Type2>::type>& f, \
operator op \ const FieldField<Field1, Type1>& f1, \
( \ const FieldField<Field2, Type2>& f2 \
const FieldField<Field, Type1>& f1, \ ); \
const FieldField<Field, Type2>& f2 \ \
); \ template \
\ < \
template<template<class> class Field, class Type1, class Type2> \ template<class> class Field1, \
tmp<FieldField<Field, typename product<Type1, Type2>::type> > \ template<class> class Field2, \
operator op \ class Type1, \
( \ class Type2 \
const FieldField<Field, Type1>& f1, \ > \
const tmp<FieldField<Field, Type2> >& tf2 \ tmp<FieldField<Field1, typename product<Type1, Type2>::type> > \
); \ operator op \
\ ( \
template<template<class> class Field, class Type1, class Type2> \ const FieldField<Field1, Type1>& f1, \
tmp<FieldField<Field, typename product<Type1, Type2>::type> > \ const FieldField<Field2, Type2>& f2 \
operator op \ ); \
( \ \
const tmp<FieldField<Field, Type1> >& tf1, \ template<template<class> class Field, class Type1, class Type2> \
const FieldField<Field, Type2>& f2 \ tmp<FieldField<Field, typename product<Type1, Type2>::type> > \
); \ operator op \
\ ( \
template<template<class> class Field, class Type1, class Type2> \ const FieldField<Field, Type1>& f1, \
tmp<FieldField<Field, typename product<Type1, Type2>::type> > \ const tmp<FieldField<Field, Type2> >& tf2 \
operator op \ ); \
( \ \
const tmp<FieldField<Field, Type1> >& tf1, \ template \
const tmp<FieldField<Field, Type2> >& tf2 \ < \
); \ template<class> class Field1, \
\ template<class> class Field2, \
template \ class Type1, \
<template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \ class Type2 \
void opFunc \ > \
( \ tmp<FieldField<Field1, typename product<Type1, Type2>::type> > \
FieldField<Field, typename product<Type, Form>::type>& f, \ operator op \
const FieldField<Field, Type>& f1, \ ( \
const VectorSpace<Form,Cmpt,nCmpt>& vs \ const FieldField<Field1, Type1>& f1, \
); \ const tmp<FieldField<Field2, Type2> >& tf2 \
\ ); \
template \ \
<template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \ template \
tmp<FieldField<Field, typename product<Type, Form>::type> > \ < \
operator op \ template<class> class Field1, \
( \ template<class> class Field2, \
const FieldField<Field, Type>& f1, \ class Type1, \
const VectorSpace<Form,Cmpt,nCmpt>& vs \ class Type2 \
); \ > \
\ tmp<FieldField<Field1, typename product<Type1, Type2>::type> > \
template \ operator op \
<template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \ ( \
tmp<FieldField<Field, typename product<Type, Form>::type> > \ const tmp<FieldField<Field1, Type1> >& tf1, \
operator op \ const FieldField<Field2, Type2>& f2 \
( \ ); \
const tmp<FieldField<Field, Type> >& tf1, \ \
const VectorSpace<Form,Cmpt,nCmpt>& vs \ template \
); \ < \
\ template<class> class Field1, \
template \ template<class> class Field2, \
<template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \ class Type1, \
void opFunc \ class Type2 \
( \ > \
FieldField<Field, typename product<Form, Type>::type>& f, \ tmp<FieldField<Field1, typename product<Type1, Type2>::type> > \
const VectorSpace<Form,Cmpt,nCmpt>& vs, \ operator op \
const FieldField<Field, Type>& f1 \ ( \
); \ const tmp<FieldField<Field1, Type1> >& tf1, \
\ const tmp<FieldField<Field2, Type2> >& tf2 \
template \ ); \
<template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \ \
tmp<FieldField<Field, typename product<Form, Type>::type> > \ template \
operator op \ <template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \
( \ void opFunc \
const VectorSpace<Form,Cmpt,nCmpt>& vs, \ ( \
const FieldField<Field, Type>& f1 \ FieldField<Field, typename product<Type, Form>::type>& f, \
); \ const FieldField<Field, Type>& f1, \
\ const VectorSpace<Form,Cmpt,nCmpt>& vs \
template \ ); \
<template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \ \
tmp<FieldField<Field, typename product<Form, Type>::type> > \ template \
operator op \ <template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \
( \ tmp<FieldField<Field, typename product<Type, Form>::type> > \
const VectorSpace<Form,Cmpt,nCmpt>& vs, \ operator op \
const tmp<FieldField<Field, Type> >& tf1 \ ( \
const FieldField<Field, Type>& f1, \
const VectorSpace<Form,Cmpt,nCmpt>& vs \
); \
\
template \
<template<class> class Field, class Type, class Form, class Cmpt, int nCmpt> \
tmp<FieldField<Field, typename product<Type, Form>::type> > \
operator op \
( \
const tmp<FieldField<Field, Type> >& tf1, \
const VectorSpace<Form,Cmpt,nCmpt>& vs \
); \
\
template \
<template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \
void opFunc \
( \
FieldField<Field, typename product<Form, Type>::type>& f, \
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
const FieldField<Field, Type>& f1 \
); \
\
template \
<template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \
tmp<FieldField<Field, typename product<Form, Type>::type> > \
operator op \
( \
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
const FieldField<Field, Type>& f1 \
); \
\
template \
<template<class> class Field, class Form, class Cmpt, int nCmpt, class Type> \
tmp<FieldField<Field, typename product<Form, Type>::type> > \
operator op \
( \
const VectorSpace<Form,Cmpt,nCmpt>& vs, \
const tmp<FieldField<Field, Type> >& tf1 \
); );
PRODUCT_OPERATOR(typeOfSum, +, add) PRODUCT_OPERATOR(typeOfSum, +, add)

View File

@ -50,7 +50,8 @@ readField
} }
// 1. Handle explicit patch names // 1. Handle explicit patch names. Note that there can be only one explicit
// patch name since is key of dictionary.
forAllConstIter(dictionary, dict, iter) forAllConstIter(dictionary, dict, iter)
{ {
if (iter().isDict() && !iter().keyword().isPattern()) if (iter().isDict() && !iter().keyword().isPattern())
@ -76,33 +77,45 @@ readField
// 2. Patch-groups. (using non-wild card entries of dictionaries) // 2. Patch-groups. (using non-wild card entries of dictionaries)
// (patchnames already matched above) // (patchnames already matched above)
// Note: in order of entries in the dictionary (first patchGroups wins) // Note: in reverse order of entries in the dictionary (last
forAllConstIter(dictionary, dict, iter) // patchGroups wins). This is so is consistent with dictionary wildcard
// behaviour
if (dict.size())
{ {
if (iter().isDict() && !iter().keyword().isPattern()) for
(
IDLList<entry>::const_reverse_iterator iter = dict.rbegin();
iter != dict.rend();
++iter
)
{ {
const labelList patchIDs = bmesh_.findIndices const entry& e = iter();
(
iter().keyword(),
true // use patchGroups
);
forAll(patchIDs, i) if (e.isDict() && !e.keyword().isPattern())
{ {
label patchi = patchIDs[i]; const labelList patchIDs = bmesh_.findIndices
(
e.keyword(),
true // use patchGroups
);
if (!this->set(patchi)) forAll(patchIDs, i)
{ {
this->set label patchi = patchIDs[i];
(
patchi, if (!this->set(patchi))
PatchField<Type>::New {
this->set
( (
bmesh_[patchi], patchi,
field, PatchField<Type>::New
iter().dict() (
) bmesh_[patchi],
); field,
e.dict()
)
);
}
} }
} }
} }

View File

@ -90,10 +90,6 @@ void Foam::GAMGSolver::interpolate
{ {
corrC[restrictAddressing[celli]] += diagPtr[celli]*psiPtr[celli]; corrC[restrictAddressing[celli]] += diagPtr[celli]*psiPtr[celli];
diagC[restrictAddressing[celli]] += diagPtr[celli]; diagC[restrictAddressing[celli]] += diagPtr[celli];
//corrC[restrictAddressing[celli]] += psiPtr[celli]/diagPtr[celli];
//diagC[restrictAddressing[celli]] += 1.0/diagPtr[celli];
//corrC[restrictAddressing[celli]] += psiPtr[celli];
//diagC[restrictAddressing[celli]] += 1.0;
} }
for (register label ccelli=0; ccelli<nCCells; ccelli++) for (register label ccelli=0; ccelli<nCCells; ccelli++)

View File

@ -313,7 +313,7 @@ void Foam::GAMGSolver::Vcycle
scalarField& ACfRef = scalarField& ACfRef =
const_cast<scalarField&>(ACf.operator const scalarField&()); const_cast<scalarField&>(ACf.operator const scalarField&());
if (interpolateCorrection_ && leveli < coarsestLevel - 2) if (interpolateCorrection_) //&& leveli < coarsestLevel - 2)
{ {
interpolate interpolate
( (

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -98,16 +98,6 @@ public:
//- Destructor //- Destructor
virtual ~coupledPointPatch(); virtual ~coupledPointPatch();
// Member Functions
// Access
//- Return true because this patch is coupled
virtual bool coupled() const
{
return true;
}
}; };

View File

@ -115,19 +115,6 @@ public:
// Member functions // Member functions
//- Return true if running parallel
virtual bool coupled() const
{
if (Pstream::parRun())
{
return true;
}
else
{
return false;
}
}
//- Return message tag to use for communication //- Return message tag to use for communication
virtual int tag() const virtual int tag() const
{ {

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -171,6 +171,12 @@ public:
return polyPatch_.index(); return polyPatch_.index();
} }
//- Return true if this patch field is coupled
virtual bool coupled() const
{
return polyPatch_.coupled();
}
//- Return mesh points //- Return mesh points
virtual const labelList& meshPoints() const virtual const labelList& meshPoints() const
{ {

View File

@ -38,7 +38,7 @@ makeCompactCellFaceAddressingAndFaceWeights
const lduAddressing& fineAddressing, const lduAddressing& fineAddressing,
List<idxtype>& cellCells, List<idxtype>& cellCells,
List<idxtype>& cellCellOffsets, List<idxtype>& cellCellOffsets,
const vectorField& Si, const scalarField& magSi,
List<scalar>& faceWeights List<scalar>& faceWeights
) )
{ {
@ -87,8 +87,8 @@ makeCompactCellFaceAddressingAndFaceWeights
cellCells[l1] = nei; cellCells[l1] = nei;
cellCells[l2] = own; cellCells[l2] = own;
faceWeights[l1] = mag(Si[facei]); faceWeights[l1] = magSi[facei];
faceWeights[l2] = mag(Si[facei]); faceWeights[l2] = magSi[facei];
} }
} }
@ -100,8 +100,8 @@ Foam::tmp<Foam::labelField> Foam::MGridGenGAMGAgglomeration::agglomerate
const label maxSize, const label maxSize,
const lduAddressing& fineAddressing, const lduAddressing& fineAddressing,
const scalarField& V, const scalarField& V,
const vectorField& Sf, const scalarField& magSf,
const scalarField& Sb const scalarField& magSb
) )
{ {
const label nFineCells = fineAddressing.size(); const label nFineCells = fineAddressing.size();
@ -119,15 +119,15 @@ Foam::tmp<Foam::labelField> Foam::MGridGenGAMGAgglomeration::agglomerate
fineAddressing, fineAddressing,
cellCells, cellCells,
cellCellOffsets, cellCellOffsets,
Sf, magSf,
faceWeights faceWeights
); );
// agglomeration options. // agglomeration options.
List<int> options(4, 0); List<int> options(4, 0);
options[0] = 4; // globular agglom options[0] = 4; // globular agglom
options[1] = 6; // objective F3 and F2 options[1] = 6; // objective F3 and F2
options[2] = 128; // debugging output level options[2] = 128; // debugging output level
options[3] = fvMesh_.nGeometricD(); // Dimensionality of the grid options[3] = fvMesh_.nGeometricD(); // Dimensionality of the grid
@ -140,7 +140,7 @@ Foam::tmp<Foam::labelField> Foam::MGridGenGAMGAgglomeration::agglomerate
nFineCells, nFineCells,
cellCellOffsets.begin(), cellCellOffsets.begin(),
const_cast<scalar*>(V.begin()), const_cast<scalar*>(V.begin()),
const_cast<scalar*>(Sb.begin()), const_cast<scalar*>(magSb.begin()),
cellCells.begin(), cellCells.begin(),
faceWeights.begin(), faceWeights.begin(),
minSize, minSize,
@ -157,8 +157,7 @@ Foam::tmp<Foam::labelField> Foam::MGridGenGAMGAgglomeration::agglomerate
bool ok = checkRestriction bool ok = checkRestriction
( (
newRestrictAddr, newRestrictAddr,
nNewCoarseCells nNewCoarseCells,
,
fineAddressing, fineAddressing,
finalAgglom, finalAgglom,
nCoarseCells nCoarseCells

View File

@ -25,6 +25,7 @@ License
#include "MGridGenGAMGAgglomeration.H" #include "MGridGenGAMGAgglomeration.H"
#include "fvMesh.H" #include "fvMesh.H"
#include "processorPolyPatch.H"
#include "addToRunTimeSelectionTable.H" #include "addToRunTimeSelectionTable.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * // // * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -60,20 +61,19 @@ Foam::MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration
// Start geometric agglomeration from the cell volumes and areas of the mesh // Start geometric agglomeration from the cell volumes and areas of the mesh
scalarField* VPtr = const_cast<scalarField*>(&fvMesh_.cellVolumes()); scalarField* VPtr = const_cast<scalarField*>(&fvMesh_.cellVolumes());
vectorField magFaceAreas(vector::one*mag(fvMesh_.faceAreas())); scalarField magFaceAreas(sqrt(3.0)*mag(fvMesh_.faceAreas()));
SubField<vector> Sf(magFaceAreas, fvMesh_.nInternalFaces()); SubField<scalar> magSf(magFaceAreas, fvMesh_.nInternalFaces());
//SubField<vector> Sf(fvMesh_.faceAreas(), fvMesh_.nInternalFaces());
vectorField* SfPtr = const_cast<vectorField*> scalarField* magSfPtr = const_cast<scalarField*>
( (
&Sf.operator const vectorField&() &magSf.operator const scalarField&()
); );
// Create the boundary area cell field // Create the boundary area cell field
scalarField* SbPtr(new scalarField(fvMesh_.nCells(), 0)); scalarField* magSbPtr(new scalarField(fvMesh_.nCells(), 0));
{ {
scalarField& Sb = *SbPtr; scalarField& magSb = *magSbPtr;
const labelList& own = fvMesh_.faceOwner(); const labelList& own = fvMesh_.faceOwner();
const vectorField& Sf = fvMesh_.faceAreas(); const vectorField& Sf = fvMesh_.faceAreas();
@ -82,11 +82,32 @@ Foam::MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration
{ {
if (!fvMesh_.isInternalFace(facei)) if (!fvMesh_.isInternalFace(facei))
{ {
Sb[own[facei]] += mag(Sf[facei]); magSb[own[facei]] += mag(Sf[facei]);
} }
} }
} }
/*
{
scalarField& magSb = *magSbPtr;
const polyBoundaryMesh& patches = fvMesh_.boundaryMesh();
forAll(patches, patchi)
{
const polyPatch& pp = patches[patchi];
if (!(Pstream::parRun() && isA<processorPolyPatch>(pp)))
{
const labelUList& faceCells = pp.faceCells();
const vectorField& pSf = pp.faceAreas();
forAll(faceCells, pfi)
{
magSb[faceCells[pfi]] += mag(pSf[pfi]);
}
}
}
}
*/
// Agglomerate until the required number of cells in the coarsest level // Agglomerate until the required number of cells in the coarsest level
// is reached // is reached
@ -104,8 +125,8 @@ Foam::MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration
maxSize, maxSize,
meshLevel(nCreatedLevels).lduAddr(), meshLevel(nCreatedLevels).lduAddr(),
*VPtr, *VPtr,
*SfPtr, *magSfPtr,
*SbPtr *magSbPtr
); );
if (continueAgglomerating(nCoarseCells)) if (continueAgglomerating(nCoarseCells))
@ -140,37 +161,37 @@ Foam::MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration
// Agglomerate the face areas field for the next level // Agglomerate the face areas field for the next level
{ {
vectorField* aggSfPtr scalarField* aggMagSfPtr
( (
new vectorField new scalarField
( (
meshLevels_[nCreatedLevels].upperAddr().size(), meshLevels_[nCreatedLevels].upperAddr().size(),
vector::zero 0
) )
); );
restrictFaceField(*aggSfPtr, *SfPtr, nCreatedLevels); restrictFaceField(*aggMagSfPtr, *magSfPtr, nCreatedLevels);
if (nCreatedLevels) if (nCreatedLevels)
{ {
delete SfPtr; delete magSfPtr;
} }
SfPtr = aggSfPtr; magSfPtr = aggMagSfPtr;
} }
// Agglomerate the cell boundary areas field for the next level // Agglomerate the cell boundary areas field for the next level
{ {
scalarField* aggSbPtr scalarField* aggMagSbPtr
( (
new scalarField(meshLevels_[nCreatedLevels].size()) new scalarField(meshLevels_[nCreatedLevels].size())
); );
// Restrict but no parallel agglomeration (not supported) // Restrict but no parallel agglomeration (not supported)
restrictField(*aggSbPtr, *SbPtr, nCreatedLevels, false); restrictField(*aggMagSbPtr, *magSbPtr, nCreatedLevels, false);
delete SbPtr; delete magSbPtr;
SbPtr = aggSbPtr; magSbPtr = aggMagSbPtr;
} }
nCreatedLevels++; nCreatedLevels++;
@ -183,9 +204,9 @@ Foam::MGridGenGAMGAgglomeration::MGridGenGAMGAgglomeration
if (nCreatedLevels) if (nCreatedLevels)
{ {
delete VPtr; delete VPtr;
delete SfPtr; delete magSfPtr;
} }
delete SbPtr; delete magSbPtr;
} }

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -73,7 +73,7 @@ class MGridGenGAMGAgglomeration
const lduAddressing& fineAddressing, const lduAddressing& fineAddressing,
List<idxtype>& cellCells, List<idxtype>& cellCells,
List<idxtype>& cellCellOffsets, List<idxtype>& cellCellOffsets,
const vectorField& Si, const scalarField& magSi,
List<scalar>& faceWeights List<scalar>& faceWeights
); );
@ -85,8 +85,8 @@ class MGridGenGAMGAgglomeration
const label maxSize, const label maxSize,
const lduAddressing& fineAddressing, const lduAddressing& fineAddressing,
const scalarField& V, const scalarField& V,
const vectorField& Sf, const scalarField& magSf,
const scalarField& Sb const scalarField& magSb
); );

View File

@ -2,7 +2,7 @@
========= | ========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | \\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation \\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation | \\/ M anipulation |
------------------------------------------------------------------------------- -------------------------------------------------------------------------------
License License
@ -72,7 +72,7 @@ void surfaceDisplacementPointPatchVectorField::calcProjection
const scalar projectLen = mag(mesh.bounds().max()-mesh.bounds().min()); const scalar projectLen = mag(mesh.bounds().max()-mesh.bounds().min());
// For case of fixed projection vector: // For case of fixed projection vector:
vector projectVec; vector projectVec(vector::zero);
if (projectMode_ == FIXEDNORMAL) if (projectMode_ == FIXEDNORMAL)
{ {
vector n = projectDir_/mag(projectDir_); vector n = projectDir_/mag(projectDir_);

View File

@ -2501,7 +2501,8 @@ void Foam::autoLayerDriver::addLayers
if (debug&meshRefinement::MESH) if (debug&meshRefinement::MESH)
{ {
const_cast<Time&>(mesh.time())++; const_cast<Time&>(mesh.time())++;
Info<< "Writing baffled mesh to " << meshRefiner_.timeName() << endl; Info<< "Writing baffled mesh to time "
<< meshRefiner_.timeName() << endl;
meshRefiner_.write meshRefiner_.write
( (
debug, debug,
@ -2923,7 +2924,8 @@ void Foam::autoLayerDriver::addLayers
); );
const_cast<Time&>(mesh.time())++; const_cast<Time&>(mesh.time())++;
Info<< "Writing shrunk mesh to " << meshRefiner_.timeName() << endl; Info<< "Writing shrunk mesh to time "
<< meshRefiner_.timeName() << endl;
// See comment in autoSnapDriver why we should not remove meshPhi // See comment in autoSnapDriver why we should not remove meshPhi
// using mesh.clearOut(). // using mesh.clearOut().
@ -3057,7 +3059,8 @@ void Foam::autoLayerDriver::addLayers
if (debug&meshRefinement::MESH) if (debug&meshRefinement::MESH)
{ {
Info<< "Writing layer mesh to " << meshRefiner_.timeName() << endl; Info<< "Writing layer mesh to time " << meshRefiner_.timeName()
<< endl;
newMesh.write(); newMesh.write();
cellSet addedCellSet cellSet addedCellSet
( (

View File

@ -958,13 +958,15 @@ Foam::labelList Foam::meshRefinement::markFacesOnProblemCells
// Because of isCollapsedFace one side can decide not to baffle whereas // Because of isCollapsedFace one side can decide not to baffle whereas
// the other side does so sync. Baffling is prefered over not baffling. // the other side does so sync. Baffling is prefered over not baffling.
syncTools::syncFaceList if (checkCollapse) // Or always?
( {
mesh_, syncTools::syncFaceList
facePatch, (
maxEqOp<label>() mesh_,
); facePatch,
maxEqOp<label>()
);
}
Info<< "markFacesOnProblemCells : marked " Info<< "markFacesOnProblemCells : marked "
<< returnReduce(nBaffleFaces, sumOp<label>()) << returnReduce(nBaffleFaces, sumOp<label>())

View File

@ -112,13 +112,6 @@ public:
// Member Functions // Member Functions
//- Is patch 'coupled'. Note that on AMI the geometry is not
// coupled but the fields are!
virtual bool coupled() const
{
return false;
}
//- Return the constraint type this pointPatch implements. //- Return the constraint type this pointPatch implements.
virtual const word& constraintType() const virtual const word& constraintType() const
{ {

View File

@ -41,7 +41,7 @@ boundaryField
value $internalField; value $internalField;
} }
"motorBike_.*" motorBikeGroup
{ {
type fixedValue; type fixedValue;
value uniform (0 0 0); value uniform (0 0 0);

View File

@ -41,7 +41,7 @@ boundaryField
value $internalField; value $internalField;
} }
"motorBike_.*" motorBikeGroup
{ {
type kqRWallFunction; type kqRWallFunction;
value $internalField; value $internalField;

View File

@ -54,7 +54,7 @@ boundaryField
value uniform 0; value uniform 0;
} }
"motorBike_.*" motorBikeGroup
{ {
type nutkWallFunction; type nutkWallFunction;
value uniform 0; value uniform 0;

View File

@ -40,7 +40,7 @@ boundaryField
value $internalField; value $internalField;
} }
"motorBike_.*" motorBikeGroup
{ {
type omegaWallFunction; type omegaWallFunction;
value $internalField; value $internalField;

View File

@ -41,7 +41,7 @@ boundaryField
type zeroGradient; type zeroGradient;
} }
"motorBike_.*" motorBikeGroup
{ {
type zeroGradient; type zeroGradient;
} }

View File

@ -3,8 +3,10 @@
# Source tutorial clean functions # Source tutorial clean functions
. $WM_PROJECT_DIR/bin/tools/CleanFunctions . $WM_PROJECT_DIR/bin/tools/CleanFunctions
# remove surface # remove surface and features
\rm -f constant/triSurface/motorBike.obj.gz \rm -f constant/triSurface/motorBike.obj.gz
\rm -rf constant/extendedFeatureEdgeMesh/
\rm -f constant/triSurface/motorBike.eMesh
rm -rf 0 > /dev/null 2>&1 rm -rf 0 > /dev/null 2>&1

View File

@ -1,52 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
5
(
frontAndBack
{
type patch;
nFaces 320;
startFace 3456;
}
inlet
{
type patch;
nFaces 64;
startFace 3776;
}
outlet
{
type patch;
nFaces 64;
startFace 3840;
}
lowerWall
{
type wall;
nFaces 160;
startFace 3904;
}
upperWall
{
type patch;
nFaces 160;
startFace 4064;
}
)
// ************************************************************************* //

View File

@ -12,12 +12,11 @@ forceCoeffs1
functionObjectLibs ( "libforces.so" ); functionObjectLibs ( "libforces.so" );
outputControl timeStep; outputControl outputTime;
outputInterval 1;
log yes; log yes;
patches ( "motorBike.*" ); patches ( motorBikeGroup );
pName p; pName p;
UName U; UName U;
rhoName rhoInf; // Indicates incompressible rhoName rhoInf; // Indicates incompressible
@ -31,6 +30,7 @@ forceCoeffs1
lRef 1.42; // Wheelbase length lRef 1.42; // Wheelbase length
Aref 0.75; // Estimated Aref 0.75; // Estimated
/* - Uncomment to have forceCoeffs calculated in 20 bins
binData binData
{ {
nBin 20; // output data into 20 bins nBin 20; // output data into 20 bins
@ -38,6 +38,7 @@ forceCoeffs1
format gnuplot; format gnuplot;
cumulative yes; cumulative yes;
} }
*/
} }

View File

@ -22,6 +22,7 @@ ddtSchemes
gradSchemes gradSchemes
{ {
default Gauss linear; default Gauss linear;
grad(U) cellLimited Gauss linear 1;
} }
divSchemes divSchemes

View File

@ -20,7 +20,7 @@ solvers
{ {
solver GAMG; solver GAMG;
tolerance 1e-7; tolerance 1e-7;
relTol 0.1; relTol 0.01;
smoother GaussSeidel; smoother GaussSeidel;
nPreSweeps 0; nPreSweeps 0;
nPostSweeps 2; nPostSweeps 2;

View File

@ -92,7 +92,7 @@ castellatedMeshControls
( (
{ {
file "motorBike.eMesh"; file "motorBike.eMesh";
level 0; level 6;
} }
); );
@ -119,7 +119,7 @@ castellatedMeshControls
patchInfo patchInfo
{ {
type wall; type wall;
inGroups (motorBike); inGroups (motorBikeGroup);
} }
} }
} }
@ -180,10 +180,10 @@ snapControls
//- Relative distance for points to be attracted by surface feature point //- Relative distance for points to be attracted by surface feature point
// or edge. True distance is this factor times local // or edge. True distance is this factor times local
// maximum edge length. // maximum edge length.
tolerance 4.0; tolerance 2.0;
//- Number of mesh displacement relaxation iterations. //- Number of mesh displacement relaxation iterations.
nSolveIter 0; nSolveIter 30;
//- Maximum number of snapping relaxation iterations. Should stop //- Maximum number of snapping relaxation iterations. Should stop
// before upon reaching a correct mesh. // before upon reaching a correct mesh.
@ -193,14 +193,14 @@ snapControls
//- Number of feature edge snapping iterations. //- Number of feature edge snapping iterations.
// Leave out altogether to disable. // Leave out altogether to disable.
nFeatureSnapIter 0; nFeatureSnapIter 10;
//- Detect (geometric only) features by sampling the surface //- Detect (geometric only) features by sampling the surface
// (default=false). // (default=false).
implicitFeatureSnap false; implicitFeatureSnap false;
//- Use castellatedMeshControls::features (default = true) //- Use castellatedMeshControls::features (default = true)
explicitFeatureSnap false; explicitFeatureSnap true;
//- Detect points on multiple surfaces (only for explicitFeatureSnap) //- Detect points on multiple surfaces (only for explicitFeatureSnap)
multiRegionFeatureSnap false; multiRegionFeatureSnap false;

View File

@ -16,7 +16,6 @@ near
// Output every // Output every
outputControl outputTime; outputControl outputTime;
//outputInterval 1;
// Fields to be sampled. Per field original name and mapped field to // Fields to be sampled. Per field original name and mapped field to
// create. // create.
@ -27,7 +26,7 @@ near
); );
// Patches/groups to sample (regular expressions) // Patches/groups to sample (regular expressions)
patches (motorBike); patches (motorBikeGroup);
// Distance to sample // Distance to sample
distance 0.001; distance 0.001;
@ -42,7 +41,6 @@ wallBoundedStreamLines
// Output every // Output every
outputControl outputTime; outputControl outputTime;
// outputInterval 10;
setFormat vtk; //gnuplot; //xmgr; //raw; //jplot; setFormat vtk; //gnuplot; //xmgr; //raw; //jplot;
@ -87,7 +85,7 @@ wallBoundedStreamLines
patchSeedCoeffs patchSeedCoeffs
{ {
type patchSeed; type patchSeed;
patches (motorBike); patches (motorBikeGroup);
axis x; //distance; axis x; //distance;
maxPoints 20000; maxPoints 20000;
} }

View File

@ -40,7 +40,7 @@ boundaryField
walls walls
{ {
type epsilonWallFunction; type epsilonWallFunction;
value uniform 0; value $internalField;
} }
} }

View File

@ -1,64 +0,0 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class polyBoundaryMesh;
location "constant/polyMesh";
object boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
5
(
inlet
{
type patch;
nFaces 28;
startFace 4422;
}
outlet
{
type patch;
nFaces 28;
startFace 4450;
}
side1
{
type cyclicAMI;
inGroups 1(cyclicAMI);
nFaces 400;
startFace 4478;
matchTolerance 0.0001;
transform rotational;
neighbourPatch side2;
rotationAxis (1 0 0);
rotationCentre (0 0 0);
}
side2
{
type cyclicAMI;
inGroups 1(cyclicAMI);
nFaces 250;
startFace 4878;
matchTolerance 0.0001;
transform rotational;
neighbourPatch side1;
rotationAxis (1 0 0);
rotationCentre (0 0 0);
}
walls
{
type wall;
nFaces 250;
startFace 5128;
}
)
// ************************************************************************* //

View File

@ -11,7 +11,7 @@ FoamFile
format ascii; format ascii;
class dictionary; class dictionary;
location "constant"; location "constant";
object reactingCloud1Properties; object kinematicCloudProperties;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -48,8 +48,6 @@ constantProperties
rho0 964; rho0 964;
youngsModulus 6e8; youngsModulus 6e8;
poissonsRatio 0.35; poissonsRatio 0.35;
constantVolume false;
} }
@ -66,18 +64,12 @@ subModels
dispersionModel none; dispersionModel none;
patchInteractionModel standardWallInteraction; patchInteractionModel none;
heatTransferModel none;
stochasticCollisionModel none;
surfaceFilmModel none; surfaceFilmModel none;
collisionModel pairCollision; collisionModel pairCollision;
radiation off;
pairCollisionCoeffs pairCollisionCoeffs
{ {
// Maximum possible particle diameter expected at any time // Maximum possible particle diameter expected at any time
@ -123,11 +115,6 @@ subModels
} }
}; };
} }
standardWallInteractionCoeffs
{
type rebound;
}
} }

View File

@ -11,7 +11,7 @@ FoamFile
format ascii; format ascii;
class dictionary; class dictionary;
location "constant"; location "constant";
object reactingCloud1Properties; object kinematicCloudProperties;
} }
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -40,8 +40,6 @@ constantProperties
rho0 964; rho0 964;
youngsModulus 6e8; youngsModulus 6e8;
poissonsRatio 0.35; poissonsRatio 0.35;
constantVolume false;
} }
subModels subModels
@ -76,18 +74,12 @@ subModels
dispersionModel none; dispersionModel none;
patchInteractionModel standardWallInteraction; patchInteractionModel none;
heatTransferModel none;
stochasticCollisionModel none;
surfaceFilmModel none; surfaceFilmModel none;
collisionModel pairCollision; collisionModel pairCollision;
radiation off;
pairCollisionCoeffs pairCollisionCoeffs
{ {
// Maximum possible particle diameter expected at any time // Maximum possible particle diameter expected at any time
@ -133,11 +125,6 @@ subModels
} }
}; };
} }
standardWallInteractionCoeffs
{
type rebound;
}
} }

View File

@ -1 +0,0 @@
backgroundMeshDecomposition/decomposeParDict

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 2;
method scotch;
//method ptscotch;
// method hierarchical;
simpleCoeffs
{
n ( 2 2 1 );
delta 0.001;
}
hierarchicalCoeffs
{
n ( 2 1 1 );
delta 0.001;
order xyz;
}
manualCoeffs
{
dataFile "";
}
distributed no;
roots ( );
// ************************************************************************* //

View File

@ -1 +0,0 @@
backgroundMeshDecomposition/decomposeParDict

View File

@ -0,0 +1,46 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 8;
//method scotch;
method hierarchical;
simpleCoeffs
{
n ( 2 2 2 );
delta 0.001;
}
hierarchicalCoeffs
{
n ( 2 2 2 );
delta 0.001;
order xyz;
}
manualCoeffs
{
dataFile "";
}
distributed no;
roots ( );
// ************************************************************************* //

View File

@ -1 +0,0 @@
backgroundMeshDecomposition/decomposeParDict

View File

@ -0,0 +1,47 @@
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: dev |
| \\ / A nd | Web: www.OpenFOAM.org |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
location "system";
object decomposeParDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
numberOfSubdomains 8;
//method ptscotch;
//method hierarchical;
method scotch;
simpleCoeffs
{
n ( 2 2 1 );
delta 0.001;
}
hierarchicalCoeffs
{
n ( 2 2 2 );
delta 0.001;
order xyz;
}
manualCoeffs
{
dataFile "";
}
distributed no;
roots ( );
// ************************************************************************* //

View File

@ -1,3 +1,2 @@
#!/bin/sh #!/bin/sh
awk '{print $1 " " $4}' postProcessing/poolHeight/0/faceSource.dat > poolHeight_vs_time awk '{print $1 " " $4}' postProcessing/poolHeight/0/faceSource.dat > poolHeight_vs_time