Skip to content
Snippets Groups Projects
Commit 47355f43 authored by sergio's avatar sergio
Browse files

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

parents 48c70a91 6038e22d
Branches
Tags
No related merge requests found
Showing
with 220 additions and 14 deletions
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wclean
wclean rhoPorousMRFSimpleFoam
wclean rhoSimplecFoam
# ----------------------------------------------------------------- end-of-file
......@@ -4,5 +4,6 @@ set -x
wmake
wmake rhoPorousMRFSimpleFoam
wmake rhoSimplecFoam
# ----------------------------------------------------------------- end-of-file
......@@ -3,6 +3,7 @@
tmp<fvVectorMatrix> UEqn
(
fvm::div(phi, U)
- fvm::Sp(fvc::div(phi), U)
+ turbulence->divDevRhoReff(U)
);
......
{
volScalarField K("K", 0.5*magSqr(U));
fvScalarMatrix hEqn
(
fvm::div(phi, h)
- fvm::Sp(fvc::div(phi), h)
- fvm::laplacian(turbulence->alphaEff(), h)
==
- fvc::div(phi, 0.5*magSqr(U), "div(phi,K)")
fvc::div(phi)*K - fvc::div(phi, K)
);
hEqn.relax();
......
......@@ -28,7 +28,7 @@ if (simple.transonic())
);
// Relax the pressure equation to ensure diagonal-dominance
pEqn.relax(mesh.equationRelaxationFactor("pEqn"));
pEqn.relax();
pEqn.setReference(pRefCell, pRefValue);
......
EXE_INC = \
-I../rhoSimpleFoam \
-I.. \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/turbulenceModels/compressible/RAS/RASModel \
......
......@@ -29,21 +29,17 @@ if (simple.transonic())
(
"phic",
fvc::interpolate(rho/AtU - rho/AU)*fvc::snGrad(p)*mesh.magSf()
+ phid*(fvc::interpolate(p) - fvc::interpolate(p, "UD"))
);
//refCast<mixedFvPatchScalarField>(p.boundaryField()[1]).refValue()
// = p.boundaryField()[1];
fvScalarMatrix pEqn
(
fvm::div(phid, p)
+ fvc::div(phic)
- fvm::Sp(fvc::div(phid), p)
+ fvc::div(phid)*p
- fvm::laplacian(rho/AtU, p)
);
//pEqn.relax();
// Relax the pressure equation to ensure diagonal-dominance
pEqn.relax();
pEqn.setReference(pRefCell, pRefValue);
......@@ -71,7 +67,6 @@ else
fvScalarMatrix pEqn
(
fvc::div(phiHbyA)
//- fvm::laplacian(rho/AU, p)
- fvm::laplacian(rho/AtU, p)
);
......
......@@ -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
......
#!/bin/sh
cd ${0%/*} || exit 1 # run from this directory
set -x
wmake
wmake sprayEngineFoam
# ----------------------------------------------------------------- end-of-file
Test-tetTetOverlap.C
EXE = $(FOAM_USER_APPBIN)/Test-tetTetOverlap
EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude
EXE_LIBS = \
-lmeshTools
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
OpenFOAM is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 3 of the License, or
(at your option) any later version.
OpenFOAM is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
for more details.
You should have received a copy of the GNU General Public License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Application
Test-tetTetOverlap
Description
Overlap volume of two tets
\*---------------------------------------------------------------------------*/
#include "tetrahedron.H"
#include "OFstream.H"
#include "meshTools.H"
using namespace Foam;
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
void writeOBJ
(
Ostream& os,
label& vertI,
const tetPoints& tet
)
{
forAll(tet, fp)
{
meshTools::writeOBJ(os, tet[fp]);
}
os << "l " << vertI+1 << ' ' << vertI+2 << nl
<< "l " << vertI+1 << ' ' << vertI+3 << nl
<< "l " << vertI+1 << ' ' << vertI+4 << nl
<< "l " << vertI+2 << ' ' << vertI+3 << nl
<< "l " << vertI+2 << ' ' << vertI+4 << nl
<< "l " << vertI+3 << ' ' << vertI+4 << nl;
vertI += 4;
}
int main(int argc, char *argv[])
{
tetPoints A
(
point(0, 0, 0),
point(1, 0, 0),
point(1, 1, 0),
point(1, 1, 1)
);
const tetPointRef tetA = A.tet();
tetPoints B
(
point(0.1, 0.1, 0.1),
point(1.1, 0.1, 0.1),
point(1.1, 1.1, 0.1),
point(1.1, 1.1, 1.1)
);
const tetPointRef tetB = B.tet();
tetPointRef::tetIntersectionList insideTets;
label nInside = 0;
tetPointRef::tetIntersectionList outsideTets;
label nOutside = 0;
tetA.tetOverlap
(
tetB,
insideTets,
nInside,
outsideTets,
nOutside
);
// Dump to file
// ~~~~~~~~~~~~
{
OFstream str("tetA.obj");
Info<< "Writing A to " << str.name() << endl;
label vertI = 0;
writeOBJ(str, vertI, A);
}
{
OFstream str("tetB.obj");
Info<< "Writing B to " << str.name() << endl;
label vertI = 0;
writeOBJ(str, vertI, B);
}
{
OFstream str("inside.obj");
Info<< "Writing parts of A inside B to " << str.name() << endl;
label vertI = 0;
for (label i = 0; i < nInside; ++i)
{
writeOBJ(str, vertI, insideTets[i]);
}
}
{
OFstream str("outside.obj");
Info<< "Writing parts of A outside B to " << str.name() << endl;
label vertI = 0;
for (label i = 0; i < nOutside; ++i)
{
writeOBJ(str, vertI, outsideTets[i]);
}
}
// Check
// ~~~~~
Info<< "Vol A:" << tetA.mag() << endl;
scalar volInside = 0;
for (label i = 0; i < nInside; ++i)
{
volInside += insideTets[i].tet().mag();
}
Info<< "Vol A inside B:" << volInside << endl;
scalar volOutside = 0;
for (label i = 0; i < nOutside; ++i)
{
volOutside += outsideTets[i].tet().mag();
}
Info<< "Vol A outside B:" << volOutside << endl;
Info<< "Sum inside and outside:" << volInside+volOutside << endl;
if (mag(volInside+volOutside-tetA.mag()) > SMALL)
{
FatalErrorIn("Test-tetetOverlap")
<< "Tet volumes do not sum up to input tet."
<< exit(FatalError);
}
return 0;
}
// ************************************************************************* //
......@@ -4,7 +4,7 @@ set -x
wmake libso conformalVoronoiMesh
wmake
wmake cvMeshSurfaceSimplify
wmake cvMeshBackgroundMesh
(cd cvMeshSurfaceSimplify && ./Allwmake)
# ----------------------------------------------------------------- end-of-file
......@@ -2,11 +2,15 @@ EXE_DEBUG = -DFULLDEBUG -g -O0
EXE_FROUNDING_MATH = -frounding-math
EXE_NDEBUG = -DNDEBUG
CGAL_EXACT =
CGAL_INEXACT = -DCGAL_INEXACT
include $(GENERAL_RULES)/CGAL
EXE_INC = \
${EXE_FROUNDING_MATH} \
${EXE_NDEBUG} \
${CGAL_INEXACT} \
${CGAL_INC} \
-IconformalVoronoiMesh/lnInclude \
-I$(LIB_SRC)/finiteVolume/lnInclude \
......
......@@ -2,12 +2,16 @@ EXE_DEBUG = -DFULLDEBUG -g -O0
EXE_FROUNDING_MATH = -frounding-math
EXE_NDEBUG = -DNDEBUG
CGAL_EXACT =
CGAL_INEXACT = -DCGAL_INEXACT
include $(GENERAL_RULES)/CGAL
FFLAGS = -DCGAL_FILES='"${CGAL_ARCH_PATH}/share/files"'
EXE_INC = \
${EXE_FROUNDING_MATH} \
${EXE_NDEBUG} \
${CGAL_INEXACT} \
${CGAL_INC} \
-I$(LIB_SRC)/finiteVolume/lnInclude \
-I$(LIB_SRC)/meshTools/lnInclude \
......
......@@ -249,6 +249,7 @@ Foam::conformationSurfaces::conformationSurfaces
Info<< endl
<< "Testing for locationInMesh " << locationInMesh_ << endl;
forAll(surfaces_, s)
{
const searchableSurface& surface(allGeometry_[surfaces_[s]]);
......@@ -267,7 +268,6 @@ Foam::conformationSurfaces::conformationSurfaces
referenceVolumeTypes_[s] = vTypes[0];
Info<< " is "
<< searchableSurface::volumeTypeNames[referenceVolumeTypes_[s]]
<< " surface " << surface.name()
......
......@@ -303,6 +303,9 @@ public:
//- Find which patch is closest to the point
label findPatch(const point& pt) const;
//- Is the surface a baffle
inline bool isBaffle(const label index) const;
// Write
......
......@@ -62,4 +62,10 @@ const Foam::treeBoundBox& Foam::conformationSurfaces::globalBounds() const
}
bool Foam::conformationSurfaces::isBaffle(const label index) const
{
return baffleSurfaces_[index];
}
// ************************************************************************* //
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment