mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
GIT: Resolve conflict
This commit is contained in:
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -25,6 +25,7 @@ License
|
|||||||
|
|
||||||
#include "helpSolver.H"
|
#include "helpSolver.H"
|
||||||
#include "addToRunTimeSelectionTable.H"
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
#include "fvMesh.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -63,6 +64,11 @@ void Foam::helpTypes::helpSolver::init()
|
|||||||
helpType::init();
|
helpType::init();
|
||||||
|
|
||||||
argList::validArgs.append("solver");
|
argList::validArgs.append("solver");
|
||||||
|
argList::addBoolOption
|
||||||
|
(
|
||||||
|
"read",
|
||||||
|
"read solver type from the system/controlDict"
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -78,6 +84,11 @@ void Foam::helpTypes::helpSolver::execute
|
|||||||
{
|
{
|
||||||
displayDoc(solver, ".*solvers/.*Foam/", true, "C");
|
displayDoc(solver, ".*solvers/.*Foam/", true, "C");
|
||||||
}
|
}
|
||||||
|
else if (args.optionFound("read"))
|
||||||
|
{
|
||||||
|
mesh.time().controlDict().lookup("application") >> solver;
|
||||||
|
displayDoc(solver, ".*solvers/.*Foam/", true, "C");
|
||||||
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
displayDocOptions(".*solvers/.*Foam/", true, "C");
|
displayDocOptions(".*solvers/.*Foam/", true, "C");
|
||||||
|
|||||||
@ -59,7 +59,7 @@ Description
|
|||||||
QrNbr Qr; // or none. Name of Qr field on neighbour region
|
QrNbr Qr; // or none. Name of Qr field on neighbour region
|
||||||
Qr Qr; // or none. Name of Qr field on local region
|
Qr Qr; // or none. Name of Qr field on local region
|
||||||
thicknessLayers (0.1 0.2 0.3 0.4);
|
thicknessLayers (0.1 0.2 0.3 0.4);
|
||||||
kappaLayers (1 2 3 4)
|
kappaLayers (1 2 3 4);
|
||||||
value uniform 300;
|
value uniform 300;
|
||||||
}
|
}
|
||||||
\endverbatim
|
\endverbatim
|
||||||
|
|||||||
@ -27,9 +27,13 @@ Class
|
|||||||
|
|
||||||
Description
|
Description
|
||||||
Hybrid convection scheme of Travin et al. for hybrid RAS/LES calculations.
|
Hybrid convection scheme of Travin et al. for hybrid RAS/LES calculations.
|
||||||
The scheme blends between a low-dissipative convection scheme within the
|
|
||||||
LES region (e.g. linear) and a numerically more robust convection scheme in
|
The scheme provides a blend between two convection schemes, based on local
|
||||||
the RAS region (e.g. upwind-biased schemes).
|
properties including the wall distance, velocity gradient and eddy
|
||||||
|
viscosity. The scheme was originally developed for DES calculations to
|
||||||
|
blend a low-dissipative scheme, e.g. linear, in the vorticity-dominated,
|
||||||
|
finely-resolved regions and a numerically more robust, e.g. upwind-biased,
|
||||||
|
convection scheme in irrotational or coarsely-resolved regions.
|
||||||
|
|
||||||
The routine calculates the blending factor denoted as "sigma" in the
|
The routine calculates the blending factor denoted as "sigma" in the
|
||||||
literature reference, where 0 <= sigma <= sigmaMax, which is then employed
|
literature reference, where 0 <= sigma <= sigmaMax, which is then employed
|
||||||
|
|||||||
@ -187,7 +187,7 @@ tmp<volScalarField> SpalartAllmarasDES<BasicTurbulenceModel>::psi
|
|||||||
(
|
(
|
||||||
scalar(100),
|
scalar(100),
|
||||||
(1 - Cb1_/(Cw1_*sqr(kappa_)*fwStar_)*(ft2 + (1 - ft2)*fv2))
|
(1 - Cb1_/(Cw1_*sqr(kappa_)*fwStar_)*(ft2 + (1 - ft2)*fv2))
|
||||||
/max(SMALL, (fv1*max(1e-10, 1 - ft2)))
|
/max(SMALL, (fv1*max(scalar(1e-10), 1 - ft2)))
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation | Copyright (C) 2015 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -48,6 +48,11 @@ Description
|
|||||||
Theor. Comput. Fluid Dyn., 20, 181-195.
|
Theor. Comput. Fluid Dyn., 20, 181-195.
|
||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
|
Note
|
||||||
|
The default value of the DES constant implemented was calibrated for
|
||||||
|
OpenFOAM using decaying isotropic turbulence and agrees with the value
|
||||||
|
suggested in the reference publication.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
SpalartAllmarasDES.C
|
SpalartAllmarasDES.C
|
||||||
|
|
||||||
|
|||||||
@ -37,8 +37,11 @@ Description
|
|||||||
39th AIAA Aerospace Sciences Meeting and Exhibit, Reno, NV
|
39th AIAA Aerospace Sciences Meeting and Exhibit, Reno, NV
|
||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
Note: DES constants CDES_kom and CDES_keps have been re-calibrated to
|
Note
|
||||||
OpenFOAM numerics via decaying isotropic turbulence test case
|
The default values of the DES constants implemented are code-specific
|
||||||
|
values calibrated for OpenFOAM using decaying isotropic turbulence, and
|
||||||
|
hence deviate slightly from the values suggested in the reference
|
||||||
|
publication.
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
kOmegaSSTDES.C
|
kOmegaSSTDES.C
|
||||||
|
|||||||
@ -276,7 +276,7 @@ public:
|
|||||||
//- Return the turbulence kinetic energy dissipation rate
|
//- Return the turbulence kinetic energy dissipation rate
|
||||||
virtual tmp<volScalarField> epsilon() const
|
virtual tmp<volScalarField> epsilon() const
|
||||||
{
|
{
|
||||||
return tmp<volScalarField>
|
return tmp<volScalarField>
|
||||||
(
|
(
|
||||||
new volScalarField
|
new volScalarField
|
||||||
(
|
(
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2016 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2016 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -42,7 +42,6 @@ activePressureForceBaffleVelocityFvPatchVectorField
|
|||||||
pName_("p"),
|
pName_("p"),
|
||||||
cyclicPatchName_(),
|
cyclicPatchName_(),
|
||||||
cyclicPatchLabel_(-1),
|
cyclicPatchLabel_(-1),
|
||||||
orientation_(1),
|
|
||||||
initWallSf_(0),
|
initWallSf_(0),
|
||||||
initCyclicSf_(0),
|
initCyclicSf_(0),
|
||||||
nbrCyclicSf_(0),
|
nbrCyclicSf_(0),
|
||||||
@ -52,7 +51,8 @@ activePressureForceBaffleVelocityFvPatchVectorField
|
|||||||
curTimeIndex_(-1),
|
curTimeIndex_(-1),
|
||||||
minThresholdValue_(0),
|
minThresholdValue_(0),
|
||||||
fBased_(1),
|
fBased_(1),
|
||||||
baffleActivated_(0)
|
baffleActivated_(0),
|
||||||
|
opening_(1)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -69,7 +69,6 @@ activePressureForceBaffleVelocityFvPatchVectorField
|
|||||||
pName_(ptf.pName_),
|
pName_(ptf.pName_),
|
||||||
cyclicPatchName_(ptf.cyclicPatchName_),
|
cyclicPatchName_(ptf.cyclicPatchName_),
|
||||||
cyclicPatchLabel_(ptf.cyclicPatchLabel_),
|
cyclicPatchLabel_(ptf.cyclicPatchLabel_),
|
||||||
orientation_(ptf.orientation_),
|
|
||||||
initWallSf_(ptf.initWallSf_),
|
initWallSf_(ptf.initWallSf_),
|
||||||
initCyclicSf_(ptf.initCyclicSf_),
|
initCyclicSf_(ptf.initCyclicSf_),
|
||||||
nbrCyclicSf_(ptf.nbrCyclicSf_),
|
nbrCyclicSf_(ptf.nbrCyclicSf_),
|
||||||
@ -79,7 +78,8 @@ activePressureForceBaffleVelocityFvPatchVectorField
|
|||||||
curTimeIndex_(-1),
|
curTimeIndex_(-1),
|
||||||
minThresholdValue_(ptf.minThresholdValue_),
|
minThresholdValue_(ptf.minThresholdValue_),
|
||||||
fBased_(ptf.fBased_),
|
fBased_(ptf.fBased_),
|
||||||
baffleActivated_(ptf.baffleActivated_)
|
baffleActivated_(ptf.baffleActivated_),
|
||||||
|
opening_(ptf.opening_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -95,7 +95,6 @@ activePressureForceBaffleVelocityFvPatchVectorField
|
|||||||
pName_(dict.lookupOrDefault<word>("p", "p")),
|
pName_(dict.lookupOrDefault<word>("p", "p")),
|
||||||
cyclicPatchName_(dict.lookup("cyclicPatch")),
|
cyclicPatchName_(dict.lookup("cyclicPatch")),
|
||||||
cyclicPatchLabel_(p.patch().boundaryMesh().findPatchID(cyclicPatchName_)),
|
cyclicPatchLabel_(p.patch().boundaryMesh().findPatchID(cyclicPatchName_)),
|
||||||
orientation_(readLabel(dict.lookup("orientation"))),
|
|
||||||
initWallSf_(0),
|
initWallSf_(0),
|
||||||
initCyclicSf_(0),
|
initCyclicSf_(0),
|
||||||
nbrCyclicSf_(0),
|
nbrCyclicSf_(0),
|
||||||
@ -105,7 +104,8 @@ activePressureForceBaffleVelocityFvPatchVectorField
|
|||||||
curTimeIndex_(-1),
|
curTimeIndex_(-1),
|
||||||
minThresholdValue_(readScalar(dict.lookup("minThresholdValue"))),
|
minThresholdValue_(readScalar(dict.lookup("minThresholdValue"))),
|
||||||
fBased_(readBool(dict.lookup("forceBased"))),
|
fBased_(readBool(dict.lookup("forceBased"))),
|
||||||
baffleActivated_(0)
|
baffleActivated_(0),
|
||||||
|
opening_(readBool(dict.lookup("opening")))
|
||||||
{
|
{
|
||||||
fvPatchVectorField::operator=(Zero);
|
fvPatchVectorField::operator=(Zero);
|
||||||
|
|
||||||
@ -136,7 +136,6 @@ activePressureForceBaffleVelocityFvPatchVectorField
|
|||||||
pName_(ptf.pName_),
|
pName_(ptf.pName_),
|
||||||
cyclicPatchName_(ptf.cyclicPatchName_),
|
cyclicPatchName_(ptf.cyclicPatchName_),
|
||||||
cyclicPatchLabel_(ptf.cyclicPatchLabel_),
|
cyclicPatchLabel_(ptf.cyclicPatchLabel_),
|
||||||
orientation_(ptf.orientation_),
|
|
||||||
initWallSf_(ptf.initWallSf_),
|
initWallSf_(ptf.initWallSf_),
|
||||||
initCyclicSf_(ptf.initCyclicSf_),
|
initCyclicSf_(ptf.initCyclicSf_),
|
||||||
nbrCyclicSf_(ptf.nbrCyclicSf_),
|
nbrCyclicSf_(ptf.nbrCyclicSf_),
|
||||||
@ -146,7 +145,8 @@ activePressureForceBaffleVelocityFvPatchVectorField
|
|||||||
curTimeIndex_(-1),
|
curTimeIndex_(-1),
|
||||||
minThresholdValue_(ptf.minThresholdValue_),
|
minThresholdValue_(ptf.minThresholdValue_),
|
||||||
fBased_(ptf.fBased_),
|
fBased_(ptf.fBased_),
|
||||||
baffleActivated_(ptf.baffleActivated_)
|
baffleActivated_(ptf.baffleActivated_),
|
||||||
|
opening_(ptf.opening_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -161,7 +161,6 @@ activePressureForceBaffleVelocityFvPatchVectorField
|
|||||||
pName_(ptf.pName_),
|
pName_(ptf.pName_),
|
||||||
cyclicPatchName_(ptf.cyclicPatchName_),
|
cyclicPatchName_(ptf.cyclicPatchName_),
|
||||||
cyclicPatchLabel_(ptf.cyclicPatchLabel_),
|
cyclicPatchLabel_(ptf.cyclicPatchLabel_),
|
||||||
orientation_(ptf.orientation_),
|
|
||||||
initWallSf_(ptf.initWallSf_),
|
initWallSf_(ptf.initWallSf_),
|
||||||
initCyclicSf_(ptf.initCyclicSf_),
|
initCyclicSf_(ptf.initCyclicSf_),
|
||||||
nbrCyclicSf_(ptf.nbrCyclicSf_),
|
nbrCyclicSf_(ptf.nbrCyclicSf_),
|
||||||
@ -171,7 +170,8 @@ activePressureForceBaffleVelocityFvPatchVectorField
|
|||||||
curTimeIndex_(-1),
|
curTimeIndex_(-1),
|
||||||
minThresholdValue_(ptf.minThresholdValue_),
|
minThresholdValue_(ptf.minThresholdValue_),
|
||||||
fBased_(ptf.fBased_),
|
fBased_(ptf.fBased_),
|
||||||
baffleActivated_(ptf.baffleActivated_)
|
baffleActivated_(ptf.baffleActivated_),
|
||||||
|
opening_(ptf.opening_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
|
|
||||||
@ -197,14 +197,13 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::autoMap
|
|||||||
Info << "faceArea[active] "<< i << endl;
|
Info << "faceArea[active] "<< i << endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (patch().size() > 0)
|
if (patch().size() > 0)
|
||||||
{
|
{
|
||||||
const vectorField& areas = patch().boundaryMesh().mesh().faceAreas();
|
const vectorField& areas = patch().boundaryMesh().mesh().faceAreas();
|
||||||
initWallSf_ = patch().patchSlice(areas);
|
initWallSf_ = patch().patchSlice(areas);
|
||||||
initCyclicSf_ = patch().boundaryMesh()
|
initCyclicSf_ =
|
||||||
[
|
patch().boundaryMesh()[cyclicPatchLabel_].patchSlice(areas);
|
||||||
cyclicPatchLabel_
|
|
||||||
].patchSlice(areas);
|
|
||||||
nbrCyclicSf_ = refCast<const cyclicFvPatch>
|
nbrCyclicSf_ = refCast<const cyclicFvPatch>
|
||||||
(
|
(
|
||||||
patch().boundaryMesh()
|
patch().boundaryMesh()
|
||||||
@ -215,6 +214,7 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::autoMap
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
void Foam::activePressureForceBaffleVelocityFvPatchVectorField::rmap
|
void Foam::activePressureForceBaffleVelocityFvPatchVectorField::rmap
|
||||||
(
|
(
|
||||||
const fvPatchVectorField& ptf,
|
const fvPatchVectorField& ptf,
|
||||||
@ -226,10 +226,8 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::rmap
|
|||||||
// See autoMap.
|
// See autoMap.
|
||||||
const vectorField& areas = patch().boundaryMesh().mesh().faceAreas();
|
const vectorField& areas = patch().boundaryMesh().mesh().faceAreas();
|
||||||
initWallSf_ = patch().patchSlice(areas);
|
initWallSf_ = patch().patchSlice(areas);
|
||||||
initCyclicSf_ = patch().boundaryMesh()
|
initCyclicSf_ =
|
||||||
[
|
patch().boundaryMesh()[cyclicPatchLabel_].patchSlice(areas);
|
||||||
cyclicPatchLabel_
|
|
||||||
].patchSlice(areas);
|
|
||||||
nbrCyclicSf_ = refCast<const cyclicFvPatch>
|
nbrCyclicSf_ = refCast<const cyclicFvPatch>
|
||||||
(
|
(
|
||||||
patch().boundaryMesh()
|
patch().boundaryMesh()
|
||||||
@ -246,20 +244,17 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::updateCoeffs()
|
|||||||
{
|
{
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Execute the change to the openFraction only once per time-step
|
// Execute the change to the openFraction only once per time-step
|
||||||
if (curTimeIndex_ != this->db().time().timeIndex())
|
if (curTimeIndex_ != this->db().time().timeIndex())
|
||||||
{
|
{
|
||||||
const volScalarField& p = db().lookupObject<volScalarField>
|
const volScalarField& p =
|
||||||
(
|
db().lookupObject<volScalarField>(pName_);
|
||||||
pName_
|
|
||||||
);
|
|
||||||
|
|
||||||
const fvPatch& cyclicPatch = patch().boundaryMesh()[cyclicPatchLabel_];
|
const fvPatch& cyclicPatch = patch().boundaryMesh()[cyclicPatchLabel_];
|
||||||
const labelList& cyclicFaceCells = cyclicPatch.patch().faceCells();
|
const labelList& cyclicFaceCells = cyclicPatch.patch().faceCells();
|
||||||
const fvPatch& nbrPatch = refCast<const cyclicFvPatch>
|
const fvPatch& nbrPatch =
|
||||||
(
|
refCast<const cyclicFvPatch>(cyclicPatch).neighbFvPatch();
|
||||||
cyclicPatch
|
|
||||||
).neighbFvPatch();
|
|
||||||
|
|
||||||
const labelList& nbrFaceCells = nbrPatch.patch().faceCells();
|
const labelList& nbrFaceCells = nbrPatch.patch().faceCells();
|
||||||
|
|
||||||
@ -296,21 +291,23 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::updateCoeffs()
|
|||||||
Info<< "Pressure difference = " << valueDiff << endl;
|
Info<< "Pressure difference = " << valueDiff << endl;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ((mag(valueDiff) > mag(minThresholdValue_)) || baffleActivated_)
|
if (mag(valueDiff) > mag(minThresholdValue_) || baffleActivated_)
|
||||||
{
|
{
|
||||||
openFraction_ =
|
openFraction_ =
|
||||||
max(
|
max
|
||||||
min(
|
(
|
||||||
|
min
|
||||||
|
(
|
||||||
openFraction_
|
openFraction_
|
||||||
+ min
|
+ min
|
||||||
(
|
(
|
||||||
this->db().time().deltaT().value()/openingTime_,
|
this->db().time().deltaT().value()/openingTime_,
|
||||||
maxOpenFractionDelta_
|
maxOpenFractionDelta_
|
||||||
)*(orientation_),
|
|
||||||
1 - 1e-6
|
|
||||||
),
|
),
|
||||||
|
1 - 1e-6
|
||||||
|
),
|
||||||
1e-6
|
1e-6
|
||||||
);
|
);
|
||||||
|
|
||||||
baffleActivated_ = true;
|
baffleActivated_ = true;
|
||||||
}
|
}
|
||||||
@ -321,8 +318,20 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::updateCoeffs()
|
|||||||
|
|
||||||
Info<< "Open fraction = " << openFraction_ << endl;
|
Info<< "Open fraction = " << openFraction_ << endl;
|
||||||
|
|
||||||
|
scalar areaFraction = 0.0;
|
||||||
|
|
||||||
|
if (opening_)
|
||||||
|
{
|
||||||
|
areaFraction = openFraction_;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
areaFraction = 1 - openFraction_;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Update this wall patch
|
||||||
vectorField::subField Sfw = patch().patch().faceAreas();
|
vectorField::subField Sfw = patch().patch().faceAreas();
|
||||||
vectorField newSfw((1 - openFraction_)*initWallSf_);
|
vectorField newSfw((1 - areaFraction)*initWallSf_);
|
||||||
forAll(Sfw, facei)
|
forAll(Sfw, facei)
|
||||||
{
|
{
|
||||||
Sfw[facei] = newSfw[facei];
|
Sfw[facei] = newSfw[facei];
|
||||||
@ -330,18 +339,14 @@ void Foam::activePressureForceBaffleVelocityFvPatchVectorField::updateCoeffs()
|
|||||||
const_cast<scalarField&>(patch().magSf()) = mag(patch().Sf());
|
const_cast<scalarField&>(patch().magSf()) = mag(patch().Sf());
|
||||||
|
|
||||||
// Update owner side of cyclic
|
// Update owner side of cyclic
|
||||||
const_cast<vectorField&>(cyclicPatch.Sf()) =
|
const_cast<vectorField&>(cyclicPatch.Sf()) = areaFraction*initCyclicSf_;
|
||||||
openFraction_*initCyclicSf_;
|
|
||||||
|
|
||||||
const_cast<scalarField&>(cyclicPatch.magSf()) =
|
const_cast<scalarField&>(cyclicPatch.magSf()) = mag(cyclicPatch.Sf());
|
||||||
mag(cyclicPatch.Sf());
|
|
||||||
|
|
||||||
// Update neighbour side of cyclic
|
// Update neighbour side of cyclic
|
||||||
const_cast<vectorField&>(nbrPatch.Sf()) =
|
const_cast<vectorField&>(nbrPatch.Sf()) = areaFraction*nbrCyclicSf_;
|
||||||
openFraction_*nbrCyclicSf_;
|
|
||||||
|
|
||||||
const_cast<scalarField&>(nbrPatch.magSf()) =
|
const_cast<scalarField&>(nbrPatch.magSf()) = mag(nbrPatch.Sf());
|
||||||
mag(nbrPatch.Sf());
|
|
||||||
|
|
||||||
curTimeIndex_ = this->db().time().timeIndex();
|
curTimeIndex_ = this->db().time().timeIndex();
|
||||||
}
|
}
|
||||||
@ -357,8 +362,6 @@ write(Ostream& os) const
|
|||||||
writeEntryIfDifferent<word>(os, "p", "p", pName_);
|
writeEntryIfDifferent<word>(os, "p", "p", pName_);
|
||||||
os.writeKeyword("cyclicPatch")
|
os.writeKeyword("cyclicPatch")
|
||||||
<< cyclicPatchName_ << token::END_STATEMENT << nl;
|
<< cyclicPatchName_ << token::END_STATEMENT << nl;
|
||||||
os.writeKeyword("orientation")
|
|
||||||
<< orientation_ << token::END_STATEMENT << nl;
|
|
||||||
os.writeKeyword("openingTime")
|
os.writeKeyword("openingTime")
|
||||||
<< openingTime_ << token::END_STATEMENT << nl;
|
<< openingTime_ << token::END_STATEMENT << nl;
|
||||||
os.writeKeyword("maxOpenFractionDelta")
|
os.writeKeyword("maxOpenFractionDelta")
|
||||||
@ -369,6 +372,8 @@ write(Ostream& os) const
|
|||||||
<< minThresholdValue_ << token::END_STATEMENT << nl;
|
<< minThresholdValue_ << token::END_STATEMENT << nl;
|
||||||
os.writeKeyword("forceBased")
|
os.writeKeyword("forceBased")
|
||||||
<< fBased_ << token::END_STATEMENT << nl;
|
<< fBased_ << token::END_STATEMENT << nl;
|
||||||
|
os.writeKeyword("opening")
|
||||||
|
<< opening_ << token::END_STATEMENT << nl;
|
||||||
writeEntry("value", os);
|
writeEntry("value", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -384,4 +389,5 @@ namespace Foam
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
// ************************************************************************* //
|
||||||
|
|||||||
@ -3,7 +3,7 @@
|
|||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
\\ / O peration |
|
\\ / O peration |
|
||||||
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2015 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | OpenCFD Ltd 2016
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -38,6 +38,11 @@ Description
|
|||||||
used in an extra wall beyond an existing cyclic patch pair. See PDRMesh
|
used in an extra wall beyond an existing cyclic patch pair. See PDRMesh
|
||||||
for more details.
|
for more details.
|
||||||
|
|
||||||
|
The baffle is activated when the pressure difference between master and
|
||||||
|
slave paches is positive and larger then minThresholdValue. The
|
||||||
|
orientation flag is used to to calculate the pressure difference bwetween
|
||||||
|
master-slave or slave-master.
|
||||||
|
|
||||||
Once the threshold is crossed, this condition activated and continues to
|
Once the threshold is crossed, this condition activated and continues to
|
||||||
open or close at a fixed rate using
|
open or close at a fixed rate using
|
||||||
|
|
||||||
@ -70,6 +75,7 @@ Description
|
|||||||
minThresholdValue | minimum absolute pressure or
|
minThresholdValue | minimum absolute pressure or
|
||||||
force difference for activation | yes |
|
force difference for activation | yes |
|
||||||
forceBased | force (true) or pressure-based (false) activation | yes |
|
forceBased | force (true) or pressure-based (false) activation | yes |
|
||||||
|
opening | Baffle is opening or closing (1 opening, 0 closing) | yes
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
Example of the boundary condition specification:
|
Example of the boundary condition specification:
|
||||||
@ -85,6 +91,7 @@ Description
|
|||||||
maxOpenFractionDelta 0.1;
|
maxOpenFractionDelta 0.1;
|
||||||
minThresholdValue 0.01;
|
minThresholdValue 0.01;
|
||||||
forceBased false;
|
forceBased false;
|
||||||
|
opening 1;
|
||||||
}
|
}
|
||||||
\endverbatim
|
\endverbatim
|
||||||
|
|
||||||
@ -124,10 +131,6 @@ class activePressureForceBaffleVelocityFvPatchVectorField
|
|||||||
//- Index of the cyclic patch used when the active baffle is open
|
//- Index of the cyclic patch used when the active baffle is open
|
||||||
label cyclicPatchLabel_;
|
label cyclicPatchLabel_;
|
||||||
|
|
||||||
//- Orientation (1 or -1) of the active baffle mode
|
|
||||||
// Used to change the direction of opening or closing the baffle
|
|
||||||
label orientation_;
|
|
||||||
|
|
||||||
//- Initial wall patch areas
|
//- Initial wall patch areas
|
||||||
vectorField initWallSf_;
|
vectorField initWallSf_;
|
||||||
|
|
||||||
@ -158,6 +161,9 @@ class activePressureForceBaffleVelocityFvPatchVectorField
|
|||||||
//- Baffle is activated
|
//- Baffle is activated
|
||||||
bool baffleActivated_;
|
bool baffleActivated_;
|
||||||
|
|
||||||
|
//- Baffle is opening or closing (1 opening, 0 closing)
|
||||||
|
bool opening_;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
|
|||||||
@ -69,10 +69,10 @@ Description
|
|||||||
maxDiameter 0.5e-4;
|
maxDiameter 0.5e-4;
|
||||||
minDiameter 0;
|
minDiameter 0;
|
||||||
setFormat gnuplot;
|
setFormat gnuplot;
|
||||||
coordinateSystem
|
origin (0 0 0);
|
||||||
|
coordinateRoation
|
||||||
{
|
{
|
||||||
type cartesian;
|
type cartesian;
|
||||||
origin (0 0 0);
|
|
||||||
e3 (0 1 1);
|
e3 (0 1 1);
|
||||||
e1 (1 0 0);
|
e1 (1 0 0);
|
||||||
}
|
}
|
||||||
@ -91,7 +91,8 @@ Description
|
|||||||
maxDiameter | maximum region equivalent diameter | yes |
|
maxDiameter | maximum region equivalent diameter | yes |
|
||||||
minDiameter | minimum region equivalent diameter | no | 0
|
minDiameter | minimum region equivalent diameter | no | 0
|
||||||
setFormat | writing format | yes |
|
setFormat | writing format | yes |
|
||||||
coordinateSystem | transformation for vector fields | no |
|
origin | origin of local co-ordinate system | yes |
|
||||||
|
coordinateRoation | orientation of local co-ordinate system | no |
|
||||||
log | Log to standard output | no | yes
|
log | Log to standard output | no | yes
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
|
|||||||
@ -219,7 +219,7 @@ Foam::forceCoeffs::forceCoeffs
|
|||||||
CdBinFilePtr_(),
|
CdBinFilePtr_(),
|
||||||
ClBinFilePtr_()
|
ClBinFilePtr_()
|
||||||
{
|
{
|
||||||
if (readFields)
|
if (active_ && readFields)
|
||||||
{
|
{
|
||||||
read(dict);
|
read(dict);
|
||||||
if (log_) Info << endl;
|
if (log_) Info << endl;
|
||||||
@ -310,6 +310,12 @@ void Foam::forceCoeffs::execute()
|
|||||||
|
|
||||||
forces::calcForcesMoment();
|
forces::calcForcesMoment();
|
||||||
|
|
||||||
|
// Need to re-check active_ flag - may have been reset in calcForcesMoment
|
||||||
|
if (!active_)
|
||||||
|
{
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
createFiles();
|
createFiles();
|
||||||
|
|
||||||
scalar pDyn = 0.5*rhoRef_*magUInf_*magUInf_;
|
scalar pDyn = 0.5*rhoRef_*magUInf_*magUInf_;
|
||||||
|
|||||||
@ -279,8 +279,8 @@ void Foam::forces::initialiseBins()
|
|||||||
// Allocate storage for forces and moments
|
// Allocate storage for forces and moments
|
||||||
forAll(force_, i)
|
forAll(force_, i)
|
||||||
{
|
{
|
||||||
force_[i].setSize(nBin_);
|
force_[i].setSize(nBin_, vector::zero);
|
||||||
moment_[i].setSize(nBin_);
|
moment_[i].setSize(nBin_, vector::zero);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -841,8 +841,8 @@ Foam::forces::forces
|
|||||||
|
|
||||||
forAll(force_, i)
|
forAll(force_, i)
|
||||||
{
|
{
|
||||||
force_[i].setSize(nBin_);
|
force_[i].setSize(nBin_, vector::zero);
|
||||||
moment_[i].setSize(nBin_);
|
moment_[i].setSize(nBin_, vector::zero);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -944,8 +944,8 @@ void Foam::forces::read(const dictionary& dict)
|
|||||||
// Allocate storage for forces and moments
|
// Allocate storage for forces and moments
|
||||||
forAll(force_, i)
|
forAll(force_, i)
|
||||||
{
|
{
|
||||||
force_[i].setSize(1);
|
force_[i].setSize(1, vector::zero);
|
||||||
moment_[i].setSize(1);
|
moment_[i].setSize(1, vector::zero);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -40,7 +40,7 @@ boundaryField
|
|||||||
type activePressureForceBaffleVelocity;
|
type activePressureForceBaffleVelocity;
|
||||||
value uniform (0 0 0);
|
value uniform (0 0 0);
|
||||||
cyclicPatch baffleCyclic_half0;
|
cyclicPatch baffleCyclic_half0;
|
||||||
orientation 1;
|
opening 1;
|
||||||
openingTime 0.01;
|
openingTime 0.01;
|
||||||
maxOpenFractionDelta 0.1;
|
maxOpenFractionDelta 0.1;
|
||||||
openFraction 0;
|
openFraction 0;
|
||||||
|
|||||||
@ -11,11 +11,11 @@ cp $FOAM_TUTORIALS/resources/geometry/motorBike.obj.gz constant/triSurface/
|
|||||||
mkdir 0
|
mkdir 0
|
||||||
|
|
||||||
runApplication blockMesh
|
runApplication blockMesh
|
||||||
cp system/decomposeParDict.hierarchical system/decomposeParDict
|
# cp system/decomposeParDict.hierarchical system/decomposeParDict
|
||||||
runApplication decomposePar
|
runApplication decomposePar -decomposeParDict system/decomposeParDict.hierarchical
|
||||||
|
|
||||||
cp system/decomposeParDict.ptscotch system/decomposeParDict
|
# cp system/decomposeParDict.ptscotch system/decomposeParDict
|
||||||
runParallel snappyHexMesh -overwrite -parallel
|
runParallel snappyHexMesh -decomposeParDict system/decomposeParDict.ptscotch -overwrite -parallel
|
||||||
|
|
||||||
find . -type f -iname "*level*" -exec rm {} \;
|
find . -type f -iname "*level*" -exec rm {} \;
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user