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

This commit is contained in:
Sergio Ferraris 2014-01-06 09:39:37 +00:00
commit 7316691a6d
111 changed files with 1583 additions and 834 deletions

View File

@ -106,7 +106,7 @@ int main(int argc, char *argv[])
zeroGradientFvPatchVectorField::typeName
);
cloudVolSUSu.internalField() = - cloudSU.source()/mesh.V();
cloudVolSUSu.internalField() = -cloudSU.source()/mesh.V();
cloudVolSUSu.correctBoundaryConditions();
cloudSU.source() = vector::zero;

View File

@ -12,4 +12,8 @@ heatTransferModels/heatTransferModel/heatTransferModel.C
heatTransferModels/heatTransferModel/newHeatTransferModel.C
heatTransferModels/RanzMarshall/RanzMarshall.C
liftModels/liftModel/liftModel.C
liftModels/liftModel/newLiftModel.C
liftModels/constantCoefficient/constantCoefficient.C
LIB = $(FOAM_LIBBIN)/libcompressibleEulerianInterfacialModels

View File

@ -0,0 +1,86 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "constantCoefficient.H"
#include "addToRunTimeSelectionTable.H"
#include "fvc.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
namespace liftModels
{
defineTypeNameAndDebug(constantCoefficient, 0);
addToRunTimeSelectionTable
(
liftModel,
constantCoefficient,
dictionary
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::liftModels::constantCoefficient::constantCoefficient
(
const dictionary& dict,
const volScalarField& alpha1,
const phaseModel& phase1,
const phaseModel& phase2
)
:
liftModel(dict, alpha1, phase1, phase2),
Cl_("Cl", dimless, dict.lookup("Cl"))
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::liftModels::constantCoefficient::~constantCoefficient()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam::tmp<Foam::volVectorField> Foam::liftModels::constantCoefficient::F
(
const volVectorField& U
) const
{
return
Cl_
*(phase1_*phase1_.rho() + phase2_*phase2_.rho())
*(
(phase1_.U() - phase2_.U())
^ fvc::curl(U)
);
}
// ************************************************************************* //

View File

@ -0,0 +1,98 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
Class
Foam::liftModels::constantCoefficient
Description
SourceFiles
constantCoefficient.C
\*---------------------------------------------------------------------------*/
#ifndef constantCoefficient_H
#define constantCoefficient_H
#include "liftModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
namespace Foam
{
namespace liftModels
{
/*---------------------------------------------------------------------------*\
Class constantCoefficient Declaration
\*---------------------------------------------------------------------------*/
class constantCoefficient
:
public liftModel
{
// Private data
//- Constant lift coefficient
dimensionedScalar Cl_;
public:
//- Runtime type information
TypeName("constantCoefficient");
// Constructors
//- Construct from components
constantCoefficient
(
const dictionary& dict,
const volScalarField& alpha1,
const phaseModel& phase1,
const phaseModel& phase2
);
//- Destructor
virtual ~constantCoefficient();
// Member Functions
//- Lift force
tmp<volVectorField> F(const volVectorField& U) const;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace liftModels
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,60 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "liftModel.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
namespace Foam
{
defineTypeNameAndDebug(liftModel, 0);
defineRunTimeSelectionTable(liftModel, dictionary);
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam::liftModel::liftModel
(
const dictionary& dict,
const volScalarField& alpha1,
const phaseModel& phase1,
const phaseModel& phase2
)
:
dict_(dict),
alpha1_(alpha1),
phase1_(phase1),
phase2_(phase2)
{}
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam::liftModel::~liftModel()
{}
// ************************************************************************* //

View File

@ -0,0 +1,127 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
Class
Foam::liftModel
Description
SourceFiles
liftModel.C
newLiftModel.C
\*---------------------------------------------------------------------------*/
#ifndef liftModel_H
#define liftModel_H
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "dictionary.H"
#include "phaseModel.H"
#include "runTimeSelectionTables.H"
namespace Foam
{
/*---------------------------------------------------------------------------*\
Class liftModel Declaration
\*---------------------------------------------------------------------------*/
class liftModel
{
protected:
// Protected data
const dictionary& dict_;
const volScalarField& alpha1_;
const phaseModel& phase1_;
const phaseModel& phase2_;
public:
//- Runtime type information
TypeName("liftModel");
// Declare runtime construction
declareRunTimeSelectionTable
(
autoPtr,
liftModel,
dictionary,
(
const dictionary& dict,
const volScalarField& alpha1,
const phaseModel& phase1,
const phaseModel& phase2
),
(dict, alpha1, phase1, phase2)
);
// Constructors
liftModel
(
const dictionary& dict,
const volScalarField& alpha1,
const phaseModel& phase1,
const phaseModel& phase2
);
//- Destructor
virtual ~liftModel();
// Selectors
static autoPtr<liftModel> New
(
const dictionary& dict,
const volScalarField& alpha1,
const phaseModel& phase1,
const phaseModel& phase2
);
// Member Functions
//- Lift force
virtual tmp<volVectorField> F(const volVectorField& U) const = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -0,0 +1,72 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2014 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/>.
\*---------------------------------------------------------------------------*/
#include "liftModel.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
Foam::autoPtr<Foam::liftModel> Foam::liftModel::New
(
const dictionary& dict,
const volScalarField& alpha1,
const phaseModel& phase1,
const phaseModel& phase2
)
{
word liftModelType
(
dict.subDict(phase1.name()).lookup("type")
);
Info << "Selecting liftModel for phase "
<< phase1.name()
<< ": "
<< liftModelType << endl;
dictionaryConstructorTable::iterator cstrIter =
dictionaryConstructorTablePtr_->find(liftModelType);
if (cstrIter == dictionaryConstructorTablePtr_->end())
{
FatalErrorIn("liftModel::New")
<< "Unknown liftModelType type "
<< liftModelType << endl << endl
<< "Valid liftModel types are : " << endl
<< dictionaryConstructorTablePtr_->sortedToc()
<< exit(FatalError);
}
return
cstrIter()
(
dict.subDict(phase1.name()).subDict(liftModelType + "Coeffs"),
alpha1,
phase1,
phase2
);
}
// ************************************************************************* //

View File

@ -55,8 +55,6 @@ Foam::RASModels::kineticTheoryModel::kineticTheoryModel
phase_(phase),
draga_(phase.fluid().drag1()),
viscosityModel_
(
kineticTheoryModels::viscosityModel::New
@ -401,7 +399,11 @@ void Foam::RASModels::kineticTheoryModel::correct()
(
alpha*(1.0 - alpha),
phase_.fluid().residualPhaseFraction()
)*draga_.K(magUr + phase_.fluid().residualSlip())/rho
)
*phase_.fluid().drag(phase_).K
(
magUr + phase_.fluid().residualSlip()
)/rho
);
// Eq. 3.25, p. 50 Js = J1 - J2

View File

@ -82,8 +82,8 @@ class kineticTheoryModel
const phaseModel& phase_;
//- Drag model
const dragModel& draga_;
////- Drag model
//const dragModel& draga_;
// Sub-models

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -111,13 +111,6 @@ Foam::twoPhaseSystem::twoPhaseSystem
lookup("Cvm")
),
Cl_
(
"Cl",
dimless,
lookup("Cl")
),
drag1_
(
dragModel::New
@ -162,6 +155,28 @@ Foam::twoPhaseSystem::twoPhaseSystem
)
),
lift1_
(
liftModel::New
(
subDict("lift"),
phase1_,
phase1_,
phase2_
)
),
lift2_
(
liftModel::New
(
subDict("lift"),
phase2_,
phase2_,
phase1_
)
),
dispersedPhase_(lookup("dispersedPhase")),
residualPhaseFraction_
@ -311,11 +326,28 @@ Foam::tmp<Foam::volVectorField> Foam::twoPhaseSystem::liftForce
);
volVectorField& liftForce = tliftForce();
volVectorField Ur(phase1_.U() - phase2_.U());
liftForce =
Cl_*(phase1_*phase1_.rho() + phase2_*phase2_.rho())
*(Ur ^ fvc::curl(U));
if (dispersedPhase_ == phase1_.name())
{
liftForce = lift1().F(U);
}
else if (dispersedPhase_ == phase2_.name())
{
liftForce = lift2().F(U);
}
else if (dispersedPhase_ == "both")
{
liftForce =
(
phase2_*lift1().F(U)
+ phase1_*lift2().F(U)
);
}
else
{
FatalErrorIn("twoPhaseSystem::liftForce()")
<< "dispersedPhase: " << dispersedPhase_ << " is incorrect"
<< exit(FatalError);
}
// Remove lift at fixed-flux boundaries
forAll(phase1_.phi().boundaryField(), patchi)
@ -631,7 +663,6 @@ bool Foam::twoPhaseSystem::read()
lookup("sigma") >> sigma_;
lookup("Cvm") >> Cvm_;
lookup("Cl") >> Cl_;
// drag1_->read(*this);
// drag2_->read(*this);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,6 +45,7 @@ SourceFiles
#include "IOdictionary.H"
#include "phaseModel.H"
#include "dragModel.H"
#include "liftModel.H"
#include "heatTransferModel.H"
#include "volFields.H"
#include "surfaceFields.H"
@ -57,7 +58,7 @@ namespace Foam
// Forward declarations
class dragModel;
class heatTransferModel;
class liftModel;
/*---------------------------------------------------------------------------*\
Class twoPhaseSystem Declaration
@ -69,31 +70,57 @@ class twoPhaseSystem
{
// Private data
//- Reference to the mesh
const fvMesh& mesh_;
//- Phase model 1
phaseModel phase1_;
//- Phase model 2
phaseModel phase2_;
//- Total volumetric flux
surfaceScalarField phi_;
//- Dilatation term
volScalarField dgdt_;
//- Surface tension coefficient
dimensionedScalar sigma_;
//- Virtual mass coefficient
dimensionedScalar Cvm_;
dimensionedScalar Cl_;
//- Drag model for phase 1
autoPtr<dragModel> drag1_;
//- Drag model for phase 2
autoPtr<dragModel> drag2_;
//- Heat transfer model for phase 1
autoPtr<heatTransferModel> heatTransfer1_;
//- Heat transfer model for phase 2
autoPtr<heatTransferModel> heatTransfer2_;
//- Lift model for phase 1
autoPtr<liftModel> lift1_;
//- Lift model for phase 2
autoPtr<liftModel> lift2_;
//- Name of the dispersed phase, or "both"
word dispersedPhase_;
//- Residual phase fraction
scalar residualPhaseFraction_;
//- Redisual slip
dimensionedScalar residualSlip_;
// Private member functions
//- Return the mixture flux
tmp<surfaceScalarField> calcPhi() const;
@ -113,136 +140,21 @@ public:
// Member Functions
const fvMesh& mesh() const
{
return mesh_;
}
const phaseModel& phase1() const
{
return phase1_;
}
const phaseModel& phase2() const
{
return phase2_;
}
const phaseModel& otherPhase(const phaseModel& phase) const
{
if (&phase == &phase1_)
{
return phase2_;
}
else
{
return phase1_;
}
}
phaseModel& phase1()
{
return phase1_;
}
phaseModel& phase2()
{
return phase2_;
}
//- Return the mixture flux
const surfaceScalarField& phi() const
{
return phi_;
}
//- Return the mixture flux
surfaceScalarField& phi()
{
return phi_;
}
const volScalarField& dgdt() const
{
return dgdt_;
}
volScalarField& dgdt()
{
return dgdt_;
}
const dragModel& drag1() const
{
return drag1_();
}
const dragModel& drag2() const
{
return drag2_();
}
const dragModel& drag(const phaseModel& phase) const
{
if (&phase == &phase1_)
{
return drag1_();
}
else
{
return drag2_();
}
}
scalar residualPhaseFraction() const
{
return residualPhaseFraction_;
}
const dimensionedScalar& residualSlip() const
{
return residualSlip_;
}
//- Return the drag coefficient
tmp<volScalarField> dragCoeff() const;
tmp<volVectorField> liftForce(const volVectorField& U) const;
const heatTransferModel& heatTransfer1() const
{
return heatTransfer1_();
}
const heatTransferModel& heatTransfer2() const
{
return heatTransfer2_();
}
//- Return the heat transfer coefficient
tmp<volScalarField> heatTransferCoeff() const;
//- Return the lift force
tmp<volVectorField> liftForce(const volVectorField& U) const;
//- Return the mixture density
tmp<volScalarField> rho() const;
//- Return the mixture velocity
tmp<volVectorField> U() const;
//- Return the surface tension coefficient
dimensionedScalar sigma() const
{
return sigma_;
}
//- Return the virtual-mass coefficient
dimensionedScalar Cvm() const
{
return Cvm_;
}
//- Return the lift coefficient
dimensionedScalar Cl() const
{
return Cl_;
}
//- Solve for the two-phase-fractions
void solve();
@ -254,6 +166,148 @@ public:
//- Read base phaseProperties dictionary
bool read();
// Access
//- Return the mesh
const fvMesh& mesh() const
{
return mesh_;
}
//- Return phase model 1
const phaseModel& phase1() const
{
return phase1_;
}
//- Return non-const access to phase model 1
phaseModel& phase1()
{
return phase1_;
}
//- Return phase model 2
const phaseModel& phase2() const
{
return phase2_;
}
//- Return non-const access to phase model 2
phaseModel& phase2()
{
return phase2_;
}
//- Return the phase not given as an argument
const phaseModel& otherPhase(const phaseModel& phase) const
{
if (&phase == &phase1_)
{
return phase2_;
}
else
{
return phase1_;
}
}
//- Return the mixture flux
const surfaceScalarField& phi() const
{
return phi_;
}
//- Return non-const access to the the mixture flux
surfaceScalarField& phi()
{
return phi_;
}
//- Return the dilatation term
const volScalarField& dgdt() const
{
return dgdt_;
}
//- Return non-const access to the
volScalarField& dgdt()
{
return dgdt_;
}
//- Return the drag model for phase 1
const dragModel& drag1() const
{
return drag1_();
}
//- Return the drag model for phase 2
const dragModel& drag2() const
{
return drag2_();
}
//- Return the drag model for the supplied phase
const dragModel& drag(const phaseModel& phase) const
{
if (&phase == &phase1_)
{
return drag1_();
}
else
{
return drag2_();
}
}
//- Return non-const access to the residual phase fraction
scalar residualPhaseFraction() const
{
return residualPhaseFraction_;
}
//- Return the residual slip
const dimensionedScalar& residualSlip() const
{
return residualSlip_;
}
//- Return the heat transfer model for phase 1
const heatTransferModel& heatTransfer1() const
{
return heatTransfer1_();
}
//- Return the heat transfer model for phase 2
const heatTransferModel& heatTransfer2() const
{
return heatTransfer2_();
}
//- Return the lift model for phase 1
const liftModel& lift1() const
{
return lift1_();
}
//- Return the lift model for phase 2
const liftModel& lift2() const
{
return lift2_();
}
//- Return the surface tension coefficient
dimensionedScalar sigma() const
{
return sigma_;
}
//- Return the virtual-mass coefficient
dimensionedScalar Cvm() const
{
return Cvm_;
}
};

View File

@ -34,11 +34,14 @@ Description
#include "Time.H"
#include "volFields.H"
#include "surfaceFields.H"
#include "pointFields.H"
#include "hexRef8.H"
#include "mapPolyMesh.H"
#include "polyTopoChange.H"
#include "Random.H"
#include "zeroGradientFvPatchFields.H"
#include "calculatedPointPatchFields.H"
#include "pointConstraints.H"
#include "fvcDiv.H"
using namespace Foam;
@ -61,6 +64,8 @@ int main(int argc, char *argv[])
# include "createMesh.H"
const pointConstraints& pc = pointConstraints::New(pointMesh::New(mesh));
const Switch inflate(args.args()[1]);
if (inflate)
@ -144,6 +149,29 @@ int main(int argc, char *argv[])
surfaceOne.write();
// Uniform point field
pointScalarField pointX
(
IOobject
(
"pointX",
runTime.timeName(),
mesh,
IOobject::NO_READ,
IOobject::AUTO_WRITE
),
pointMesh::New(mesh),
dimensionedScalar("one", dimless, 1.0),
calculatedPointPatchScalarField::typeName
);
pointX.internalField() = mesh.points().component(0);
pointX.correctBoundaryConditions();
Info<< "Writing x-component field "
<< pointX.name() << " in " << runTime.timeName() << endl;
pointX.write();
// Force allocation of V. Important for any mesh changes since otherwise
// old time volumes are not stored
const scalar totalVol = gSum(mesh.V());
@ -163,89 +191,107 @@ int main(int argc, char *argv[])
}
mesh.moving(false);
mesh.topoChanging(false);
// Mesh changing engine.
polyTopoChange meshMod(mesh);
if (rndGen.bit())
label action = rndGen.integer(0, 5);
if (action == 0)
{
// Refine
label nRefine = mesh.nCells()/20;
DynamicList<label> refineCandidates(nRefine);
for (label i=0; i<nRefine; i++)
{
refineCandidates.append(rndGen.integer(0, mesh.nCells()-1));
}
labelList cellsToRefine
(
meshCutter.consistentRefinement
(
refineCandidates,
true // buffer layer
)
);
Info<< nl << "-- selected "
<< returnReduce(cellsToRefine.size(), sumOp<label>())
<< " cells out of " << mesh.globalData().nTotalCells()
<< " for refinement" << endl;
// Play refinement commands into mesh changer.
meshCutter.setRefinement(cellsToRefine, meshMod);
Info<< nl << "-- moving only" << endl;
mesh.movePoints(pointField(mesh.points()));
}
else
else if (action == 1 || action == 2)
{
// Unrefine
labelList allSplitPoints(meshCutter.getSplitPoints());
// Mesh changing engine.
polyTopoChange meshMod(mesh);
label nUnrefine = allSplitPoints.size()/20;
labelHashSet candidates(2*nUnrefine);
for (label i=0; i<nUnrefine; i++)
if (action == 1)
{
candidates.insert
// Refine
label nRefine = mesh.nCells()/20;
DynamicList<label> refineCandidates(nRefine);
for (label i=0; i<nRefine; i++)
{
refineCandidates.append(rndGen.integer(0, mesh.nCells()-1));
}
labelList cellsToRefine
(
allSplitPoints[rndGen.integer(0, allSplitPoints.size()-1)]
meshCutter.consistentRefinement
(
refineCandidates,
true // buffer layer
)
);
Info<< nl << "-- selected "
<< returnReduce(cellsToRefine.size(), sumOp<label>())
<< " cells out of " << mesh.globalData().nTotalCells()
<< " for refinement" << endl;
// Play refinement commands into mesh changer.
meshCutter.setRefinement(cellsToRefine, meshMod);
}
else
{
// Unrefine
labelList allSplitPoints(meshCutter.getSplitPoints());
label nUnrefine = allSplitPoints.size()/20;
labelHashSet candidates(2*nUnrefine);
for (label i=0; i<nUnrefine; i++)
{
label index = rndGen.integer(0, allSplitPoints.size()-1);
candidates.insert(allSplitPoints[index]);
}
labelList splitPoints = meshCutter.consistentUnrefinement
(
candidates.toc(),
false
);
Info<< nl << "-- selected "
<< returnReduce(splitPoints.size(), sumOp<label>())
<< " points out of "
<< returnReduce(allSplitPoints.size(), sumOp<label>())
<< " for unrefinement" << endl;
// Play refinement commands into mesh changer.
meshCutter.setUnrefinement(splitPoints, meshMod);
}
labelList splitPoints = meshCutter.consistentUnrefinement
(
candidates.toc(),
false
);
Info<< nl << "-- selected "
<< returnReduce(splitPoints.size(), sumOp<label>())
<< " points out of "
<< returnReduce(allSplitPoints.size(), sumOp<label>())
<< " for unrefinement" << endl;
// Play refinement commands into mesh changer.
meshCutter.setUnrefinement(splitPoints, meshMod);
// Create mesh, return map from old to new mesh.
Info<< nl << "-- actually changing mesh" << endl;
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, inflate);
// Update fields
Info<< nl << "-- mapping mesh data" << endl;
mesh.updateMesh(map);
// Inflate mesh
if (map().hasMotionPoints())
{
Info<< nl << "-- moving mesh" << endl;
mesh.movePoints(map().preMotionPoints());
}
// Update numbering of cells/vertices.
Info<< nl << "-- mapping hexRef8 data" << endl;
meshCutter.updateMesh(map);
}
// Create mesh, return map from old to new mesh.
Info<< nl << "-- actually changing mesh" << endl;
autoPtr<mapPolyMesh> map = meshMod.changeMesh(mesh, inflate);
// Update fields
Info<< nl << "-- mapping mesh data" << endl;
mesh.updateMesh(map);
// Inflate mesh
if (map().hasMotionPoints())
{
Info<< nl << "-- moving mesh" << endl;
mesh.movePoints(map().preMotionPoints());
}
// Update numbering of cells/vertices.
Info<< nl << "-- mapping hexRef8 data" << endl;
meshCutter.updateMesh(map);
Info<< nl<< "-- Mesh : moving:" << mesh.moving()
<< " topoChanging:" << mesh.topoChanging()
<< " changing:" << mesh.changing()
<< endl;
@ -362,6 +408,9 @@ int main(int argc, char *argv[])
<< nl << endl;
}
Info<< "pc:" << pc.patchPatchPointConstraintPoints().size() << endl;
Info<< "End\n" << endl;
return 0;

View File

@ -17,9 +17,12 @@ FoamFile
DebugSwitches
{
primitiveMesh 1;
polyMesh 1;
fvMesh 1;
primitiveMesh 1;
polyMesh 1;
fvMesh 1;
polyTopoChange 1;
pointMesh 1;
pointConstraints 1;
}
application icoFoam;

View File

@ -488,7 +488,7 @@ meshQualityControls
//(
// mesh // write intermediate meshes
// intersections // write current mesh intersections as .obj files
// featureSeeds, // write information about explicit feature edge refinement
// featureSeeds // write information about explicit feature edge refinement
// layerInfo // write information about layers
//);
//

View File

@ -132,6 +132,11 @@ int main(int argc, char *argv[])
)
);
// Note: both IOsampledSets and IOsampledSurfaces read the
// same dictionary. Unregister one to make sure no duplicates
// trying to register
sSetsPtr().checkOut();
sSurfsPtr.reset
(
new IOsampledSurfaces
@ -160,6 +165,8 @@ int main(int argc, char *argv[])
)
);
sSetsPtr().checkOut();
sSurfsPtr.reset
(
new IOsampledSurfaces

View File

@ -209,6 +209,7 @@ int main(int argc, char *argv[])
}
// Mu
if (mu != 0)
{
pointField newLocalPoints
(

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -57,6 +57,26 @@ Foam::messageStream::messageStream(const dictionary& dict)
{}
Foam::OSstream& Foam::messageStream::masterStream(const label communicator)
{
if (UPstream::warnComm != -1 && communicator != UPstream::warnComm)
{
Pout<< "** messageStream with comm:" << communicator
<< endl;
error::printStack(Pout);
}
if (communicator == UPstream::worldComm)
{
return operator()();
}
else
{
return operator()(UPstream::master(communicator));
}
}
Foam::OSstream& Foam::messageStream::operator()
(
const char* functionName,
@ -166,53 +186,37 @@ Foam::OSstream& Foam::messageStream::operator()
}
Foam::OSstream& Foam::messageStream::operator()(const label communicator)
Foam::OSstream& Foam::messageStream::operator()(const bool output)
{
if (UPstream::warnComm != -1 && communicator != UPstream::warnComm)
if (output && level)
{
Pout<< "** messageStream with comm:" << communicator
<< endl;
error::printStack(Pout);
}
bool collect = (severity_ == INFO || severity_ == WARNING);
if (communicator == UPstream::worldComm)
{
return operator()();
}
else
{
bool master = UPstream::master(communicator);
if (level)
// Report the error
if (collect)
{
bool collect = (severity_ == INFO || severity_ == WARNING);
// Report the error
if (!master && collect)
return Snull;
}
else
{
if (title().size())
{
return Snull;
Pout<< title().c_str();
}
else
if (maxErrors_)
{
if (title().size())
errorCount_++;
if (errorCount_ >= maxErrors_)
{
Pout<< title().c_str();
FatalErrorIn("messageStream::operator OSstream&()")
<< "Too many errors"
<< abort(FatalError);
}
if (maxErrors_)
{
errorCount_++;
if (errorCount_ >= maxErrors_)
{
FatalErrorIn("messageStream::operator OSstream&()")
<< "Too many errors"
<< abort(FatalError);
}
}
return Pout;
}
return Pout;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -134,6 +134,11 @@ public:
return maxErrors_;
}
//- Convert to OSstream
// Prints to Pout for the master stream
OSstream& masterStream(const label communicator);
//- Convert to OSstream
// Prints basic message and returns OSstream for further info.
OSstream& operator()
@ -185,9 +190,8 @@ public:
);
//- Convert to OSstream
// Use Info for default communicator, use Pout
// on master for non-default one.
OSstream& operator()(const label communicator);
// Use Info for default communicator, control output using bool flag
OSstream& operator()(const bool output);
//- Convert to OSstream for << operations
operator OSstream&();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -131,7 +131,7 @@ Foam::solverPerformance Foam::GAMGSolver::solve
if (debug >= 2)
{
solverPerf.print(Info(matrix().mesh().comm()));
solverPerf.print(Info.masterStream(matrix().mesh().comm()));
}
} while
(
@ -631,7 +631,7 @@ void Foam::GAMGSolver::solveCoarsestLevel
//
// if (debug >= 2)
// {
// coarseSolverPerf.print(Info(coarseComm));
// coarseSolverPerf.print(Info.masterStream(coarseComm));
// }
//
// Pout<< "procAgglom: coarsestSource :" << coarsestSource << endl;
@ -679,7 +679,7 @@ void Foam::GAMGSolver::solveCoarsestLevel
if (debug >= 2)
{
coarseSolverPerf.print(Info(coarseComm));
coarseSolverPerf.print(Info.masterStream(coarseComm));
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -132,7 +132,7 @@ Foam::solverPerformance Foam::smoothSolver::solve
if (lduMatrix::debug >= 2)
{
Info(matrix().mesh().comm())
Info.masterStream(matrix().mesh().comm())
<< " Normalisation factor = " << normFactor << endl;
}

View File

@ -34,7 +34,7 @@ License
#include "indexedOctree.H"
#include "treeDataCell.H"
#include "MeshObject.H"
#include "pointMesh.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -1160,6 +1160,7 @@ Foam::tmp<Foam::scalarField> Foam::polyMesh::movePoints
solutionD_ = Vector<label>::zero;
meshObject::movePoints<polyMesh>(*this);
meshObject::movePoints<pointMesh>(*this);
const_cast<Time&>(time()).functionObjects().movePoints(*this);

View File

@ -29,6 +29,7 @@ License
#include "MeshObject.H"
#include "indexedOctree.H"
#include "treeDataCell.H"
#include "pointMesh.H"
// * * * * * * * * * * * * * Private Member Functions * * * * * * * * * * * //
@ -61,6 +62,7 @@ void Foam::polyMesh::clearGeom()
}
// Clear all geometric mesh objects
meshObject::clear<pointMesh, GeometricMeshObject>(*this);
meshObject::clear<polyMesh, GeometricMeshObject>(*this);
primitiveMesh::clearGeom();
@ -108,6 +110,15 @@ void Foam::polyMesh::clearAddressing(const bool isMeshUpdate)
// Part of a mesh update. Keep meshObjects that have an updateMesh
// callback
meshObject::clearUpto
<
pointMesh,
TopologicalMeshObject,
UpdateableMeshObject
>
(
*this
);
meshObject::clearUpto
<
polyMesh,
TopologicalMeshObject,
@ -119,6 +130,7 @@ void Foam::polyMesh::clearAddressing(const bool isMeshUpdate)
}
else
{
meshObject::clear<pointMesh, TopologicalMeshObject>(*this);
meshObject::clear<polyMesh, TopologicalMeshObject>(*this);
}

View File

@ -92,6 +92,7 @@ void Foam::polyMesh::updateMesh(const mapPolyMesh& mpm)
}
meshObject::updateMesh<polyMesh>(*this, mpm);
meshObject::updateMesh<pointMesh>(*this, mpm);
// Reset valid directions (could change by faces put into empty patches)
geometricD_ = Vector<label>::zero;

View File

@ -25,6 +25,7 @@ License
#include "symmetryPlanePolyPatch.H"
#include "addToRunTimeSelectionTable.H"
#include "symmetryPolyPatch.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
@ -131,7 +132,11 @@ const Foam::vector& Foam::symmetryPlanePolyPatch::n() const
if (magSqr(n_ - nf[facei]) > SMALL)
{
FatalErrorIn("symmetryPlanePolyPatch::n()")
<< "Symmetry plane '" << name() << "' is not planar"
<< "Symmetry plane '" << name() << "' is not planar."
<< endl
<< " Either split the patch into planar parts"
<< " or use the " << symmetryPolyPatch::typeName
<< " patch type"
<< exit(FatalError);
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -62,6 +62,7 @@ void Foam::polyPatch::movePoints(PstreamBuffers&, const pointField& p)
void Foam::polyPatch::updateMesh(PstreamBuffers&)
{
clearAddressing();
primitivePatch::clearOut();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -25,6 +25,7 @@ License
#include "fvSchemes.H"
#include "Time.H"
#include "steadyStateDdtScheme.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
@ -108,6 +109,11 @@ void Foam::fvSchemes::read(const dictionary& dict)
)
{
defaultDdtScheme_ = ddtSchemes_.lookup("default");
steady_ =
(
word(defaultDdtScheme_)
== fv::steadyStateDdtScheme<scalar>::typeName
);
}
@ -364,7 +370,8 @@ Foam::fvSchemes::fvSchemes(const objectRegistry& obr)
tokenList()
)()
),
defaultFluxRequired_(false)
defaultFluxRequired_(false),
steady_(false)
{
// persistent settings across reads is incorrect
clear();

View File

@ -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-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -78,6 +78,10 @@ class fvSchemes
dictionary fluxRequired_;
bool defaultFluxRequired_;
//- Steady-state run indicator
// Set true if the default ddtScheme is steadyState
bool steady_;
// Private Member Functions
@ -128,6 +132,18 @@ public:
bool fluxRequired(const word& name) const;
//- Return true if the default ddtScheme is steadyState
bool steady() const
{
return steady_;
}
//- Return true if the default ddtScheme is not steadyState
bool transient() const
{
return !steady_;
}
// Read

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -2348,12 +2348,19 @@ Foam::operator&
GeometricField<Type, fvPatchField, volMesh>& Mphi = tMphi();
// Loop over field components
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
if (M.hasDiag())
{
scalarField psiCmpt(psi.field().component(cmpt));
scalarField boundaryDiagCmpt(M.diag());
M.addBoundaryDiag(boundaryDiagCmpt, cmpt);
Mphi.internalField().replace(cmpt, -boundaryDiagCmpt*psiCmpt);
for (direction cmpt=0; cmpt<pTraits<Type>::nComponents; cmpt++)
{
scalarField psiCmpt(psi.field().component(cmpt));
scalarField boundaryDiagCmpt(M.diag());
M.addBoundaryDiag(boundaryDiagCmpt, cmpt);
Mphi.internalField().replace(cmpt, -boundaryDiagCmpt*psiCmpt);
}
}
else
{
Mphi.internalField() = pTraits<Type>::zero;
}
Mphi.internalField() += M.lduMatrix::H(psi.field()) + M.source();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -60,7 +60,7 @@ Foam::solverPerformance Foam::fvMatrix<Type>::solve
{
if (debug)
{
Info(this->mesh().comm())
Info.masterStream(this->mesh().comm())
<< "fvMatrix<Type>::solve(const dictionary& solverControls) : "
"solving fvMatrix<Type>"
<< endl;
@ -108,7 +108,7 @@ Foam::solverPerformance Foam::fvMatrix<Type>::solveSegregated
{
if (debug)
{
Info(this->mesh().comm())
Info.masterStream(this->mesh().comm())
<< "fvMatrix<Type>::solveSegregated"
"(const dictionary& solverControls) : "
"solving fvMatrix<Type>"
@ -202,7 +202,7 @@ Foam::solverPerformance Foam::fvMatrix<Type>::solveSegregated
if (solverPerformance::debug)
{
solverPerf.print(Info(this->mesh().comm()));
solverPerf.print(Info.masterStream(this->mesh().comm()));
}
solverPerfVec = max(solverPerfVec, solverPerf);
@ -228,7 +228,7 @@ Foam::solverPerformance Foam::fvMatrix<Type>::solveCoupled
{
if (debug)
{
Info(this->mesh().comm())
Info.masterStream(this->mesh().comm())
<< "fvMatrix<Type>::solveCoupled"
"(const dictionary& solverControls) : "
"solving fvMatrix<Type>"
@ -269,7 +269,7 @@ Foam::solverPerformance Foam::fvMatrix<Type>::solveCoupled
if (SolverPerformance<Type>::debug)
{
solverPerf.print(Info(this->mesh().comm()));
solverPerf.print(Info.masterStream(this->mesh().comm()));
}
psi.correctBoundaryConditions();

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -61,7 +61,7 @@ Foam::fvMatrix<Foam::scalar>::solver
{
if (debug)
{
Info(this->mesh().comm())
Info.masterStream(this->mesh().comm())
<< "fvMatrix<scalar>::solver(const dictionary& solverControls) : "
"solver for fvMatrix<scalar>"
<< endl;
@ -120,7 +120,7 @@ Foam::solverPerformance Foam::fvMatrix<Foam::scalar>::fvSolver::solve
if (solverPerformance::debug)
{
solverPerf.print(Info(fvMat_.mesh().comm()));
solverPerf.print(Info.masterStream(fvMat_.mesh().comm()));
}
fvMat_.diag() = saveDiag;
@ -141,7 +141,7 @@ Foam::solverPerformance Foam::fvMatrix<Foam::scalar>::solveSegregated
{
if (debug)
{
Info(this->mesh().comm())
Info.masterStream(this->mesh().comm())
<< "fvMatrix<scalar>::solveSegregated"
"(const dictionary& solverControls) : "
"solving fvMatrix<scalar>"
@ -170,7 +170,7 @@ Foam::solverPerformance Foam::fvMatrix<Foam::scalar>::solveSegregated
if (solverPerformance::debug)
{
solverPerf.print(Info(mesh().comm()));
solverPerf.print(Info.masterStream(mesh().comm()));
}
diag() = saveDiag;

View File

@ -48,7 +48,7 @@ void pointConstraints::makePatchPatchAddressing()
{
Pout<< "pointConstraints::makePatchPatchAddressing() : "
<< "constructing boundary addressing"
<< endl;
<< endl << incrIndent;
}
const pointMesh& pMesh = mesh();
@ -72,7 +72,7 @@ void pointConstraints::makePatchPatchAddressing()
if (debug)
{
Pout<< "On patch:" << pbm[patchi].name()
Pout<< indent << "On patch:" << pbm[patchi].name()
<< " nBoundaryPoints:" << bp.size() << endl;
}
}
@ -80,7 +80,8 @@ void pointConstraints::makePatchPatchAddressing()
if (debug)
{
Pout<< "Found nPatchPatchPoints:" << nPatchPatchPoints << endl;
Pout<< indent << "Found nPatchPatchPoints:" << nPatchPatchPoints
<< endl;
}
@ -137,7 +138,7 @@ void pointConstraints::makePatchPatchAddressing()
if (debug)
{
Pout<< "Have (local) constrained points:"
Pout<< indent << "Have (local) constrained points:"
<< nPatchPatchPoints << endl;
}
@ -224,7 +225,7 @@ void pointConstraints::makePatchPatchAddressing()
if (iter == patchPatchPointSet.end())
{
//Pout<< "on meshpoint:" << meshPointI
//Pout<< indent << "on meshpoint:" << meshPointI
// << " coupled:" << coupledPointI
// << " at:" << mesh.points()[meshPointI]
// << " have new constraint:"
@ -242,7 +243,7 @@ void pointConstraints::makePatchPatchAddressing()
}
else
{
//Pout<< "on meshpoint:" << meshPointI
//Pout<< indent << "on meshpoint:" << meshPointI
// << " coupled:" << coupledPointI
// << " at:" << mesh.points()[meshPointI]
// << " have possibly extended constraint:"
@ -271,7 +272,7 @@ void pointConstraints::makePatchPatchAddressing()
if (debug)
{
Pout<< "Have (global) constrained points:"
Pout<< indent << "Have (global) constrained points:"
<< nPatchPatchPoints << endl;
}
@ -303,7 +304,7 @@ void pointConstraints::makePatchPatchAddressing()
if (debug)
{
Pout<< "Have non-trivial constrained points:"
Pout<< indent << "Have non-trivial constrained points:"
<< nConstraints << endl;
}
@ -314,7 +315,8 @@ void pointConstraints::makePatchPatchAddressing()
if (debug)
{
Pout<< "pointConstraints::makePatchPatchAddressing() : "
Pout<< decrIndent
<< "pointConstraints::makePatchPatchAddressing() : "
<< "finished constructing boundary addressing"
<< endl;
}
@ -327,6 +329,13 @@ pointConstraints::pointConstraints(const pointMesh& pm)
:
MeshObject<pointMesh, Foam::UpdateableMeshObject, pointConstraints>(pm)
{
if (debug)
{
Pout<< "pointConstraints::pointConstraints(const pointMesh&): "
<< "Constructing from pointMesh " << pm.name()
<< endl;
}
makePatchPatchAddressing();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -98,7 +98,7 @@ void Foam::CellZoneInjection<CloudType>::setPositions
injectorCells.append(cellI);
injectorTetFaces.append(cellTetIs[tetI].face());
injectorTetPts.append(cellTetIs[tetI].faceBasePt());
injectorTetPts.append(cellTetIs[tetI].tetPt());
}
}
@ -240,7 +240,7 @@ void Foam::CellZoneInjection<CloudType>::updateMesh()
Info<< " cell zone size = " << nCellsTotal << endl;
Info<< " cell zone volume = " << VCellsTotal << endl;
if ((nCells == 0) || (VCellsTotal*numberDensity_ < 1))
if ((nCellsTotal == 0) || (VCellsTotal*numberDensity_ < 1))
{
WarningIn("Foam::CellZoneInjection<CloudType>::updateMesh()")
<< "Number of particles to be added to cellZone " << cellZoneName_

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -91,7 +91,8 @@ Foam::AveragingMethod<Type>::New
(
"Foam::AveragingMethod<Type>::New"
"("
"const dictionary&"
"const IOobject&, "
"const dictionary&, "
"const fvMesh&"
")"
) << "Unknown averaging method " << averageType
@ -243,10 +244,10 @@ bool Foam::AveragingMethod<Type>::write() const
pointGrad.internalField() /= pointVolume;
// write
if(!cellValue.write()) return false;
if(!cellGrad.write()) return false;
if(!pointValue.write()) return false;
if(!pointGrad.write()) return false;
if (!cellValue.write()) return false;
if (!cellGrad.write()) return false;
if (!pointValue.write()) return false;
if (!pointGrad.write()) return false;
return true;
}

View File

@ -123,7 +123,7 @@ void Foam::AveragingMethods::Dual<Type>::tetGeometry
tetIs.tet(this->mesh_).barycentric(position, tetCoordinates_);
tetCoordinates_ = max(tetCoordinates_, 0.0);
tetCoordinates_ = max(tetCoordinates_, scalar(0));
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -58,7 +58,7 @@ namespace AveragingMethods
{
/*---------------------------------------------------------------------------*\
Class Dual Declaration
Class Dual Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -55,7 +55,7 @@ namespace AveragingMethods
{
/*---------------------------------------------------------------------------*\
Class Moment Declaration
Class Moment Declaration
\*---------------------------------------------------------------------------*/
template<class Type>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -69,7 +69,6 @@ Foam::CorrectionLimitingMethod::New
(
"CorrectionLimitingMethod::New"
"("
"const word&, "
"const dictionary&"
")"
) << "Unknown correction limiter type " << modelType

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,7 +45,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class CorrectionLimitingMethod Declaration
Class CorrectionLimitingMethod Declaration
\*---------------------------------------------------------------------------*/
class CorrectionLimitingMethod

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -50,7 +50,7 @@ namespace CorrectionLimitingMethods
{
/*---------------------------------------------------------------------------*\
Class absolute Declaration
Class absolute Declaration
\*---------------------------------------------------------------------------*/
class absolute

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -44,7 +44,7 @@ namespace CorrectionLimitingMethods
{
/*---------------------------------------------------------------------------*\
Class noCorrectionLimiting Declaration
Class noCorrectionLimiting Declaration
\*---------------------------------------------------------------------------*/
class noCorrectionLimiting

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -50,7 +50,7 @@ namespace CorrectionLimitingMethods
{
/*---------------------------------------------------------------------------*\
Class relative Declaration
Class relative Declaration
\*---------------------------------------------------------------------------*/
class relative

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -51,7 +51,7 @@ namespace Foam
class TimeScaleModel;
/*---------------------------------------------------------------------------*\
Class IsotropyModel Declaration
Class IsotropyModel Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>
@ -129,27 +129,27 @@ public:
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#define makeIsotropyModel(CloudType) \
#define makeIsotropyModel(CloudType) \
\
typedef CloudType::MPPICCloudType MPPICCloudType; \
defineNamedTemplateTypeNameAndDebug \
( \
IsotropyModel<MPPICCloudType>, \
IsotropyModel<MPPICCloudType>, \
0 \
); \
defineTemplateRunTimeSelectionTable \
( \
IsotropyModel<MPPICCloudType>, \
IsotropyModel<MPPICCloudType>, \
dictionary \
);
#define makeIsotropyModelType(SS, CloudType) \
#define makeIsotropyModelType(SS, CloudType) \
\
typedef CloudType::MPPICCloudType MPPICCloudType; \
defineNamedTemplateTypeNameAndDebug(SS<MPPICCloudType>, 0); \
\
IsotropyModel<MPPICCloudType>:: \
IsotropyModel<MPPICCloudType>:: \
adddictionaryConstructorToTable<SS<MPPICCloudType> > \
add##SS##CloudType##MPPICCloudType##ConstructorToTable_;

View File

@ -198,16 +198,6 @@ void Foam::PackingModels::Implicit<CloudType>::cacheFields(const bool store)
alphaEqn.solve();
//// updated stress
//tauPrime.internalField() =
// this->particleStressModel_->tauPrime
// (
// alpha_.internalField(),
// rho.internalField(),
// uSqrAverage.internalField()
// )();
//tauPrime.correctBoundaryConditions();
// Generate correction fields
// ~~~~~~~~~~~~~~~~~
@ -229,8 +219,6 @@ void Foam::PackingModels::Implicit<CloudType>::cacheFields(const bool store)
(
cloudName + ":uCorrect",
fvc::reconstruct(phiCorrect_())
// - deltaT*fvc::grad(tauPrime)/(rho*alpha_)
// + (applyGravity_ ? deltaT*g*(1.0 - rhoc/rho) : 0.0)
)
);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -50,7 +50,7 @@ namespace PackingModels
{
/*---------------------------------------------------------------------------*\
Class Implicit Declaration
Class Implicit Declaration
\*---------------------------------------------------------------------------*/
template<class CloudType>

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -45,7 +45,7 @@ namespace Foam
{
/*---------------------------------------------------------------------------*\
Class ParticleStressModel Declaration
Class ParticleStressModel Declaration
\*---------------------------------------------------------------------------*/
class ParticleStressModel

View File

@ -85,9 +85,9 @@ Foam::TimeScaleModels::equilibrium::oneByTau
16.0/sqrt(3.0*constant::mathematical::pi)
*0.25*(1.0 - e_*e_);
return
return
a
*alpha*sqrt(max(uSqr, 0.0))/max(r32, SMALL)
*alpha*sqrt(max(uSqr, scalar(0)))/max(r32, SMALL)
*alphaPacked_/max(alphaPacked_ - alpha, SMALL);
}

View File

@ -3508,7 +3508,7 @@ void Foam::autoLayerDriver::addLayers
meshRefiner_.updateMesh(map, labelList(0));
// Update numbering of faceWantedThickness
meshRefinement::updateList(map().faceMap(), 0.0, faceWantedThickness);
meshRefinement::updateList(map().faceMap(), scalar(0), faceWantedThickness);
// Update numbering on baffles
forAll(baffles, i)

View File

@ -35,7 +35,6 @@ License
#include "fvMeshDistribute.H"
#include "polyTopoChange.H"
#include "mapDistributePolyMesh.H"
#include "featureEdgeMesh.H"
#include "Cloud.H"
//#include "globalIndex.H"
#include "OBJstream.H"
@ -358,7 +357,7 @@ void Foam::meshRefinement::markFeatureCellLevel
forAll(features_, featI)
{
const featureEdgeMesh& featureMesh = features_[featI];
const edgeMesh& featureMesh = features_[featI];
const label featureLevel = features_.levels()[featI][0];
const labelListList& pointEdges = featureMesh.pointEdges();
@ -505,7 +504,7 @@ void Foam::meshRefinement::markFeatureCellLevel
label featI = startTp.i();
label pointI = startTp.j();
const featureEdgeMesh& featureMesh = features_[featI];
const edgeMesh& featureMesh = features_[featI];
const labelList& pEdges = featureMesh.pointEdges()[pointI];
// Now shoot particles down all pEdges.
@ -561,7 +560,7 @@ void Foam::meshRefinement::markFeatureCellLevel
label featI = tp.i();
label pointI = tp.j();
const featureEdgeMesh& featureMesh = features_[featI];
const edgeMesh& featureMesh = features_[featI];
const labelList& pEdges = featureMesh.pointEdges()[pointI];
// Particle now at pointI. Check connected edges to see which one

View File

@ -186,7 +186,7 @@ void Foam::refinementFeatures::read
set(featI, new extendedFeatureEdgeMesh(featObj, eeMesh));
}
const edgeMesh& eMesh = operator[](featI);
const extendedEdgeMesh& eMesh = operator[](featI);
//eMesh.mergePoints(meshRefiner_.mergeDistance());
@ -258,13 +258,9 @@ void Foam::refinementFeatures::read
}
void Foam::refinementFeatures::buildTrees
(
const label featI,
const labelList& featurePoints
)
void Foam::refinementFeatures::buildTrees(const label featI)
{
const edgeMesh& eMesh = operator[](featI);
const extendedEdgeMesh& eMesh = operator[](featI);
const pointField& points = eMesh.points();
const edgeList& edges = eMesh.edges();
@ -299,6 +295,9 @@ void Foam::refinementFeatures::buildTrees
)
);
labelList featurePoints(identity(eMesh.nonFeatureStart()));
pointTrees_.set
(
featI,
@ -408,24 +407,7 @@ Foam::refinementFeatures::refinementFeatures
// Search engines
forAll(*this, i)
{
const extendedEdgeMesh& eMesh = operator[](i);
const labelListList& pointEdges = eMesh.pointEdges();
DynamicList<label> featurePoints;
forAll(pointEdges, pointI)
{
if (pointEdges[pointI].size() > 2)
{
featurePoints.append(pointI);
}
}
Info<< "Detected " << featurePoints.size()
<< " featurePoints out of " << pointEdges.size()
<< " points on feature " << operator[](i).name()
<< endl;
buildTrees(i, featurePoints);
buildTrees(i);
}
}

View File

@ -76,7 +76,7 @@ private:
void read(const objectRegistry&, const PtrList<dictionary>&);
//- Build edge tree and feature point tree
void buildTrees(const label, const labelList&);
void buildTrees(const label);
//- Find shell level higher than ptLevel
void findHigherLevel

View File

@ -90,27 +90,36 @@ Foam::trackedParticle::trackedParticle
bool Foam::trackedParticle::move
(
trackingData& td,
const scalar trackedParticle
const scalar trackTime
)
{
td.switchProcessor = false;
td.keepParticle = true;
scalar tEnd = (1.0 - stepFraction())*trackedParticle;
scalar tEnd = (1.0 - stepFraction())*trackTime;
scalar dtMax = tEnd;
while (td.keepParticle && !td.switchProcessor && tEnd > SMALL)
if (tEnd <= SMALL)
{
// set the lagrangian time-step
scalar dt = min(dtMax, tEnd);
// Remove the particle
td.keepParticle = false;
}
else
{
td.keepParticle = true;
// mark visited cell with max level.
td.maxLevel()[cell()] = max(td.maxLevel()[cell()], level_);
while (td.keepParticle && !td.switchProcessor && tEnd > SMALL)
{
// set the lagrangian time-step
scalar dt = min(dtMax, tEnd);
dt *= trackToFace(end_, td);
// mark visited cell with max level.
td.maxLevel()[cell()] = max(td.maxLevel()[cell()], level_);
tEnd -= dt;
stepFraction() = 1.0 - tEnd/trackedParticle;
dt *= trackToFace(end_, td);
tEnd -= dt;
stepFraction() = 1.0 - tEnd/trackTime;
}
}
return td.keepParticle;

View File

@ -91,10 +91,10 @@ void Foam::cyclicACMIPolyPatch::resetAMI
);
srcMask_ =
min(1.0 - tolerance_, max(tolerance_, AMI().srcWeightsSum()));
min(scalar(1) - tolerance_, max(tolerance_, AMI().srcWeightsSum()));
tgtMask_ =
min(1.0 - tolerance_, max(tolerance_, AMI().tgtWeightsSum()));
min(scalar(1) - tolerance_, max(tolerance_, AMI().tgtWeightsSum()));
forAll(Sf, faceI)
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -92,7 +92,7 @@ void Foam::removeRegisteredObject::execute()
void Foam::removeRegisteredObject::end()
{
// Do nothing - only valid on execute
execute();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -195,7 +195,7 @@ void Foam::writeDictionary::execute()
void Foam::writeDictionary::end()
{
// do nothing
execute();
}

View File

@ -34,9 +34,6 @@ streamLine/streamLineParticle.C
streamLine/streamLineParticleCloud.C
streamLine/streamLineFunctionObject.C
turbulenceFields/turbulenceFields.C
turbulenceFields/turbulenceFieldsFunctionObject.C
wallBoundedStreamLine/wallBoundedStreamLine.C
wallBoundedStreamLine/wallBoundedStreamLineFunctionObject.C
wallBoundedStreamLine/wallBoundedStreamLineParticle.C

View File

@ -3,11 +3,7 @@ EXE_INC = \
-I$(LIB_SRC)/meshTools/lnInclude \
-I$(LIB_SRC)/lagrangian/basic/lnInclude \
-I$(LIB_SRC)/fileFormats/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude \
-I$(LIB_SRC)/sampling/lnInclude \
-I$(LIB_SRC)/transportModels \
-I$(LIB_SRC)/turbulenceModels \
-I$(LIB_SRC)/thermophysicalModels/basic/lnInclude \
-I$(LIB_SRC)/surfMesh/lnInclude
LIB_LIBS = \
@ -16,8 +12,5 @@ LIB_LIBS = \
-lsurfMesh \
-llagrangian \
-lfileFormats \
-lsurfMesh \
-lsampling \
-lincompressibleTransportModels \
-lcompressibleTurbulenceModel \
-lincompressibleTurbulenceModel
-lsurfMesh

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -111,8 +111,6 @@ void Foam::fieldAverage::calcAverages()
initialize();
}
Info<< type() << " " << name_ << " output:" << nl;
const label currentTimeIndex =
static_cast<const fvMesh&>(obr_).time().timeIndex();
@ -125,6 +123,8 @@ void Foam::fieldAverage::calcAverages()
prevTimeIndex_ = currentTimeIndex;
}
Info<< type() << " " << name_ << " output:" << nl;
Info<< " Calculating averages" << nl;
addMeanSqrToPrime2Mean<scalar, scalar>();
@ -317,14 +317,19 @@ void Foam::fieldAverage::execute()
if (active_)
{
calcAverages();
Info<< endl;
}
}
void Foam::fieldAverage::end()
{}
{
if (active_)
{
calcAverages();
Info<< endl;
}
}
void Foam::fieldAverage::timeSet()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -115,7 +115,10 @@ void Foam::fieldCoordinateSystemTransform::execute()
void Foam::fieldCoordinateSystemTransform::end()
{
// Do nothing
if (active_)
{
execute();
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -159,10 +159,7 @@ void Foam::fieldMinMax::write()
{
functionObjectFile::write();
if (log_)
{
Info<< type() << " " << name_ << " output:" << nl;
}
Info(log_)<< type() << " " << name_ << " output:" << nl;
forAll(fieldSet_, fieldI)
{
@ -173,10 +170,7 @@ void Foam::fieldMinMax::write()
calcMinMaxFields<tensor>(fieldSet_[fieldI], mode_);
}
if (log_)
{
Info<< endl;
}
Info(log_)<< endl;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -139,6 +139,20 @@ protected:
// Private Member Functions
//- Helper function to write the output
template<class Type>
void output
(
const word& fieldName,
const word& outputName,
const vector& minC,
const vector& maxC,
const label minProcI,
const label maxProcI,
const Type& minValue,
const Type& maxValue
);
//- Disallow default bitwise copy construct
fieldMinMax(const fieldMinMax&);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -31,6 +31,62 @@ License
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
template<class Type>
void Foam::fieldMinMax::output
(
const word& fieldName,
const word& outputName,
const vector& minC,
const vector& maxC,
const label minProcI,
const label maxProcI,
const Type& minValue,
const Type& maxValue
)
{
file()<< obr_.time().value();
writeTabbed(file(), fieldName);
file()
<< token::TAB << minValue
<< token::TAB << minC;
if (Pstream::parRun())
{
file()<< token::TAB << minProcI;
}
file()
<< token::TAB << maxValue
<< token::TAB << maxC;
if (Pstream::parRun())
{
file()<< token::TAB << maxProcI;
}
file() << endl;
Info(log_)<< " min(" << outputName << ") = "
<< minValue << " at position " << minC;
if (Pstream::parRun())
{
Info(log_)<< " on processor " << minProcI;
}
Info(log_)<< nl << " max(" << outputName << ") = "
<< maxValue << " at position " << maxC;
if (Pstream::parRun())
{
Info(log_)<< " on processor " << maxProcI;
}
Info(log_)<< endl;
}
template<class Type>
void Foam::fieldMinMax::calcMinMaxFields
(
@ -111,49 +167,17 @@ void Foam::fieldMinMax::calcMinMaxFields
scalar maxValue = maxVs[maxI];
const vector& maxC = maxCs[maxI];
file()<< obr_.time().value();
writeTabbed(file(), fieldName);
file()
<< token::TAB << minValue
<< token::TAB << minC;
if (Pstream::parRun())
{
file()<< token::TAB << minI;
}
file()
<< token::TAB << maxValue
<< token::TAB << maxC;
if (Pstream::parRun())
{
file()<< token::TAB << maxI;
}
file() << endl;
if (log_)
{
Info<< " min(mag(" << fieldName << ")) = "
<< minValue << " at position " << minC;
if (Pstream::parRun())
{
Info<< " on processor " << minI;
}
Info<< nl << " max(mag(" << fieldName << ")) = "
<< maxValue << " at position " << maxC;
if (Pstream::parRun())
{
Info<< " on processor " << maxI;
}
Info<< endl;
}
output
(
fieldName,
word("mag(" + fieldName + ")"),
minC,
maxC,
minI,
maxI,
minValue,
maxValue
);
}
break;
}
@ -216,49 +240,17 @@ void Foam::fieldMinMax::calcMinMaxFields
Type maxValue = maxVs[maxI];
const vector& maxC = maxCs[maxI];
file()<< obr_.time().value();
writeTabbed(file(), fieldName);
file()
<< token::TAB << minValue
<< token::TAB << minC;
if (Pstream::parRun())
{
file()<< token::TAB << minI;
}
file()
<< token::TAB << maxValue
<< token::TAB << maxC;
if (Pstream::parRun())
{
file()<< token::TAB << maxI;
}
file() << endl;
if (log_)
{
Info<< " min(" << fieldName << ") = "
<< minValue << " at position " << minC;
if (Pstream::parRun())
{
Info<< " on processor " << minI;
}
Info<< nl << " max(" << fieldName << ") = "
<< maxValue << " at position " << maxC;
if (Pstream::parRun())
{
Info<< " on processor " << maxI;
}
Info<< endl;
}
output
(
fieldName,
fieldName,
minC,
maxC,
minI,
maxI,
minValue,
maxValue
);
}
break;
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -245,10 +245,7 @@ void Foam::fieldValues::cellSource::write()
file()<< endl;
}
if (log_)
{
Info<< endl;
}
Info(log_)<< endl;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -200,12 +200,9 @@ bool Foam::fieldValues::cellSource::writeValues(const word& fieldName)
file()<< tab << result;
if (log_)
{
Info<< " " << operationTypeNames_[operation_]
<< "(" << sourceName_ << ") for " << fieldName
<< " = " << result << endl;
}
Info(log_)<< " " << operationTypeNames_[operation_]
<< "(" << sourceName_ << ") for " << fieldName
<< " = " << result << endl;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -663,10 +663,7 @@ void Foam::fieldValues::faceSource::write()
file()<< endl;
}
if (log_)
{
Info<< endl;
}
Info(log_)<< endl;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -344,12 +344,9 @@ bool Foam::fieldValues::faceSource::writeValues(const word& fieldName)
file()<< tab << result;
if (log_)
{
Info<< " " << operationTypeNames_[operation_]
<< "(" << sourceName_ << ") for " << fieldName
<< " = " << result << endl;
}
Info(log_)<< " " << operationTypeNames_[operation_]
<< "(" << sourceName_ << ") for " << fieldName
<< " = " << result << endl;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -58,10 +58,7 @@ void Foam::fieldValue::write()
{
functionObjectFile::write();
if (log_)
{
Info<< type() << " " << name_ << " output:" << nl;
}
Info(log_)<< type() << " " << name_ << " output:" << nl;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -158,10 +158,7 @@ void Foam::fieldValues::fieldValueDelta::write()
file()<< obr_.time().value();
}
if (log_)
{
Info<< type() << " " << name_ << " output:" << endl;
}
Info(log_)<< type() << " " << name_ << " output:" << endl;
bool found = false;
processFields<scalar>(found);

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -114,12 +114,9 @@ void Foam::fieldValues::fieldValueDelta::processFields(bool& found)
Type result = applyOperation(r1, r2);
if (log_)
{
Info<< " " << operationTypeNames_[operation_]
<< "(" << fieldName << ") = " << result
<< endl;
}
Info(log_)<< " " << operationTypeNames_[operation_]
<< "(" << fieldName << ") = " << result
<< endl;
if (Pstream::master())
{

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -374,6 +374,11 @@ void Foam::nearWallFields::end()
{
Info<< "nearWallFields:end()" << endl;
}
if (active_)
{
execute();
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -122,7 +122,10 @@ void Foam::processorField::execute()
void Foam::processorField::end()
{
// Do nothing
if (active_)
{
execute();
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -91,36 +91,42 @@ void Foam::readFields::read(const dictionary& dict)
void Foam::readFields::execute()
{
//Info<< type() << " " << name_ << ":" << nl;
// Clear out any previously loaded fields
vsf_.clear();
vvf_.clear();
vSpheretf_.clear();
vSymmtf_.clear();
vtf_.clear();
ssf_.clear();
svf_.clear();
sSpheretf_.clear();
sSymmtf_.clear();
stf_.clear();
forAll(fieldSet_, fieldI)
if (active_)
{
// If necessary load field
loadField<scalar>(fieldSet_[fieldI], vsf_, ssf_);
loadField<vector>(fieldSet_[fieldI], vvf_, svf_);
loadField<sphericalTensor>(fieldSet_[fieldI], vSpheretf_, sSpheretf_);
loadField<symmTensor>(fieldSet_[fieldI], vSymmtf_, sSymmtf_);
loadField<tensor>(fieldSet_[fieldI], vtf_, stf_);
// Clear out any previously loaded fields
vsf_.clear();
vvf_.clear();
vSpheretf_.clear();
vSymmtf_.clear();
vtf_.clear();
ssf_.clear();
svf_.clear();
sSpheretf_.clear();
sSymmtf_.clear();
stf_.clear();
forAll(fieldSet_, fieldI)
{
const word& fieldName = fieldSet_[fieldI];
// If necessary load field
loadField<scalar>(fieldName, vsf_, ssf_);
loadField<vector>(fieldName, vvf_, svf_);
loadField<sphericalTensor>(fieldName, vSpheretf_, sSpheretf_);
loadField<symmTensor>(fieldName, vSymmtf_, sSymmtf_);
loadField<tensor>(fieldName, vtf_, stf_);
}
}
}
void Foam::readFields::end()
{
execute();
if (active_)
{
execute();
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -114,7 +114,10 @@ void Foam::surfaceInterpolateFields::execute()
void Foam::surfaceInterpolateFields::end()
{
// Do nothing
if (active_)
{
execute();
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -227,15 +227,12 @@ void Foam::forceCoeffs::write()
<< obr_.time().value() << tab << Cm << tab << Cd
<< tab << Cl << tab << Clf << tab << Clr << endl;
if (log_)
{
Info<< type() << " " << name_ << " output:" << nl
<< " Cm = " << Cm << nl
<< " Cd = " << Cd << nl
<< " Cl = " << Cl << nl
<< " Cl(f) = " << Clf << nl
<< " Cl(r) = " << Clr << endl;
}
Info(log_)<< type() << " " << name_ << " output:" << nl
<< " Cm = " << Cm << nl
<< " Cd = " << Cd << nl
<< " Cl = " << Cl << nl
<< " Cl(f) = " << Clf << nl
<< " Cl(r) = " << Clr << endl;
if (nBin_ > 1)
{
@ -262,10 +259,7 @@ void Foam::forceCoeffs::write()
file(1) << endl;
}
if (log_)
{
Info<< endl;
}
Info(log_)<< endl;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -391,19 +391,17 @@ void Foam::forces::applyBins
void Foam::forces::writeForces()
{
if (log_)
{
Info<< type() << " " << name_ << " output:" << nl
<< " sum of forces:" << nl
<< " pressure : " << sum(force_[0]) << nl
<< " viscous : " << sum(force_[1]) << nl
<< " porous : " << sum(force_[2]) << nl
<< " sum of moments:" << nl
<< " pressure : " << sum(moment_[0]) << nl
<< " viscous : " << sum(moment_[1]) << nl
<< " porous : " << sum(moment_[2])
<< endl;
}
Info(log_)
<< type() << " " << name_ << " output:" << nl
<< " sum of forces:" << nl
<< " pressure : " << sum(force_[0]) << nl
<< " viscous : " << sum(force_[1]) << nl
<< " porous : " << sum(force_[2]) << nl
<< " sum of moments:" << nl
<< " pressure : " << sum(moment_[0]) << nl
<< " viscous : " << sum(moment_[1]) << nl
<< " porous : " << sum(moment_[2])
<< endl;
file(0) << obr_.time().value() << tab << setw(1) << '['
<< sum(force_[0]) << setw(1) << ','
@ -642,10 +640,7 @@ void Foam::forces::read(const dictionary& dict)
log_ = dict.lookupOrDefault<Switch>("log", false);
if (log_)
{
Info<< type() << " " << name_ << ":" << nl;
}
Info(log_)<< type() << " " << name_ << ":" << nl;
directForceDensity_ = dict.lookupOrDefault("directForceDensity", false);
@ -809,10 +804,7 @@ void Foam::forces::write()
writeBins();
if (log_)
{
Info<< endl;
}
Info(log_)<< endl;
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -154,7 +154,10 @@ void Foam::calcFvcDiv::execute()
void Foam::calcFvcDiv::end()
{
// Do nothing
if (active_)
{
execute();
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -116,7 +116,10 @@ void Foam::calcFvcGrad::execute()
void Foam::calcFvcGrad::end()
{
// Do nothing
if (active_)
{
execute();
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -119,7 +119,10 @@ void Foam::calcMag::execute()
void Foam::calcMag::end()
{
// Do nothing
if (active_)
{
execute();
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -185,7 +185,10 @@ void Foam::CourantNo::execute()
void Foam::CourantNo::end()
{
// Do nothing
if (active_)
{
execute();
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -142,10 +142,7 @@ void Foam::DESModelRegions::execute()
const fvMesh& mesh = refCast<const fvMesh>(obr_);
if (log_)
{
Info<< type() << " " << name_ << " output:" << nl;
}
Info(log_)<< type() << " " << name_ << " output:" << nl;
volScalarField& DESModelRegions =
const_cast<volScalarField&>
@ -196,19 +193,14 @@ void Foam::DESModelRegions::execute()
<< endl;
}
if (log_)
{
Info<< " LES = " << prc << " % (volume)" << nl
<< " RAS = " << 100.0 - prc << " % (volume)" << endl;
}
Info(log_)
<< " LES = " << prc << " % (volume)" << nl
<< " RAS = " << 100.0 - prc << " % (volume)" << endl;
}
else
{
if (log_)
{
Info<< " No DES turbulence model found in database" << nl
<< endl;
}
Info(log_)<< " No DES turbulence model found in database" << nl
<< endl;
}
}
}
@ -216,7 +208,10 @@ void Foam::DESModelRegions::execute()
void Foam::DESModelRegions::end()
{
// Do nothing
if (active_)
{
execute();
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -144,7 +144,10 @@ void Foam::Lambda2::execute()
void Foam::Lambda2::end()
{
// Do nothing
if (active_)
{
execute();
}
}

View File

@ -30,6 +30,9 @@ scalarTransport/scalarTransportFunctionObject.C
timeActivatedFileUpdate/timeActivatedFileUpdate.C
timeActivatedFileUpdate/timeActivatedFileUpdateFunctionObject.C
turbulenceFields/turbulenceFields.C
turbulenceFields/turbulenceFieldsFunctionObject.C
wallShearStress/wallShearStress.C
wallShearStress/wallShearStressFunctionObject.C

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -197,7 +197,10 @@ void Foam::Peclet::execute()
void Foam::Peclet::end()
{
// Do nothing
if (active_)
{
execute();
}
}
void Foam::Peclet::timeSet()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -137,7 +137,10 @@ void Foam::Q::execute()
void Foam::Q::end()
{
// Do nothing
if (active_)
{
execute();
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -101,7 +101,10 @@ void Foam::blendingFactor::execute()
void Foam::blendingFactor::end()
{
// Do nothing
if (active_)
{
execute();
}
}
void Foam::blendingFactor::timeSet()

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -309,7 +309,10 @@ void Foam::pressureTools::execute()
void Foam::pressureTools::end()
{
// Do nothing
if (active_)
{
execute();
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -214,92 +214,97 @@ void Foam::scalarTransport::read(const dictionary& dict)
void Foam::scalarTransport::execute()
{
Info<< type() << " output:" << endl;
const surfaceScalarField& phi =
mesh_.lookupObject<surfaceScalarField>(phiName_);
// calculate the diffusivity
volScalarField DT(this->DT(phi));
// set schemes
word schemeVar = T_.name();
if (autoSchemes_)
if (active_)
{
schemeVar = UName_;
}
Info<< type() << " output:" << endl;
word divScheme("div(phi," + schemeVar + ")");
word laplacianScheme("laplacian(" + DT.name() + "," + schemeVar + ")");
const surfaceScalarField& phi =
mesh_.lookupObject<surfaceScalarField>(phiName_);
// set under-relaxation coeff
scalar relaxCoeff = 0.0;
if (mesh_.relaxEquation(schemeVar))
{
relaxCoeff = mesh_.equationRelaxationFactor(schemeVar);
}
// calculate the diffusivity
volScalarField DT(this->DT(phi));
if (phi.dimensions() == dimMass/dimTime)
{
const volScalarField& rho =
mesh_.lookupObject<volScalarField>(rhoName_);
// solve
for (label i = 0; i <= nCorr_; i++)
// set schemes
word schemeVar = T_.name();
if (autoSchemes_)
{
fvScalarMatrix TEqn
(
fvm::ddt(rho, T_)
+ fvm::div(phi, T_, divScheme)
- fvm::laplacian(DT, T_, laplacianScheme)
==
fvOptions_(rho, T_)
);
TEqn.relax(relaxCoeff);
fvOptions_.constrain(TEqn);
TEqn.solve(mesh_.solverDict(schemeVar));
schemeVar = UName_;
}
}
else if (phi.dimensions() == dimVolume/dimTime)
{
// solve
for (label i = 0; i <= nCorr_; i++)
word divScheme("div(phi," + schemeVar + ")");
word laplacianScheme("laplacian(" + DT.name() + "," + schemeVar + ")");
// set under-relaxation coeff
scalar relaxCoeff = 0.0;
if (mesh_.relaxEquation(schemeVar))
{
fvScalarMatrix TEqn
(
fvm::ddt(T_)
+ fvm::div(phi, T_, divScheme)
- fvm::laplacian(DT, T_, laplacianScheme)
==
fvOptions_(T_)
);
TEqn.relax(relaxCoeff);
fvOptions_.constrain(TEqn);
TEqn.solve(mesh_.solverDict(schemeVar));
relaxCoeff = mesh_.equationRelaxationFactor(schemeVar);
}
}
else
{
FatalErrorIn("void Foam::scalarTransport::execute()")
<< "Incompatible dimensions for phi: " << phi.dimensions() << nl
<< "Dimensions should be " << dimMass/dimTime << " or "
<< dimVolume/dimTime << endl;
}
if (phi.dimensions() == dimMass/dimTime)
{
const volScalarField& rho =
mesh_.lookupObject<volScalarField>(rhoName_);
Info<< endl;
// solve
for (label i = 0; i <= nCorr_; i++)
{
fvScalarMatrix TEqn
(
fvm::ddt(rho, T_)
+ fvm::div(phi, T_, divScheme)
- fvm::laplacian(DT, T_, laplacianScheme)
==
fvOptions_(rho, T_)
);
TEqn.relax(relaxCoeff);
fvOptions_.constrain(TEqn);
TEqn.solve(mesh_.solverDict(schemeVar));
}
}
else if (phi.dimensions() == dimVolume/dimTime)
{
// solve
for (label i = 0; i <= nCorr_; i++)
{
fvScalarMatrix TEqn
(
fvm::ddt(T_)
+ fvm::div(phi, T_, divScheme)
- fvm::laplacian(DT, T_, laplacianScheme)
==
fvOptions_(T_)
);
TEqn.relax(relaxCoeff);
fvOptions_.constrain(TEqn);
TEqn.solve(mesh_.solverDict(schemeVar));
}
}
else
{
FatalErrorIn("void Foam::scalarTransport::execute()")
<< "Incompatible dimensions for phi: " << phi.dimensions() << nl
<< "Dimensions should be " << dimMass/dimTime << " or "
<< dimVolume/dimTime << endl;
}
Info<< endl;
}
}
void Foam::scalarTransport::end()
{
// Do nothing
if (active_)
{
execute();
}
}

View File

@ -43,9 +43,6 @@ SourceFiles
scalarTransport.C
IOscalarTransport.H
SeeAlso
Foam::basicSourceList
\*---------------------------------------------------------------------------*/
#ifndef scalarTransport_H

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2011-2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -132,7 +132,10 @@ void Foam::timeActivatedFileUpdate::execute()
void Foam::timeActivatedFileUpdate::end()
{
// Do nothing
if (active_)
{
execute();
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -257,7 +257,10 @@ void Foam::turbulenceFields::execute()
void Foam::turbulenceFields::end()
{
// Do nothing
if (active_)
{
execute();
}
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2012 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2012-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -82,11 +82,8 @@ void Foam::wallShearStress::calcShearStress
<< endl;
}
if (log_)
{
Info<< " min/max(" << pp.name() << ") = "
<< minSsp << ", " << maxSsp << endl;
}
Info(log_)<< " min/max(" << pp.name() << ") = "
<< minSsp << ", " << maxSsp << endl;
}
}
@ -240,10 +237,7 @@ void Foam::wallShearStress::execute()
mesh.lookupObject<volVectorField>(type())
);
if (log_)
{
Info<< type() << " " << name_ << " output:" << nl;
}
Info(log_)<< type() << " " << name_ << " output:" << nl;
tmp<volSymmTensorField> Reff;
@ -275,7 +269,10 @@ void Foam::wallShearStress::execute()
void Foam::wallShearStress::end()
{
// Do nothing
if (active_)
{
execute();
}
}
@ -294,12 +291,9 @@ void Foam::wallShearStress::write()
const volVectorField& wallShearStress =
obr_.lookupObject<volVectorField>(type());
if (log_)
{
Info<< type() << " " << name_ << " output:" << nl
<< " writing field " << wallShearStress.name() << nl
<< endl;
}
Info(log_)<< type() << " " << name_ << " output:" << nl
<< " writing field " << wallShearStress.name() << nl
<< endl;
wallShearStress.write();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -94,15 +94,12 @@ void Foam::yPlusLES::calcIncompressibleYPlus
scalar maxYp = gMax(Yp);
scalar avgYp = gAverage(Yp);
if (log_)
{
Info<< " patch " << currPatch.name()
<< " y+ : min = " << minYp << ", max = " << maxYp
<< ", average = " << avgYp << nl;
}
if (Pstream::master())
{
Info(log_)<< " patch " << currPatch.name()
<< " y+ : min = " << minYp << ", max = " << maxYp
<< ", average = " << avgYp << nl;
file() << obr_.time().value()
<< token::TAB << currPatch.name()
<< token::TAB << minYp
@ -162,15 +159,12 @@ void Foam::yPlusLES::calcCompressibleYPlus
scalar maxYp = gMax(Yp);
scalar avgYp = gAverage(Yp);
if (log_)
{
Info<< " patch " << currPatch.name()
<< " y+ : min = " << minYp << ", max = " << maxYp
<< ", average = " << avgYp << nl;
}
if (Pstream::master())
{
Info(log_)<< " patch " << currPatch.name()
<< " y+ : min = " << minYp << ", max = " << maxYp
<< ", average = " << avgYp << nl;
file() << obr_.time().value()
<< token::TAB << currPatch.name()
<< token::TAB << minYp
@ -286,10 +280,7 @@ void Foam::yPlusLES::execute()
mesh.lookupObject<volScalarField>(type())
);
if (log_)
{
Info<< type() << " " << name_ << " output:" << nl;
}
Info(log_)<< type() << " " << name_ << " output:" << nl;
if (phi.dimensions() == dimMass/dimTime)
{
@ -305,7 +296,10 @@ void Foam::yPlusLES::execute()
void Foam::yPlusLES::end()
{
// Do nothing
if (active_)
{
execute();
}
}
@ -324,10 +318,7 @@ void Foam::yPlusLES::write()
const volScalarField& yPlusLES =
obr_.lookupObject<volScalarField>(type());
if (log_)
{
Info<< " writing field " << yPlusLES.name() << nl << endl;
}
Info(log_)<< " writing field " << yPlusLES.name() << nl << endl;
yPlusLES.write();
}

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 2013 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2013-2014 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -89,15 +89,12 @@ void Foam::yPlusRAS::calcIncompressibleYPlus
scalar maxYp = gMax(Yp);
scalar avgYp = gAverage(Yp);
if (log_)
{
Info<< " patch " << nutPw.patch().name()
<< " y+ : min = " << minYp << ", max = " << maxYp
<< ", average = " << avgYp << nl;
}
if (Pstream::master())
{
Info(log_)<< " patch " << nutPw.patch().name()
<< " y+ : min = " << minYp << ", max = " << maxYp
<< ", average = " << avgYp << nl;
file() << obr_.time().value()
<< token::TAB << nutPw.patch().name()
<< token::TAB << minYp
@ -149,15 +146,12 @@ void Foam::yPlusRAS::calcCompressibleYPlus
scalar maxYp = gMax(Yp);
scalar avgYp = gAverage(Yp);
if (log_)
{
Info<< " patch " << mutPw.patch().name()
<< " y+ : min = " << minYp << ", max = " << maxYp
<< ", average = " << avgYp << nl;
}
if (Pstream::master())
{
Info(log_)<< " patch " << mutPw.patch().name()
<< " y+ : min = " << minYp << ", max = " << maxYp
<< ", average = " << avgYp << nl;
file() << obr_.time().value()
<< token::TAB << mutPw.patch().name()
<< token::TAB << minYp
@ -271,10 +265,7 @@ void Foam::yPlusRAS::execute()
mesh.lookupObject<volScalarField>(type())
);
if (log_)
{
Info<< type() << " " << name_ << " output:" << nl;
}
Info(log_)<< type() << " " << name_ << " output:" << nl;
if (phi.dimensions() == dimMass/dimTime)
{
@ -290,7 +281,10 @@ void Foam::yPlusRAS::execute()
void Foam::yPlusRAS::end()
{
// Do nothing
if (active_)
{
execute();
}
}
@ -309,10 +303,7 @@ void Foam::yPlusRAS::write()
const volScalarField& yPlusRAS =
obr_.lookupObject<volScalarField>(type());
if (log_)
{
Info<< " writing field " << yPlusRAS.name() << nl << endl;
}
Info(log_)<< " writing field " << yPlusRAS.name() << nl << endl;
yPlusRAS.write();
}

View File

@ -121,9 +121,9 @@ Foam::sixDoFRigidBodyMotionSolver::sixDoFRigidBodyMotionSolver
max
(
(do_ - pDist.internalField())/(do_ - di_),
0.0
scalar(0)
),
1.0
scalar(1)
);
// Convert the scale function to a cosine
@ -136,9 +136,9 @@ Foam::sixDoFRigidBodyMotionSolver::sixDoFRigidBodyMotionSolver
- 0.5
*cos(scale_.internalField()
*Foam::constant::mathematical::pi),
0.0
scalar(0)
),
1.0
scalar(1)
);
scale_.correctBoundaryConditions();

View File

@ -86,7 +86,7 @@ castellatedMeshControls
features
(
{
file "flange.eMesh";
file "flange.extendedFeatureEdgeMesh";
level 0;
}
);
@ -301,12 +301,13 @@ meshQualityControls
// Advanced
// Flags for optional output
// 0 : only write final meshes
// 1 : write intermediate meshes
// 2 : write volScalarField with cellLevel for postprocessing
// 4 : write current intersections as .obj files
debug 0;
// Write flags
writeFlags
(
scalarLevels // write volScalarField with cellLevel for postprocessing
layerSets // write cellSets, faceSets of faces in layer
layerFields // write volScalarField for layer coverage
);
// Merge tolerance. Is fraction of overall bounding box of initial mesh.

Some files were not shown because too many files have changed in this diff Show More