Commit f55b15e3 authored by Mark Olesen's avatar Mark Olesen
Browse files

Merge branch 'master' into 'develop'

Merge master changes/bugfixes into develop branch

See merge request !78
parents 9b66285c 4b4e9122
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -26,8 +26,8 @@ Class
Description
IDDESDelta used by the IDDES (improved low Re Spalart-Allmaras DES model)
The min and max delta are calculated using the double distance of the min or
max from the face centre to the cell centre.
The min and max delta are calculated using the face to face distance of
the cell.
SourceFiles
IDDESDelta.C
......
......@@ -3,7 +3,7 @@
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2016 OpenFOAM Foundation
\\/ M anipulation |
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
-------------------------------------------------------------------------------
License
This file is part of OpenFOAM.
......@@ -122,6 +122,37 @@ Foam::porosityModel::porosityModel
<< "cannot find porous cellZone " << zoneName_
<< exit(FatalError);
}
Info<< incrIndent << indent << coordSys_ << decrIndent << endl;
const pointField& points = mesh_.points();
const cellList& cells = mesh_.cells();
const faceList& faces = mesh_.faces();
DynamicList<point> localPoints;
forAll(cellZoneIDs_, zoneI)
{
const cellZone& cZone = mesh_.cellZones()[cellZoneIDs_[zoneI]];
localPoints.setCapacity(10*cells.size());
forAll(cZone, i)
{
const label cellI = cZone[i];
const cell& c = mesh_.cells()[cellI];
const pointField cellPoints(c.points(faces, points));
forAll(cellPoints, pointI)
{
const point& pt = cellPoints[pointI];
localPoints.append(coordSys_.localPosition(pt));
}
}
boundBox bb(localPoints, true);
Info<< " local bounds: " << bb << endl;
localPoints.clear();
}
}
......
......@@ -170,7 +170,8 @@ Foam::sixDoFRigidBodyMotion::sixDoFRigidBodyMotion
momentOfInertia_(sDoFRBM.momentOfInertia_),
aRelax_(sDoFRBM.aRelax_),
aDamp_(sDoFRBM.aDamp_),
report_(sDoFRBM.report_)
report_(sDoFRBM.report_),
solver_(sDoFRBM.solver_, false)
{}
......
......@@ -52,6 +52,7 @@ SourceFiles
#include "sixDoFRigidBodyMotionConstraint.H"
#include "Tuple2.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
......
......@@ -25,6 +25,7 @@ License
#include "sixDoFRigidBodyMotion.H"
#include "IOstreams.H"
#include "sixDoFSolver.H"
// * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * * //
......@@ -112,6 +113,12 @@ void Foam::sixDoFRigidBodyMotion::write(Ostream& os) const
os << decrIndent << indent << token::END_BLOCK << nl;
}
if (!solver_.empty())
{
os << indent << "solver";
solver_->write(os);
}
}
......
......@@ -46,7 +46,7 @@ Foam::sixDoFSolvers::CrankNicolson::CrankNicolson
sixDoFRigidBodyMotion& body
)
:
sixDoFSolver(body),
sixDoFSolver(dict, body),
aoc_(dict.lookupOrDefault<scalar>("aoc", 0.5)),
voc_(dict.lookupOrDefault<scalar>("voc", 0.5))
{}
......@@ -90,5 +90,4 @@ void Foam::sixDoFSolvers::CrankNicolson::solve
Q() = Qpi.first();
}
// ************************************************************************* //
......@@ -98,6 +98,15 @@ public:
sixDoFRigidBodyMotion& body
);
//- Construct and return a clone
virtual autoPtr<sixDoFSolver> clone() const
{
return autoPtr<sixDoFSolver>
(
new CrankNicolson(dict_, body_)
);
}
//- Destructor
virtual ~CrankNicolson();
......
......@@ -46,7 +46,7 @@ Foam::sixDoFSolvers::Newmark::Newmark
sixDoFRigidBodyMotion& body
)
:
sixDoFSolver(body),
sixDoFSolver(dict, body),
gamma_(dict.lookupOrDefault<scalar>("gamma", 0.5)),
beta_
(
......@@ -111,5 +111,4 @@ void Foam::sixDoFSolvers::Newmark::solve
Q() = Qpi.first();
}
// ************************************************************************* //
......@@ -96,6 +96,15 @@ public:
sixDoFRigidBodyMotion& body
);
//- Construct and return a clone
virtual autoPtr<sixDoFSolver> clone() const
{
return autoPtr<sixDoFSolver>
(
new Newmark(dict_, body_)
);
}
//- Destructor
virtual ~Newmark();
......
......@@ -24,6 +24,7 @@ License
\*---------------------------------------------------------------------------*/
#include "sixDoFSolver.H"
#include "IOstreams.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
......@@ -36,12 +37,22 @@ namespace Foam
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::sixDoFSolver::sixDoFSolver(sixDoFRigidBodyMotion& body)
Foam::sixDoFSolver::sixDoFSolver
(
const dictionary& dict,
sixDoFRigidBodyMotion& body
)
:
body_(body)
body_(body),
dict_(dict)
{}
void Foam::sixDoFSolver::write(Ostream& os) const
{
os << dict_;
}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::sixDoFSolver::~sixDoFSolver()
......
......@@ -59,6 +59,9 @@ protected:
//- The rigid body
sixDoFRigidBodyMotion& body_;
//- Model dictionary
dictionary dict_;
// Protected member functions
......@@ -148,7 +151,10 @@ public:
// Constructors
// Construct for given body
sixDoFSolver(sixDoFRigidBodyMotion& body);
sixDoFSolver(const dictionary& dict, sixDoFRigidBodyMotion& body);
//- Construct and return a clone
virtual autoPtr<sixDoFSolver> clone() const = 0;
//- Destructor
......@@ -175,6 +181,10 @@ public:
scalar deltaT,
scalar deltaT0
) = 0;
//- Write
void write(Ostream&) const;
};
......
......@@ -46,7 +46,7 @@ Foam::sixDoFSolvers::symplectic::symplectic
sixDoFRigidBodyMotion& body
)
:
sixDoFSolver(body)
sixDoFSolver(dict, body)
{}
......@@ -90,5 +90,4 @@ void Foam::sixDoFSolvers::symplectic::solve
pi() += rConstraints() & aDamp()*0.5*deltaT*tau();
}
// ************************************************************************* //
......@@ -95,6 +95,15 @@ public:
sixDoFRigidBodyMotion& body
);
//- Construct and return a clone
virtual autoPtr<sixDoFSolver> clone() const
{
return autoPtr<sixDoFSolver>
(
new symplectic(dict_, body_)
);
}
//- Destructor
virtual ~symplectic();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment