mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
Merge branch 'develop' of develop.openfoam.com:Development/OpenFOAM-plus into develop
This commit is contained in:
@ -1,4 +1,4 @@
|
|||||||
OpenFOAM-v1612+
|
OpenFOAM-1706
|
||||||
==================
|
==================
|
||||||
Known Build Issues
|
Known Build Issues
|
||||||
==================
|
==================
|
||||||
@ -22,16 +22,15 @@ VTK
|
|||||||
---
|
---
|
||||||
|
|
||||||
If using the runTimePostProcessing to create on-the-fly images, you
|
If using the runTimePostProcessing to create on-the-fly images, you
|
||||||
can simply just compile ParaView-5.0.1 and these libraries will
|
can simply just compile ParaView and these libraries will be used.
|
||||||
be used.
|
|
||||||
|
|
||||||
If you elect to use a separate VTK compilation (for example for
|
If you elect to use a separate VTK compilation (for example for
|
||||||
off-screen rendering), it is advisable to reuse the VTK libraries that
|
off-screen rendering), it is advisable to reuse the VTK libraries that
|
||||||
are provided with ParaView-5.0.1, by making an appropriate symlink
|
are provided with ParaView by making an appropriate symlink
|
||||||
prior to using makeVTK. This doesn't just reduce disk-space, but works
|
prior to using makeVTK. This doesn't just reduce disk-space, but works
|
||||||
much better than using the VTK-7.1.0.tar file.
|
much better than using the VTK tar file.
|
||||||
|
|
||||||
Using runTimePostProcessing with the 'plain' VTK-7.1.0 libraries does
|
Using runTimePostProcessing with the 'plain' VTK libraries does
|
||||||
generally work, but does not exit cleanly:
|
generally work, but does not exit cleanly:
|
||||||
|
|
||||||
symbol lookup error: .../linux64Gcc/VTK-7.1.0/lib/libvtkCommonExecutionModel-7.1.so.1:
|
symbol lookup error: .../linux64Gcc/VTK-7.1.0/lib/libvtkCommonExecutionModel-7.1.so.1:
|
||||||
@ -60,4 +59,21 @@ there are also minimum gcc/g++ requirements there:
|
|||||||
If your system compiler is too old to build the minimum required gcc or
|
If your system compiler is too old to build the minimum required gcc or
|
||||||
clang/llvm, it is just simply too old.
|
clang/llvm, it is just simply too old.
|
||||||
|
|
||||||
|
|
||||||
|
-------------------------
|
||||||
|
Building with spack
|
||||||
|
-------------------------
|
||||||
|
|
||||||
|
If you are building with spack, note that the depends_on for paraview
|
||||||
|
resolves poorly. The +qt dependency (for building the reader module)
|
||||||
|
may need to be specified as a preference by including the following in
|
||||||
|
your `~/.spack/packages.yaml` file:
|
||||||
|
|
||||||
|
packages:
|
||||||
|
paraview:
|
||||||
|
variants: +qt
|
||||||
|
|
||||||
|
It appears that spack will otherwise ignore any paraview+qt version
|
||||||
|
and attempt to install a paraview~qt version instead.
|
||||||
|
|
||||||
--
|
--
|
||||||
|
|||||||
@ -1,4 +1,3 @@
|
|||||||
mixedFixedValueSlip/mixedFixedValueSlipFvPatchFields.C
|
|
||||||
U/maxwellSlipUFvPatchVectorField.C
|
U/maxwellSlipUFvPatchVectorField.C
|
||||||
T/smoluchowskiJumpTFvPatchScalarField.C
|
T/smoluchowskiJumpTFvPatchScalarField.C
|
||||||
rho/fixedRhoFvPatchScalarField.C
|
rho/fixedRhoFvPatchScalarField.C
|
||||||
|
|||||||
@ -38,7 +38,7 @@ Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
|||||||
const DimensionedField<vector, volMesh>& iF
|
const DimensionedField<vector, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFixedValueSlipFvPatchVectorField(p, iF),
|
partialSlipFvPatchVectorField(p, iF),
|
||||||
TName_("T"),
|
TName_("T"),
|
||||||
rhoName_("rho"),
|
rhoName_("rho"),
|
||||||
psiName_("thermo:psi"),
|
psiName_("thermo:psi"),
|
||||||
@ -59,7 +59,7 @@ Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
|||||||
const fvPatchFieldMapper& mapper
|
const fvPatchFieldMapper& mapper
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFixedValueSlipFvPatchVectorField(mspvf, p, iF, mapper),
|
partialSlipFvPatchVectorField(mspvf, p, iF, mapper),
|
||||||
TName_(mspvf.TName_),
|
TName_(mspvf.TName_),
|
||||||
rhoName_(mspvf.rhoName_),
|
rhoName_(mspvf.rhoName_),
|
||||||
psiName_(mspvf.psiName_),
|
psiName_(mspvf.psiName_),
|
||||||
@ -79,7 +79,7 @@ Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
|||||||
const dictionary& dict
|
const dictionary& dict
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFixedValueSlipFvPatchVectorField(p, iF),
|
partialSlipFvPatchVectorField(p, iF),
|
||||||
TName_(dict.lookupOrDefault<word>("T", "T")),
|
TName_(dict.lookupOrDefault<word>("T", "T")),
|
||||||
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
rhoName_(dict.lookupOrDefault<word>("rho", "rho")),
|
||||||
psiName_(dict.lookupOrDefault<word>("psi", "thermo:psi")),
|
psiName_(dict.lookupOrDefault<word>("psi", "thermo:psi")),
|
||||||
@ -132,7 +132,7 @@ Foam::maxwellSlipUFvPatchVectorField::maxwellSlipUFvPatchVectorField
|
|||||||
const DimensionedField<vector, volMesh>& iF
|
const DimensionedField<vector, volMesh>& iF
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
mixedFixedValueSlipFvPatchVectorField(mspvf, iF),
|
partialSlipFvPatchVectorField(mspvf, iF),
|
||||||
TName_(mspvf.TName_),
|
TName_(mspvf.TName_),
|
||||||
rhoName_(mspvf.rhoName_),
|
rhoName_(mspvf.rhoName_),
|
||||||
psiName_(mspvf.psiName_),
|
psiName_(mspvf.psiName_),
|
||||||
@ -193,7 +193,7 @@ void Foam::maxwellSlipUFvPatchVectorField::updateCoeffs()
|
|||||||
refValue() -= C1/prho*transform(I - n*n, (n & ptauMC));
|
refValue() -= C1/prho*transform(I - n*n, (n & ptauMC));
|
||||||
}
|
}
|
||||||
|
|
||||||
mixedFixedValueSlipFvPatchVectorField::updateCoeffs();
|
partialSlipFvPatchVectorField::updateCoeffs();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -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-2012 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2012 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -36,7 +36,7 @@ SourceFiles
|
|||||||
#ifndef maxwellSlipUFvPatchVectorField_H
|
#ifndef maxwellSlipUFvPatchVectorField_H
|
||||||
#define maxwellSlipUFvPatchVectorField_H
|
#define maxwellSlipUFvPatchVectorField_H
|
||||||
|
|
||||||
#include "mixedFixedValueSlipFvPatchFields.H"
|
#include "partialSlipFvPatchFields.H"
|
||||||
#include "Switch.H"
|
#include "Switch.H"
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
@ -50,7 +50,7 @@ namespace Foam
|
|||||||
|
|
||||||
class maxwellSlipUFvPatchVectorField
|
class maxwellSlipUFvPatchVectorField
|
||||||
:
|
:
|
||||||
public mixedFixedValueSlipFvPatchVectorField
|
public partialSlipFvPatchVectorField
|
||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
|||||||
@ -1,196 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011-2016 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 "mixedFixedValueSlipFvPatchField.H"
|
|
||||||
#include "symmTransformField.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
Foam::mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<Type, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
transformFvPatchField<Type>(p, iF),
|
|
||||||
refValue_(p.size()),
|
|
||||||
valueFraction_(p.size(), 1.0)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
Foam::mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
|
||||||
(
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<Type, volMesh>& iF,
|
|
||||||
const dictionary& dict
|
|
||||||
)
|
|
||||||
:
|
|
||||||
transformFvPatchField<Type>(p, iF),
|
|
||||||
refValue_("refValue", dict, p.size()),
|
|
||||||
valueFraction_("valueFraction", dict, p.size())
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
Foam::mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
|
||||||
(
|
|
||||||
const mixedFixedValueSlipFvPatchField<Type>& ptf,
|
|
||||||
const fvPatch& p,
|
|
||||||
const DimensionedField<Type, volMesh>& iF,
|
|
||||||
const fvPatchFieldMapper& mapper
|
|
||||||
)
|
|
||||||
:
|
|
||||||
transformFvPatchField<Type>(ptf, p, iF, mapper),
|
|
||||||
refValue_(ptf.refValue_, mapper),
|
|
||||||
valueFraction_(ptf.valueFraction_, mapper)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
Foam::mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
|
||||||
(
|
|
||||||
const mixedFixedValueSlipFvPatchField<Type>& ptf
|
|
||||||
)
|
|
||||||
:
|
|
||||||
transformFvPatchField<Type>(ptf),
|
|
||||||
refValue_(ptf.refValue_),
|
|
||||||
valueFraction_(ptf.valueFraction_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
Foam::mixedFixedValueSlipFvPatchField<Type>::mixedFixedValueSlipFvPatchField
|
|
||||||
(
|
|
||||||
const mixedFixedValueSlipFvPatchField<Type>& ptf,
|
|
||||||
const DimensionedField<Type, volMesh>& iF
|
|
||||||
)
|
|
||||||
:
|
|
||||||
transformFvPatchField<Type>(ptf, iF),
|
|
||||||
refValue_(ptf.refValue_),
|
|
||||||
valueFraction_(ptf.valueFraction_)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void Foam::mixedFixedValueSlipFvPatchField<Type>::autoMap
|
|
||||||
(
|
|
||||||
const fvPatchFieldMapper& m
|
|
||||||
)
|
|
||||||
{
|
|
||||||
Field<Type>::autoMap(m);
|
|
||||||
refValue_.autoMap(m);
|
|
||||||
valueFraction_.autoMap(m);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void Foam::mixedFixedValueSlipFvPatchField<Type>::rmap
|
|
||||||
(
|
|
||||||
const fvPatchField<Type>& ptf,
|
|
||||||
const labelList& addr
|
|
||||||
)
|
|
||||||
{
|
|
||||||
transformFvPatchField<Type>::rmap(ptf, addr);
|
|
||||||
|
|
||||||
const mixedFixedValueSlipFvPatchField<Type>& dmptf =
|
|
||||||
refCast<const mixedFixedValueSlipFvPatchField<Type>>(ptf);
|
|
||||||
|
|
||||||
refValue_.rmap(dmptf.refValue_, addr);
|
|
||||||
valueFraction_.rmap(dmptf.valueFraction_, addr);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
Foam::tmp<Foam::Field<Type>>
|
|
||||||
Foam::mixedFixedValueSlipFvPatchField<Type>::snGrad() const
|
|
||||||
{
|
|
||||||
tmp<vectorField> nHat = this->patch().nf();
|
|
||||||
Field<Type> pif(this->patchInternalField());
|
|
||||||
|
|
||||||
return
|
|
||||||
(
|
|
||||||
valueFraction_*refValue_
|
|
||||||
+ (1.0 - valueFraction_)*transform(I - sqr(nHat), pif) - pif
|
|
||||||
)*this->patch().deltaCoeffs();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void Foam::mixedFixedValueSlipFvPatchField<Type>::evaluate
|
|
||||||
(
|
|
||||||
const Pstream::commsTypes
|
|
||||||
)
|
|
||||||
{
|
|
||||||
if (!this->updated())
|
|
||||||
{
|
|
||||||
this->updateCoeffs();
|
|
||||||
}
|
|
||||||
|
|
||||||
vectorField nHat(this->patch().nf());
|
|
||||||
|
|
||||||
Field<Type>::operator=
|
|
||||||
(
|
|
||||||
valueFraction_*refValue_
|
|
||||||
+
|
|
||||||
(1.0 - valueFraction_)
|
|
||||||
*transform(I - nHat*nHat, this->patchInternalField())
|
|
||||||
);
|
|
||||||
|
|
||||||
transformFvPatchField<Type>::evaluate();
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
Foam::tmp<Foam::Field<Type>>
|
|
||||||
Foam::mixedFixedValueSlipFvPatchField<Type>::snGradTransformDiag() const
|
|
||||||
{
|
|
||||||
vectorField nHat(this->patch().nf());
|
|
||||||
vectorField diag(nHat.size());
|
|
||||||
|
|
||||||
diag.replace(vector::X, mag(nHat.component(vector::X)));
|
|
||||||
diag.replace(vector::Y, mag(nHat.component(vector::Y)));
|
|
||||||
diag.replace(vector::Z, mag(nHat.component(vector::Z)));
|
|
||||||
|
|
||||||
return
|
|
||||||
valueFraction_*Type(pTraits<Type>::one)
|
|
||||||
+ (1.0 - valueFraction_)
|
|
||||||
*transformFieldMask<Type>(pow<vector, pTraits<Type>::rank>(diag));
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
void Foam::mixedFixedValueSlipFvPatchField<Type>::write(Ostream& os) const
|
|
||||||
{
|
|
||||||
transformFvPatchField<Type>::write(os);
|
|
||||||
refValue_.writeEntry("refValue", os);
|
|
||||||
valueFraction_.writeEntry("valueFraction", os);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,237 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011-2017 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::mixedFixedValueSlipFvPatchField
|
|
||||||
|
|
||||||
Description
|
|
||||||
A mixed boundary type that blends between fixedValue and slip, as opposed
|
|
||||||
to the standard mixed condition that blends between fixedValue and
|
|
||||||
fixedGradient; required to implement maxwellSlipU condition.
|
|
||||||
|
|
||||||
SourceFiles
|
|
||||||
mixedFixedValueSlipFvPatchField.C
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef mixedFixedValueSlipFvPatchField_H
|
|
||||||
#define mixedFixedValueSlipFvPatchField_H
|
|
||||||
|
|
||||||
#include "transformFvPatchField.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
Class mixedFixedValueSlipFvPatch Declaration
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
template<class Type>
|
|
||||||
class mixedFixedValueSlipFvPatchField
|
|
||||||
:
|
|
||||||
public transformFvPatchField<Type>
|
|
||||||
{
|
|
||||||
// Private data
|
|
||||||
|
|
||||||
//- Value field used for boundary condition
|
|
||||||
Field<Type> refValue_;
|
|
||||||
|
|
||||||
//- Fraction (0-1) of value used for boundary condition
|
|
||||||
scalarField valueFraction_;
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
//- Runtime type information
|
|
||||||
TypeName("mixedFixedValueSlip");
|
|
||||||
|
|
||||||
|
|
||||||
// Constructors
|
|
||||||
|
|
||||||
//- Construct from patch and internal field
|
|
||||||
mixedFixedValueSlipFvPatchField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<Type, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct from patch, internal field and dictionary
|
|
||||||
mixedFixedValueSlipFvPatchField
|
|
||||||
(
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<Type, volMesh>&,
|
|
||||||
const dictionary&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct by mapping given mixedFixedValueSlipFvPatchField
|
|
||||||
//- Onto a new patch
|
|
||||||
mixedFixedValueSlipFvPatchField
|
|
||||||
(
|
|
||||||
const mixedFixedValueSlipFvPatchField<Type>&,
|
|
||||||
const fvPatch&,
|
|
||||||
const DimensionedField<Type, volMesh>&,
|
|
||||||
const fvPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct as copy
|
|
||||||
mixedFixedValueSlipFvPatchField
|
|
||||||
(
|
|
||||||
const mixedFixedValueSlipFvPatchField<Type>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone
|
|
||||||
virtual tmp<fvPatchField<Type>> clone() const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchField<Type>>
|
|
||||||
(
|
|
||||||
new mixedFixedValueSlipFvPatchField<Type>(*this)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
//- Construct as copy setting internal field reference
|
|
||||||
mixedFixedValueSlipFvPatchField
|
|
||||||
(
|
|
||||||
const mixedFixedValueSlipFvPatchField<Type>&,
|
|
||||||
const DimensionedField<Type, volMesh>&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Construct and return a clone setting internal field reference
|
|
||||||
virtual tmp<fvPatchField<Type>> clone
|
|
||||||
(
|
|
||||||
const DimensionedField<Type, volMesh>& iF
|
|
||||||
) const
|
|
||||||
{
|
|
||||||
return tmp<fvPatchField<Type>>
|
|
||||||
(
|
|
||||||
new mixedFixedValueSlipFvPatchField<Type>(*this, iF)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
// Member functions
|
|
||||||
|
|
||||||
// Access
|
|
||||||
|
|
||||||
//- Return false: this patch field is not altered by assignment
|
|
||||||
virtual bool assignable() const
|
|
||||||
{
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
// Mapping functions
|
|
||||||
|
|
||||||
//- Map (and resize as needed) from self given a mapping object
|
|
||||||
virtual void autoMap
|
|
||||||
(
|
|
||||||
const fvPatchFieldMapper&
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Reverse map the given fvPatchField onto this fvPatchField
|
|
||||||
virtual void rmap
|
|
||||||
(
|
|
||||||
const fvPatchField<Type>&,
|
|
||||||
const labelList&
|
|
||||||
);
|
|
||||||
|
|
||||||
// Return defining fields
|
|
||||||
|
|
||||||
virtual Field<Type>& refValue()
|
|
||||||
{
|
|
||||||
return refValue_;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual const Field<Type>& refValue() const
|
|
||||||
{
|
|
||||||
return refValue_;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual scalarField& valueFraction()
|
|
||||||
{
|
|
||||||
return valueFraction_;
|
|
||||||
}
|
|
||||||
|
|
||||||
virtual const scalarField& valueFraction() const
|
|
||||||
{
|
|
||||||
return valueFraction_;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Evaluation functions
|
|
||||||
|
|
||||||
//- Return gradient at boundary
|
|
||||||
virtual tmp<Field<Type>> snGrad() const;
|
|
||||||
|
|
||||||
//- Evaluate the patch field
|
|
||||||
virtual void evaluate
|
|
||||||
(
|
|
||||||
const Pstream::commsTypes commsType=
|
|
||||||
Pstream::commsTypes::blocking
|
|
||||||
);
|
|
||||||
|
|
||||||
//- Return face-gradient transform diagonal
|
|
||||||
virtual tmp<Field<Type>> snGradTransformDiag() const;
|
|
||||||
|
|
||||||
|
|
||||||
//- Write
|
|
||||||
virtual void write(Ostream&) const;
|
|
||||||
|
|
||||||
|
|
||||||
// Member operators
|
|
||||||
|
|
||||||
virtual void operator=(const UList<Type>&) {}
|
|
||||||
|
|
||||||
virtual void operator=(const fvPatchField<Type>&) {}
|
|
||||||
virtual void operator+=(const fvPatchField<Type>&) {}
|
|
||||||
virtual void operator-=(const fvPatchField<Type>&) {}
|
|
||||||
virtual void operator*=(const fvPatchField<scalar>&) {}
|
|
||||||
virtual void operator/=(const fvPatchField<scalar>&) {}
|
|
||||||
|
|
||||||
virtual void operator+=(const Field<Type>&) {}
|
|
||||||
virtual void operator-=(const Field<Type>&) {}
|
|
||||||
|
|
||||||
virtual void operator*=(const Field<scalar>&) {}
|
|
||||||
virtual void operator/=(const Field<scalar>&) {}
|
|
||||||
|
|
||||||
virtual void operator=(const Type&) {}
|
|
||||||
virtual void operator+=(const Type&) {}
|
|
||||||
virtual void operator-=(const Type&) {}
|
|
||||||
virtual void operator*=(const scalar) {}
|
|
||||||
virtual void operator/=(const scalar) {}
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#ifdef NoRepository
|
|
||||||
#include "mixedFixedValueSlipFvPatchField.C"
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,43 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 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 "mixedFixedValueSlipFvPatchFields.H"
|
|
||||||
#include "addToRunTimeSelectionTable.H"
|
|
||||||
#include "volFields.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
makePatchFields(mixedFixedValueSlip);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,49 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef mixedFixedValueSlipFvPatchFields_H
|
|
||||||
#define mixedFixedValueSlipFvPatchFields_H
|
|
||||||
|
|
||||||
#include "mixedFixedValueSlipFvPatchField.H"
|
|
||||||
#include "fieldTypes.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
makePatchTypeFieldTypedefs(mixedFixedValueSlip);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -1,50 +0,0 @@
|
|||||||
/*---------------------------------------------------------------------------*\
|
|
||||||
========= |
|
|
||||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
|
||||||
\\ / O peration |
|
|
||||||
\\ / A nd | Copyright (C) 2011 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/>.
|
|
||||||
|
|
||||||
\*---------------------------------------------------------------------------*/
|
|
||||||
|
|
||||||
#ifndef mixedFixedValueSlipFvPatchFieldsFwd_H
|
|
||||||
#define mixedFixedValueSlipFvPatchFieldsFwd_H
|
|
||||||
|
|
||||||
#include "fieldTypes.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
namespace Foam
|
|
||||||
{
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
template<class Type> class mixedFixedValueSlipFvPatchField;
|
|
||||||
|
|
||||||
makePatchTypeFieldTypedefs(mixedFixedValueSlip);
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
} // End namespace Foam
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
|
||||||
|
|
||||||
#endif
|
|
||||||
|
|
||||||
// ************************************************************************* //
|
|
||||||
@ -56,9 +56,7 @@ int main(int argc, char *argv[])
|
|||||||
#include "setRootCase.H"
|
#include "setRootCase.H"
|
||||||
#include "createTime.H"
|
#include "createTime.H"
|
||||||
#include "createDynamicFvMesh.H"
|
#include "createDynamicFvMesh.H"
|
||||||
|
#include "createControl.H"
|
||||||
pimpleControl pimple(mesh);
|
|
||||||
|
|
||||||
#include "createRDeltaT.H"
|
#include "createRDeltaT.H"
|
||||||
#include "initContinuityErrs.H"
|
#include "initContinuityErrs.H"
|
||||||
#include "createFields.H"
|
#include "createFields.H"
|
||||||
|
|||||||
@ -86,9 +86,25 @@ if (mesh.changing())
|
|||||||
fvm::laplacian(rAUf, pcorr) == fvc::div(phi)
|
fvm::laplacian(rAUf, pcorr) == fvc::div(phi)
|
||||||
);
|
);
|
||||||
|
|
||||||
//pcorrEqn.setReference(refCellI2, 0.0, true);
|
|
||||||
scalarList values(nZones, 0.0);
|
// Only set reference for cells that are CALCULATED
|
||||||
pcorrEqn.setReferences(refCells, values, true);
|
{
|
||||||
|
DynamicList<label> validCells(refCells.size());
|
||||||
|
forAll(refCells, zoneId)
|
||||||
|
{
|
||||||
|
if (refCells[zoneId] != -1)
|
||||||
|
{
|
||||||
|
validCells.append(refCells[zoneId]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pcorrEqn.setReferences
|
||||||
|
(
|
||||||
|
validCells,
|
||||||
|
scalarList(validCells.size(), 0.0),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
const dictionary& d = mesh.solver
|
const dictionary& d = mesh.solver
|
||||||
(
|
(
|
||||||
@ -97,6 +113,7 @@ if (mesh.changing())
|
|||||||
pimple.finalInnerIter()
|
pimple.finalInnerIter()
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
//Bypass virtual layer
|
||||||
mesh.fvMesh::solve(pcorrEqn, d);
|
mesh.fvMesh::solve(pcorrEqn, d);
|
||||||
|
|
||||||
if (pimple.finalNonOrthogonalIter())
|
if (pimple.finalNonOrthogonalIter())
|
||||||
|
|||||||
@ -110,6 +110,11 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
mixture.correct();
|
mixture.correct();
|
||||||
|
|
||||||
|
if (pimple.frozenFlow())
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
#include "UEqn.H"
|
#include "UEqn.H"
|
||||||
|
|
||||||
// --- Pressure corrector loop
|
// --- Pressure corrector loop
|
||||||
|
|||||||
@ -96,9 +96,25 @@
|
|||||||
fvm::laplacian(rAUf, pcorr) == fvc::div(phi)
|
fvm::laplacian(rAUf, pcorr) == fvc::div(phi)
|
||||||
);
|
);
|
||||||
|
|
||||||
//pcorrEqn.setReference(refCellI2, 0, true);
|
// Only set reference for cells that are CALCULATED
|
||||||
scalarList values(nZones, 0.0);
|
{
|
||||||
pcorrEqn.setReferences(refCells, values, true);
|
DynamicList<label> validCells(refCells.size());
|
||||||
|
forAll(refCells, zoneId)
|
||||||
|
{
|
||||||
|
if (refCells[zoneId] != -1)
|
||||||
|
{
|
||||||
|
validCells.append(refCells[zoneId]);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pcorrEqn.setReferences
|
||||||
|
(
|
||||||
|
validCells,
|
||||||
|
scalarList(validCells.size(), 0.0),
|
||||||
|
true
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
const dictionary& d = mesh.solver
|
const dictionary& d = mesh.solver
|
||||||
(
|
(
|
||||||
@ -117,9 +133,9 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (runTime.outputTime())
|
//if (runTime.outputTime())
|
||||||
{
|
//{
|
||||||
volScalarField("contPhiPcorr", fvc::div(phi)).write();
|
// volScalarField("contPhiPcorr", fvc::div(phi)).write();
|
||||||
pcorr.write();
|
// pcorr.write();
|
||||||
}
|
//}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,10 +1,2 @@
|
|||||||
// Defining isoAdvection
|
// Defining isoAdvection
|
||||||
isoAdvection advector(alpha1, phi, U);
|
isoAdvection advector(alpha1, phi, U);
|
||||||
|
|
||||||
bool frozenFlow = pimple.dict().lookupOrDefault<bool>("frozenFlow", false);
|
|
||||||
if (frozenFlow)
|
|
||||||
{
|
|
||||||
Info<< "Employing frozen-flow assumption: "
|
|
||||||
<< "pressure-velocity system will not be updated"
|
|
||||||
<< endl;
|
|
||||||
}
|
|
||||||
|
|||||||
@ -108,7 +108,7 @@ int main(int argc, char *argv[])
|
|||||||
|
|
||||||
mixture.correct();
|
mixture.correct();
|
||||||
|
|
||||||
if (frozenFlow)
|
if (pimple.frozenFlow())
|
||||||
{
|
{
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: dev |
|
| \\ / O peration | Version: plus |
|
||||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: dev |
|
| \\ / O peration | Version: plus |
|
||||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: dev-OpenCFD.overlap |
|
| \\ / O peration | Version: plus |
|
||||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: dev |
|
| \\ / O peration | Version: plus |
|
||||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: dev |
|
| \\ / O peration | Version: plus |
|
||||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: 1.5 |
|
| \\ / O peration | Version: plus |
|
||||||
| \\ / A nd | Web: http://www.OpenFOAM.org |
|
| \\ / A nd | Web: http://www.OpenFOAM.com |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: dev |
|
| \\ / O peration | Version: plus |
|
||||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: dev |
|
| \\ / O peration | Version: plus |
|
||||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: dev |
|
| \\ / O peration | Version: plus |
|
||||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: dev |
|
| \\ / O peration | Version: plus |
|
||||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
|
|||||||
@ -1,8 +1,8 @@
|
|||||||
/*--------------------------------*- C++ -*----------------------------------*\
|
/*--------------------------------*- C++ -*----------------------------------*\
|
||||||
| ========= | |
|
| ========= | |
|
||||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||||
| \\ / O peration | Version: dev |
|
| \\ / O peration | Version: plus |
|
||||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
| \\ / A nd | Web: www.OpenFOAM.com |
|
||||||
| \\/ M anipulation | |
|
| \\/ M anipulation | |
|
||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
FoamFile
|
FoamFile
|
||||||
|
|||||||
@ -651,7 +651,7 @@ int main(int argc, char *argv[])
|
|||||||
);
|
);
|
||||||
|
|
||||||
// corrector for mesh motion
|
// corrector for mesh motion
|
||||||
twoDPointCorrector* correct2DPtr = NULL;
|
twoDPointCorrector* correct2DPtr = nullptr;
|
||||||
|
|
||||||
if (motionObj.typeHeaderOk<IOdictionary>(true))
|
if (motionObj.typeHeaderOk<IOdictionary>(true))
|
||||||
{
|
{
|
||||||
|
|||||||
@ -97,7 +97,7 @@ void Foam::writeFields
|
|||||||
(
|
(
|
||||||
radToDeg
|
radToDeg
|
||||||
(
|
(
|
||||||
Foam::acos(min(1.0, faceOrthogonality))
|
Foam::acos(min(scalar(1.0), faceOrthogonality))
|
||||||
)
|
)
|
||||||
);
|
);
|
||||||
|
|
||||||
|
|||||||
@ -28,7 +28,7 @@ int USERD_set_filenames
|
|||||||
// remove the last '/' from rootDir
|
// remove the last '/' from rootDir
|
||||||
if (the_path[lRoot-1] == '/')
|
if (the_path[lRoot-1] == '/')
|
||||||
{
|
{
|
||||||
the_path[lRoot-1] = char(NULL);
|
the_path[lRoot-1] = '\0';
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|||||||
@ -97,6 +97,7 @@ done
|
|||||||
cat << HEADER > $outFile
|
cat << HEADER > $outFile
|
||||||
#----------------------------------*-sh-*--------------------------------------
|
#----------------------------------*-sh-*--------------------------------------
|
||||||
# Bash completions for OpenFOAM applications
|
# Bash completions for OpenFOAM applications
|
||||||
|
# Formatted as "complete ... -F _of_APPNAME APPNAME
|
||||||
|
|
||||||
unset -f _of_filter_opts 2>/dev/null
|
unset -f _of_filter_opts 2>/dev/null
|
||||||
_of_filter_opts()
|
_of_filter_opts()
|
||||||
|
|||||||
@ -62,6 +62,14 @@ die()
|
|||||||
exit 1
|
exit 1
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# Automatically upgrade copyrights in files.
|
||||||
|
# Disabled by default since some changes (eg, spelling) do not automatically
|
||||||
|
# imply an update copyright.
|
||||||
|
optCopyright=false
|
||||||
|
|
||||||
|
# Run all tests (do not exit on first failure)
|
||||||
|
optAll=false
|
||||||
|
|
||||||
#-----------------------------------------------------------------------------
|
#-----------------------------------------------------------------------------
|
||||||
# Check content that will be added by this commit.
|
# Check content that will be added by this commit.
|
||||||
|
|
||||||
@ -76,11 +84,27 @@ fi
|
|||||||
# called manually with arguments for the files/directories to be tested?
|
# called manually with arguments for the files/directories to be tested?
|
||||||
if [ "$#" -gt 0 ]
|
if [ "$#" -gt 0 ]
|
||||||
then
|
then
|
||||||
case "$1" in
|
while [ "$#" -gt 0 ]
|
||||||
-h | -help)
|
do
|
||||||
die "interactive usage: supply list of files/directories to check"
|
case "$1" in
|
||||||
;;
|
-h | -help)
|
||||||
esac
|
die "interactive usage: supply list of files/directories to check"
|
||||||
|
;;
|
||||||
|
-copy)
|
||||||
|
echo "$hookName: adjust copyright enabled" 1>&2
|
||||||
|
optCopyright=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
-all)
|
||||||
|
echo "$hookName: do all tests (no premature exit)" 1>&2
|
||||||
|
optAll=true
|
||||||
|
shift
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
break
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
|
||||||
# obtain list of all specified files/directories
|
# obtain list of all specified files/directories
|
||||||
fileList=$(git ls-files -- $@ 2>/dev/null)
|
fileList=$(git ls-files -- $@ 2>/dev/null)
|
||||||
@ -100,6 +124,8 @@ unset badFiles
|
|||||||
# join list of files with this amount of space
|
# join list of files with this amount of space
|
||||||
Indent=" "
|
Indent=" "
|
||||||
|
|
||||||
|
exitCode=0
|
||||||
|
|
||||||
#
|
#
|
||||||
# report bad files and die if there are any
|
# report bad files and die if there are any
|
||||||
#
|
#
|
||||||
@ -114,7 +140,14 @@ dieOnBadFiles()
|
|||||||
echo "File(s):" 1>&2
|
echo "File(s):" 1>&2
|
||||||
echo "$badFiles" 1>&2
|
echo "$badFiles" 1>&2
|
||||||
echo '' 1>&2
|
echo '' 1>&2
|
||||||
exit 1
|
|
||||||
|
exitCode=1
|
||||||
|
if [ "$optAll" = true ]
|
||||||
|
then
|
||||||
|
return 0 # Continue to the next test
|
||||||
|
else
|
||||||
|
exit $exitCode
|
||||||
|
fi
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -314,7 +347,7 @@ MESSAGE
|
|||||||
|
|
||||||
|
|
||||||
#
|
#
|
||||||
# check that OpenFOAM Foundation copyright is current
|
# check that copyright date is current
|
||||||
#
|
#
|
||||||
checkCopyright()
|
checkCopyright()
|
||||||
{
|
{
|
||||||
@ -327,9 +360,9 @@ checkCopyright()
|
|||||||
startYear=`grep "Copyright.*OpenCFD" $f | sed 's/[^0-9]*\([0-9]*\).*/\1/g'`
|
startYear=`grep "Copyright.*OpenCFD" $f | sed 's/[^0-9]*\([0-9]*\).*/\1/g'`
|
||||||
endYear=`grep "Copyright.*-.*OpenCFD" $f | sed 's/[^-]*-\([0-9]*\).*/\1/g'`
|
endYear=`grep "Copyright.*-.*OpenCFD" $f | sed 's/[^-]*-\([0-9]*\).*/\1/g'`
|
||||||
#echo "startYear=$startYear endYear=$endYear"
|
#echo "startYear=$startYear endYear=$endYear"
|
||||||
if [ "$startYear" != "" ]
|
if [ -n "$startYear" ]
|
||||||
then
|
then
|
||||||
if [ "$endYear" != "" ]
|
if [ -n "$endYear" ]
|
||||||
then
|
then
|
||||||
# Date is of type 2011-2012 OpenCFD Ltd.
|
# Date is of type 2011-2012 OpenCFD Ltd.
|
||||||
if [ "$year" != "$endYear" ]
|
if [ "$year" != "$endYear" ]
|
||||||
@ -371,7 +404,11 @@ checkLineLengthNonDirective
|
|||||||
# check for non-standard code patterns
|
# check for non-standard code patterns
|
||||||
checkNonStandardCodePatterns
|
checkNonStandardCodePatterns
|
||||||
|
|
||||||
checkCopyright
|
# Stop now if there were any errors
|
||||||
|
[ "$exitCode" = 0 ] || exit $exitCode
|
||||||
|
|
||||||
|
# check copyright date (normally disabled)
|
||||||
|
[ "$optCopyright" = true ] && checkCopyright
|
||||||
|
|
||||||
exit 0
|
exit 0
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
|
|||||||
@ -66,3 +66,23 @@
|
|||||||
content: "C++ Source Code Guide";
|
content: "C++ Source Code Guide";
|
||||||
font-size: 180%;
|
font-size: 180%;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.OFTable {
|
||||||
|
width: 100%;
|
||||||
|
border: 0px;
|
||||||
|
margin-top: 10px;
|
||||||
|
margin-bottom: 10px;
|
||||||
|
background-color: rgb(245,245,245);
|
||||||
|
padding: 5px;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
.OFTable th {
|
||||||
|
text-align: left;
|
||||||
|
padding: 5px;
|
||||||
|
border-bottom: 2px solid rgb(175,175,175);
|
||||||
|
}
|
||||||
|
|
||||||
|
.OFTable td {
|
||||||
|
padding-left: 5px;
|
||||||
|
}
|
||||||
|
|||||||
@ -1,5 +1,6 @@
|
|||||||
#----------------------------------*-sh-*--------------------------------------
|
#----------------------------------*-sh-*--------------------------------------
|
||||||
# Bash completions for OpenFOAM applications
|
# Bash completions for OpenFOAM applications
|
||||||
|
# Formatted as "complete ... -F _of_APPNAME APPNAME
|
||||||
|
|
||||||
unset -f _of_filter_opts 2>/dev/null
|
unset -f _of_filter_opts 2>/dev/null
|
||||||
_of_filter_opts()
|
_of_filter_opts()
|
||||||
@ -3053,6 +3054,41 @@ _of_interFoam()
|
|||||||
}
|
}
|
||||||
complete -o nospace -F _of_interFoam interFoam
|
complete -o nospace -F _of_interFoam interFoam
|
||||||
|
|
||||||
|
unset -f _of_interIsoFoam 2>/dev/null
|
||||||
|
_of_interIsoFoam()
|
||||||
|
{
|
||||||
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
local prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
|
||||||
|
local opts="-noFunctionObjects -parallel -postProcess -srcDoc -doc -help "
|
||||||
|
local optsWithArgs="-case -decomposeParDict -roots "
|
||||||
|
|
||||||
|
case ${prev} in
|
||||||
|
-case)
|
||||||
|
COMPREPLY=($(compgen -d -- ${cur}))
|
||||||
|
;;
|
||||||
|
*Dict)
|
||||||
|
COMPREPLY=($(compgen -f -- ${cur}))
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
|
||||||
|
then
|
||||||
|
# Unknown type of arg follows - set to files.
|
||||||
|
# Not always correct but can still navigate path if needed...
|
||||||
|
COMPREPLY=($(compgen -f -- ${cur}))
|
||||||
|
else
|
||||||
|
# Catch-all - present all remaining options
|
||||||
|
opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
|
||||||
|
optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
|
||||||
|
COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
complete -o nospace -F _of_interIsoFoam interIsoFoam
|
||||||
|
|
||||||
unset -f _of_interMixingFoam 2>/dev/null
|
unset -f _of_interMixingFoam 2>/dev/null
|
||||||
_of_interMixingFoam()
|
_of_interMixingFoam()
|
||||||
{
|
{
|
||||||
@ -3225,6 +3261,116 @@ _of_laplacianFoam()
|
|||||||
}
|
}
|
||||||
complete -o nospace -F _of_laplacianFoam laplacianFoam
|
complete -o nospace -F _of_laplacianFoam laplacianFoam
|
||||||
|
|
||||||
|
unset -f _of_lumpedPointForces 2>/dev/null
|
||||||
|
_of_lumpedPointForces()
|
||||||
|
{
|
||||||
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
local prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
|
||||||
|
local opts="-constant -latestTime -newTimes -noZero -parallel -vtk -srcDoc -doc -help "
|
||||||
|
local optsWithArgs="-case -decomposeParDict -region -roots -time "
|
||||||
|
|
||||||
|
case ${prev} in
|
||||||
|
-case)
|
||||||
|
COMPREPLY=($(compgen -d -- ${cur}))
|
||||||
|
;;
|
||||||
|
*Dict)
|
||||||
|
COMPREPLY=($(compgen -f -- ${cur}))
|
||||||
|
;;
|
||||||
|
-region)
|
||||||
|
local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
|
||||||
|
COMPREPLY=($(compgen -W "$regions" -- ${cur}))
|
||||||
|
;;
|
||||||
|
-time)
|
||||||
|
COMPREPLY=($(compgen -d -X '![-0-9]*' -- ${cur}))
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
|
||||||
|
then
|
||||||
|
# Unknown type of arg follows - set to files.
|
||||||
|
# Not always correct but can still navigate path if needed...
|
||||||
|
COMPREPLY=($(compgen -f -- ${cur}))
|
||||||
|
else
|
||||||
|
# Catch-all - present all remaining options
|
||||||
|
opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
|
||||||
|
optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
|
||||||
|
COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
complete -o nospace -F _of_lumpedPointForces lumpedPointForces
|
||||||
|
|
||||||
|
unset -f _of_lumpedPointMovement 2>/dev/null
|
||||||
|
_of_lumpedPointMovement()
|
||||||
|
{
|
||||||
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
local prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
|
||||||
|
local opts="-removeLock -slave -srcDoc -doc -help "
|
||||||
|
local optsWithArgs="-case -max -scale -span "
|
||||||
|
|
||||||
|
case ${prev} in
|
||||||
|
-case)
|
||||||
|
COMPREPLY=($(compgen -d -- ${cur}))
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
|
||||||
|
then
|
||||||
|
# Unknown type of arg follows - set to files.
|
||||||
|
# Not always correct but can still navigate path if needed...
|
||||||
|
COMPREPLY=($(compgen -f -- ${cur}))
|
||||||
|
else
|
||||||
|
# Catch-all - present all remaining options
|
||||||
|
opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
|
||||||
|
optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
|
||||||
|
COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
complete -o nospace -F _of_lumpedPointMovement lumpedPointMovement
|
||||||
|
|
||||||
|
unset -f _of_lumpedPointZones 2>/dev/null
|
||||||
|
_of_lumpedPointZones()
|
||||||
|
{
|
||||||
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
local prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
|
||||||
|
local opts="-verbose -srcDoc -doc -help "
|
||||||
|
local optsWithArgs="-case -region "
|
||||||
|
|
||||||
|
case ${prev} in
|
||||||
|
-case)
|
||||||
|
COMPREPLY=($(compgen -d -- ${cur}))
|
||||||
|
;;
|
||||||
|
-region)
|
||||||
|
local regions=$(sed 's#/##g' <<< $([ -d system ] && (\cd system && (\ls -d */ 2>/dev/null))))
|
||||||
|
COMPREPLY=($(compgen -W "$regions" -- ${cur}))
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
|
||||||
|
then
|
||||||
|
# Unknown type of arg follows - set to files.
|
||||||
|
# Not always correct but can still navigate path if needed...
|
||||||
|
COMPREPLY=($(compgen -f -- ${cur}))
|
||||||
|
else
|
||||||
|
# Catch-all - present all remaining options
|
||||||
|
opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
|
||||||
|
optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
|
||||||
|
COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
complete -o nospace -F _of_lumpedPointZones lumpedPointZones
|
||||||
|
|
||||||
unset -f _of_magneticFoam 2>/dev/null
|
unset -f _of_magneticFoam 2>/dev/null
|
||||||
_of_magneticFoam()
|
_of_magneticFoam()
|
||||||
{
|
{
|
||||||
@ -5831,6 +5977,41 @@ _of_selectCells()
|
|||||||
}
|
}
|
||||||
complete -o nospace -F _of_selectCells selectCells
|
complete -o nospace -F _of_selectCells selectCells
|
||||||
|
|
||||||
|
unset -f _of_setAlphaField 2>/dev/null
|
||||||
|
_of_setAlphaField()
|
||||||
|
{
|
||||||
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
|
local prev="${COMP_WORDS[COMP_CWORD-1]}"
|
||||||
|
|
||||||
|
local opts="-noFunctionObjects -parallel -srcDoc -doc -help "
|
||||||
|
local optsWithArgs="-case -decomposeParDict -roots "
|
||||||
|
|
||||||
|
case ${prev} in
|
||||||
|
-case)
|
||||||
|
COMPREPLY=($(compgen -d -- ${cur}))
|
||||||
|
;;
|
||||||
|
*Dict)
|
||||||
|
COMPREPLY=($(compgen -f -- ${cur}))
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
if [ "${optsWithArgs/${prev} /}" != "${optsWithArgs}" ]
|
||||||
|
then
|
||||||
|
# Unknown type of arg follows - set to files.
|
||||||
|
# Not always correct but can still navigate path if needed...
|
||||||
|
COMPREPLY=($(compgen -f -- ${cur}))
|
||||||
|
else
|
||||||
|
# Catch-all - present all remaining options
|
||||||
|
opts=$(_of_filter_opts "${opts}" "${COMP_LINE}")
|
||||||
|
optsWithArgs=$(_of_filter_opts "${optsWithArgs}" "${COMP_LINE}")
|
||||||
|
COMPREPLY=($(compgen -W "${opts} ${optsWithArgs}" -- ${cur}))
|
||||||
|
fi
|
||||||
|
;;
|
||||||
|
esac
|
||||||
|
|
||||||
|
return 0
|
||||||
|
}
|
||||||
|
complete -o nospace -F _of_setAlphaField setAlphaField
|
||||||
|
|
||||||
unset -f _of_setFields 2>/dev/null
|
unset -f _of_setFields 2>/dev/null
|
||||||
_of_setFields()
|
_of_setFields()
|
||||||
{
|
{
|
||||||
|
|||||||
@ -181,6 +181,17 @@ unset -f wmRefresh 2>/dev/null
|
|||||||
unset -f foamVersion 2>/dev/null
|
unset -f foamVersion 2>/dev/null
|
||||||
unset -f foamPV 2>/dev/null
|
unset -f foamPV 2>/dev/null
|
||||||
|
|
||||||
|
# Cleanup bash completions, which look like this:
|
||||||
|
# "complete ... -F _of_APPNAME APPNAME
|
||||||
|
# For economy, obtain list first but also add in 'filter_opts' helper
|
||||||
|
foamClean="$(complete 2>/dev/null | sed -n -e 's/complete.*-F _of_.* \(..*\)$/\1/p')"
|
||||||
|
for cleaned in $foamClean filter_opts
|
||||||
|
do
|
||||||
|
unset -f _of_$cleaned 2>/dev/null
|
||||||
|
complete -r $cleaned 2>/dev/null
|
||||||
|
done
|
||||||
|
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Intermediate variables (do as last for a clean exit code)
|
# Intermediate variables (do as last for a clean exit code)
|
||||||
|
|
||||||
|
|||||||
@ -1284,7 +1284,7 @@ int Foam::system(const Foam::UList<Foam::string>& command)
|
|||||||
{
|
{
|
||||||
// in child:
|
// in child:
|
||||||
// Need command and arguments separately.
|
// Need command and arguments separately.
|
||||||
// args is a NULL-terminated list of c-strings
|
// args is a nullptr-terminated list of c-strings
|
||||||
|
|
||||||
CStringList args(SubList<string>(command, 0));
|
CStringList args(SubList<string>(command, 0));
|
||||||
if (argc > 1)
|
if (argc > 1)
|
||||||
|
|||||||
@ -97,10 +97,11 @@ inline uint64_t Foam::endian::swap64(uint64_t u)
|
|||||||
);
|
);
|
||||||
|
|
||||||
// alternative formulation
|
// alternative formulation
|
||||||
//
|
/*
|
||||||
// u = ((u<< 8) & 0xFF00FF00FF00FF00ull) | ((u>> 8) & 0x00FF00FF00FF00FFull);
|
u = ((u<< 8) & 0xFF00FF00FF00FF00ull) | ((u>> 8) & 0x00FF00FF00FF00FFull);
|
||||||
// u = ((u<<16) & 0xFFFF0000FFFF0000ull) | ((u>>16) & 0x0000FFFF0000FFFFull);
|
u = ((u<<16) & 0xFFFF0000FFFF0000ull) | ((u>>16) & 0x0000FFFF0000FFFFull);
|
||||||
// return (u >> 32) | (u << 32);
|
return (u >> 32) | (u << 32);
|
||||||
|
*/
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -39,6 +39,14 @@ namespace Foam
|
|||||||
bool Foam::functionObject::postProcess(false);
|
bool Foam::functionObject::postProcess(false);
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::word Foam::functionObject::scopedName(const word& name) const
|
||||||
|
{
|
||||||
|
return name_ + ":" + name;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
Foam::functionObject::functionObject(const word& name)
|
Foam::functionObject::functionObject(const word& name)
|
||||||
|
|||||||
@ -154,6 +154,14 @@ class functionObject
|
|||||||
void operator=(const functionObject&) = delete;
|
void operator=(const functionObject&) = delete;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
// Protected Member Functions
|
||||||
|
|
||||||
|
//- Return a scoped name, e.g. used to construct local field names
|
||||||
|
word scopedName(const word& name) const;
|
||||||
|
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
//- Runtime type information
|
//- Runtime type information
|
||||||
|
|||||||
@ -158,7 +158,7 @@ Foam::functionObjects::regionFunctionObject::~regionFunctionObject()
|
|||||||
|
|
||||||
bool Foam::functionObjects::regionFunctionObject::read(const dictionary& dict)
|
bool Foam::functionObjects::regionFunctionObject::read(const dictionary& dict)
|
||||||
{
|
{
|
||||||
return functionObject::read(dict);
|
return stateFunctionObject::read(dict);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -248,7 +248,7 @@ bool Foam::timeControl::execute()
|
|||||||
default:
|
default:
|
||||||
{
|
{
|
||||||
FatalErrorInFunction
|
FatalErrorInFunction
|
||||||
<< "Undefined output control: "
|
<< "Undefined time control: "
|
||||||
<< timeControlNames_[timeControl_] << nl
|
<< timeControlNames_[timeControl_] << nl
|
||||||
<< abort(FatalError);
|
<< abort(FatalError);
|
||||||
break;
|
break;
|
||||||
|
|||||||
@ -51,9 +51,20 @@ void Foam::functionObjects::timeControl::readControls()
|
|||||||
{
|
{
|
||||||
timeEnd_ = time_.userTimeToTime(timeEnd_);
|
timeEnd_ = time_.userTimeToTime(timeEnd_);
|
||||||
}
|
}
|
||||||
deltaTCoeff_ = dict_.lookupOrDefault("deltaTCoeff", GREAT);
|
deltaTCoeff_ = GREAT;
|
||||||
|
if (dict_.readIfPresent("deltaTCoeff", deltaTCoeff_))
|
||||||
dict_.readIfPresent("nStepsToStartTimeChange", nStepsToStartTimeChange_);
|
{
|
||||||
|
nStepsToStartTimeChange_ = labelMax;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
nStepsToStartTimeChange_ = 3;
|
||||||
|
dict_.readIfPresent
|
||||||
|
(
|
||||||
|
"nStepsToStartTimeChange",
|
||||||
|
nStepsToStartTimeChange_
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@ -73,7 +84,6 @@ Foam::scalar Foam::functionObjects::timeControl::calcExpansion
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
scalar ratio = startRatio;
|
scalar ratio = startRatio;
|
||||||
|
|
||||||
// This function is used to calculate the 'expansion ratio' or
|
// This function is used to calculate the 'expansion ratio' or
|
||||||
// 'time step growth factor'. Inputs:
|
// 'time step growth factor'. Inputs:
|
||||||
// - ratio: wanted ratio
|
// - ratio: wanted ratio
|
||||||
@ -226,7 +236,6 @@ void Foam::functionObjects::timeControl::calcDeltaTCoeff
|
|||||||
// has reached one that is possible. Returns the new expansionratio.
|
// has reached one that is possible. Returns the new expansionratio.
|
||||||
|
|
||||||
scalar y = timeToNextMultiple/wantedDT;
|
scalar y = timeToNextMultiple/wantedDT;
|
||||||
|
|
||||||
label requiredSteps = nSteps;
|
label requiredSteps = nSteps;
|
||||||
|
|
||||||
scalar ratioEstimate = deltaTCoeff_;
|
scalar ratioEstimate = deltaTCoeff_;
|
||||||
@ -240,6 +249,7 @@ void Foam::functionObjects::timeControl::calcDeltaTCoeff
|
|||||||
if (!rampDirectionUp)
|
if (!rampDirectionUp)
|
||||||
{
|
{
|
||||||
ratioEstimate = 1/ratioEstimate;
|
ratioEstimate = 1/ratioEstimate;
|
||||||
|
ratioMax = 1/ratioMax;
|
||||||
requiredSteps *= -1;
|
requiredSteps *= -1;
|
||||||
}
|
}
|
||||||
// Provision for fall-back value if we can't satisfy requirements
|
// Provision for fall-back value if we can't satisfy requirements
|
||||||
@ -253,16 +263,18 @@ void Foam::functionObjects::timeControl::calcDeltaTCoeff
|
|||||||
y,
|
y,
|
||||||
requiredSteps
|
requiredSteps
|
||||||
);
|
);
|
||||||
const scalar deltaTLoop = wantedDT/pow(newRatio, requiredSteps-1);
|
const scalar deltaTLoop =
|
||||||
|
wantedDT
|
||||||
|
/ pow(newRatio, mag(requiredSteps)-1);
|
||||||
scalar firstDeltaRatio = deltaTLoop/deltaT0_;
|
scalar firstDeltaRatio = deltaTLoop/deltaT0_;
|
||||||
|
// Avoid division by zero for ratio = 1.0
|
||||||
|
scalar Sn =
|
||||||
|
deltaTLoop
|
||||||
|
*(pow(newRatio, mag(requiredSteps))-1)
|
||||||
|
/(newRatio-1+SMALL);
|
||||||
|
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
// Avoid division by zero for ratio = 1.0
|
|
||||||
scalar Sn =
|
|
||||||
deltaTLoop
|
|
||||||
*(pow(newRatio, requiredSteps)-1)
|
|
||||||
/(newRatio-1+SMALL);
|
|
||||||
|
|
||||||
Info<< " nSteps " << requiredSteps
|
Info<< " nSteps " << requiredSteps
|
||||||
<< " ratioEstimate " << ratioEstimate
|
<< " ratioEstimate " << ratioEstimate
|
||||||
<< " a0 " << deltaTLoop
|
<< " a0 " << deltaTLoop
|
||||||
@ -281,7 +293,7 @@ void Foam::functionObjects::timeControl::calcDeltaTCoeff
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
y += 1;
|
y += 1;
|
||||||
requiredSteps = nSteps;
|
requiredSteps = mag(nSteps);
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "firstDeltaRatio " << firstDeltaRatio << " rampDir"
|
Info<< "firstDeltaRatio " << firstDeltaRatio << " rampDir"
|
||||||
@ -291,7 +303,7 @@ void Foam::functionObjects::timeControl::calcDeltaTCoeff
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (firstDeltaRatio > ratioMax)
|
if (firstDeltaRatio > ratioMax && rampDirectionUp)
|
||||||
{
|
{
|
||||||
requiredSteps++;
|
requiredSteps++;
|
||||||
if (debug)
|
if (debug)
|
||||||
@ -302,7 +314,22 @@ void Foam::functionObjects::timeControl::calcDeltaTCoeff
|
|||||||
<< endl;
|
<< endl;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (newRatio > ratioMax)
|
else if (firstDeltaRatio < ratioMax && !rampDirectionUp)
|
||||||
|
{
|
||||||
|
requiredSteps--;
|
||||||
|
if (debug)
|
||||||
|
{
|
||||||
|
Info<< "First ratio " << firstDeltaRatio
|
||||||
|
<< " exceeds threshold " << ratioMax << nl
|
||||||
|
<< "Decreasing required steps " << requiredSteps
|
||||||
|
<< endl;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if
|
||||||
|
(
|
||||||
|
(newRatio > ratioMax && rampDirectionUp)
|
||||||
|
|| (newRatio < ratioMax && !rampDirectionUp)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
y += 1;
|
y += 1;
|
||||||
requiredSteps = nSteps;
|
requiredSteps = nSteps;
|
||||||
@ -319,8 +346,19 @@ void Foam::functionObjects::timeControl::calcDeltaTCoeff
|
|||||||
// Reset future series expansion at last step
|
// Reset future series expansion at last step
|
||||||
if (requiredSteps == 1)
|
if (requiredSteps == 1)
|
||||||
{
|
{
|
||||||
|
Sn = deltaT0_*firstDeltaRatio;
|
||||||
seriesDTCoeff_ = GREAT;
|
seriesDTCoeff_ = GREAT;
|
||||||
}
|
}
|
||||||
|
// Situations where we achieve wantedDT but fail to achieve
|
||||||
|
// multiple of writeInterval
|
||||||
|
scalar jumpError =
|
||||||
|
remainder(Sn + presentTime, wantedDT) / wantedDT;
|
||||||
|
|
||||||
|
if (mag(jumpError) > ROOTSMALL)
|
||||||
|
{
|
||||||
|
requiredSteps = label(timeToNextWrite/wantedDT);
|
||||||
|
firstDeltaRatio = timeToNextWrite/requiredSteps/deltaT0_;
|
||||||
|
}
|
||||||
if (debug)
|
if (debug)
|
||||||
{
|
{
|
||||||
Info<< "All conditions satisfied deltaT0_:" << deltaT0_
|
Info<< "All conditions satisfied deltaT0_:" << deltaT0_
|
||||||
@ -365,10 +403,7 @@ Foam::functionObjects::timeControl::timeControl
|
|||||||
dict_(dict),
|
dict_(dict),
|
||||||
timeStart_(-VGREAT),
|
timeStart_(-VGREAT),
|
||||||
timeEnd_(VGREAT),
|
timeEnd_(VGREAT),
|
||||||
nStepsToStartTimeChange_
|
nStepsToStartTimeChange_(labelMax),
|
||||||
(
|
|
||||||
dict.lookupOrDefault("nStepsToStartTimeChange", 3)
|
|
||||||
),
|
|
||||||
executeControl_(t, dict, "execute"),
|
executeControl_(t, dict, "execute"),
|
||||||
writeControl_(t, dict, "write"),
|
writeControl_(t, dict, "write"),
|
||||||
foPtr_(functionObject::New(name, t, dict_)),
|
foPtr_(functionObject::New(name, t, dict_)),
|
||||||
@ -494,7 +529,14 @@ bool Foam::functionObjects::timeControl::adjustTimeStep()
|
|||||||
scalar nSteps = timeToNextWrite/deltaT;
|
scalar nSteps = timeToNextWrite/deltaT;
|
||||||
|
|
||||||
// For tiny deltaT the label can overflow!
|
// For tiny deltaT the label can overflow!
|
||||||
if (nSteps < labelMax)
|
if
|
||||||
|
(
|
||||||
|
nSteps < labelMax
|
||||||
|
&& (
|
||||||
|
deltaTCoeff_ != GREAT
|
||||||
|
|| nSteps < nStepsToStartTimeChange_
|
||||||
|
)
|
||||||
|
)
|
||||||
{
|
{
|
||||||
// nSteps can be < 1 so make sure at least 1
|
// nSteps can be < 1 so make sure at least 1
|
||||||
|
|
||||||
@ -517,6 +559,7 @@ bool Foam::functionObjects::timeControl::adjustTimeStep()
|
|||||||
clipThreshold = 1/clipThreshold;
|
clipThreshold = 1/clipThreshold;
|
||||||
deltaT = max(newDeltaT, clipThreshold*deltaT);
|
deltaT = max(newDeltaT, clipThreshold*deltaT);
|
||||||
}
|
}
|
||||||
|
|
||||||
const_cast<Time&>(time_).setDeltaT(deltaT, false);
|
const_cast<Time&>(time_).setDeltaT(deltaT, false);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -73,7 +73,7 @@ class CStringList
|
|||||||
// Does not include the final nul-character
|
// Does not include the final nul-character
|
||||||
size_t len_;
|
size_t len_;
|
||||||
|
|
||||||
//- List of strings, including trailing NULL pointer
|
//- List of strings, including trailing nullptr
|
||||||
char** argv_;
|
char** argv_;
|
||||||
|
|
||||||
//- Flattened content with interspersed nul-characters
|
//- Flattened content with interspersed nul-characters
|
||||||
@ -109,8 +109,8 @@ public:
|
|||||||
|
|
||||||
// Public Members
|
// Public Members
|
||||||
|
|
||||||
//- Count the number of parameters until the first NULL pointer.
|
//- Count the number of parameters until the first nullptr
|
||||||
// Return 0 if argv is NULL.
|
// Return 0 if argv is nullptr.
|
||||||
static inline int count(const char * const argv[]);
|
static inline int count(const char * const argv[]);
|
||||||
|
|
||||||
|
|
||||||
@ -120,7 +120,7 @@ public:
|
|||||||
inline int size() const;
|
inline int size() const;
|
||||||
|
|
||||||
//- Return the list of C-strings (ie, argv)
|
//- Return the list of C-strings (ie, argv)
|
||||||
// The position at argc is a NULL pointer
|
// The position at argc is a nullptr
|
||||||
inline char** strings() const;
|
inline char** strings() const;
|
||||||
|
|
||||||
|
|
||||||
@ -148,8 +148,8 @@ public:
|
|||||||
template<class StringType>
|
template<class StringType>
|
||||||
static List<StringType> asList(int argc, const char * const argv[]);
|
static List<StringType> asList(int argc, const char * const argv[]);
|
||||||
|
|
||||||
//- Create a list from a NULL-terminated list of argv parameters.
|
//- Create a list from a nullptr-terminated list of argv parameters.
|
||||||
// A null pointer for argv is permissible.
|
// Using a nullptr for argv is permissible.
|
||||||
template<class StringType>
|
template<class StringType>
|
||||||
static inline List<StringType> asList(const char * const argv[]);
|
static inline List<StringType> asList(const char * const argv[]);
|
||||||
|
|
||||||
|
|||||||
@ -85,10 +85,10 @@ bool Foam::ccm::base::close()
|
|||||||
{
|
{
|
||||||
if (CCMIOIsValidEntity(globalState_->root))
|
if (CCMIOIsValidEntity(globalState_->root))
|
||||||
{
|
{
|
||||||
CCMIOCloseFile(NULL, globalState_->root);
|
CCMIOCloseFile(nullptr, globalState_->root);
|
||||||
}
|
}
|
||||||
delete globalState_;
|
delete globalState_;
|
||||||
globalState_ = 0;
|
globalState_ = nullptr;
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -52,7 +52,7 @@ void Foam::ccm::reader::determineFieldInfo
|
|||||||
(
|
(
|
||||||
CCMIONextEntity
|
CCMIONextEntity
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
fieldSetNode,
|
fieldSetNode,
|
||||||
kCCMIOFieldPhase,
|
kCCMIOFieldPhase,
|
||||||
&phaseI,
|
&phaseI,
|
||||||
@ -74,7 +74,7 @@ void Foam::ccm::reader::determineFieldInfo
|
|||||||
(
|
(
|
||||||
CCMIONextEntity
|
CCMIONextEntity
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
phaseNode,
|
phaseNode,
|
||||||
kCCMIOField,
|
kCCMIOField,
|
||||||
&fieldI,
|
&fieldI,
|
||||||
@ -84,12 +84,12 @@ void Foam::ccm::reader::determineFieldInfo
|
|||||||
|
|
||||||
&& CCMIOReadField
|
&& CCMIOReadField
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
fieldNode,
|
fieldNode,
|
||||||
fullName,
|
fullName,
|
||||||
shortName,
|
shortName,
|
||||||
&dims,
|
&dims,
|
||||||
NULL
|
nullptr
|
||||||
)
|
)
|
||||||
== kCCMIONoErr
|
== kCCMIONoErr
|
||||||
)
|
)
|
||||||
@ -139,7 +139,7 @@ void Foam::ccm::reader::determineFieldInfo
|
|||||||
(
|
(
|
||||||
CCMIONextEntity
|
CCMIONextEntity
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
fieldNode,
|
fieldNode,
|
||||||
kCCMIOFieldData,
|
kCCMIOFieldData,
|
||||||
&dataI,
|
&dataI,
|
||||||
@ -149,20 +149,20 @@ void Foam::ccm::reader::determineFieldInfo
|
|||||||
|
|
||||||
&& CCMIOEntitySize
|
&& CCMIOEntitySize
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
dataNode,
|
dataNode,
|
||||||
NULL,
|
nullptr,
|
||||||
&maxId
|
&maxId
|
||||||
)
|
)
|
||||||
== kCCMIONoErr
|
== kCCMIONoErr
|
||||||
|
|
||||||
&& CCMIOReadFieldDatad
|
&& CCMIOReadFieldDatad
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
dataNode,
|
dataNode,
|
||||||
NULL,
|
nullptr,
|
||||||
&dataLocation,
|
&dataLocation,
|
||||||
NULL,
|
nullptr,
|
||||||
kCCMIOStart,
|
kCCMIOStart,
|
||||||
kCCMIOEnd
|
kCCMIOEnd
|
||||||
)
|
)
|
||||||
@ -212,7 +212,7 @@ bool Foam::ccm::reader::detectSolution()
|
|||||||
(
|
(
|
||||||
CCMIONextEntity
|
CCMIONextEntity
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
(globalState_->root),
|
(globalState_->root),
|
||||||
kCCMIOState,
|
kCCMIOState,
|
||||||
&stateI,
|
&stateI,
|
||||||
@ -230,7 +230,7 @@ bool Foam::ccm::reader::detectSolution()
|
|||||||
(
|
(
|
||||||
CCMIONextEntity
|
CCMIONextEntity
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
stateNode,
|
stateNode,
|
||||||
kCCMIOProcessor,
|
kCCMIOProcessor,
|
||||||
&procI,
|
&procI,
|
||||||
@ -240,11 +240,11 @@ bool Foam::ccm::reader::detectSolution()
|
|||||||
|
|
||||||
&& CCMIOReadProcessor
|
&& CCMIOReadProcessor
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
processorNode,
|
processorNode,
|
||||||
NULL, // Ignore verticesNode
|
nullptr, // Ignore verticesNode
|
||||||
NULL, // Ignore topologyNode
|
nullptr, // Ignore topologyNode
|
||||||
NULL, // Ignore initialField
|
nullptr, // Ignore initialField
|
||||||
&solutionNode
|
&solutionNode
|
||||||
)
|
)
|
||||||
== kCCMIONoErr
|
== kCCMIONoErr
|
||||||
@ -263,7 +263,7 @@ bool Foam::ccm::reader::detectSolution()
|
|||||||
(
|
(
|
||||||
CCMIONextEntity
|
CCMIONextEntity
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
solutionNode,
|
solutionNode,
|
||||||
kCCMIORestart,
|
kCCMIORestart,
|
||||||
&restartI,
|
&restartI,
|
||||||
@ -273,7 +273,7 @@ bool Foam::ccm::reader::detectSolution()
|
|||||||
|
|
||||||
&& CCMIOEntityName
|
&& CCMIOEntityName
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
stateNode,
|
stateNode,
|
||||||
solutionName
|
solutionName
|
||||||
)
|
)
|
||||||
@ -281,13 +281,13 @@ bool Foam::ccm::reader::detectSolution()
|
|||||||
|
|
||||||
&& CCMIOReadRestartInfo
|
&& CCMIOReadRestartInfo
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
restartNode,
|
restartNode,
|
||||||
NULL, // Ignore solverName
|
nullptr, // Ignore solverName
|
||||||
&iteration,
|
&iteration,
|
||||||
&timeValue,
|
&timeValue,
|
||||||
NULL, // Ignore timeUnits
|
nullptr, // Ignore timeUnits
|
||||||
NULL // Ignore startAngle
|
nullptr // Ignore startAngle
|
||||||
)
|
)
|
||||||
== kCCMIONoErr
|
== kCCMIONoErr
|
||||||
)
|
)
|
||||||
@ -310,7 +310,7 @@ bool Foam::ccm::reader::detectSolution()
|
|||||||
(
|
(
|
||||||
CCMIONextEntity
|
CCMIONextEntity
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
processorNode,
|
processorNode,
|
||||||
kCCMIOLagrangianData,
|
kCCMIOLagrangianData,
|
||||||
&lagrangianI,
|
&lagrangianI,
|
||||||
@ -320,9 +320,9 @@ bool Foam::ccm::reader::detectSolution()
|
|||||||
|
|
||||||
&& CCMIOReadLagrangianData
|
&& CCMIOReadLagrangianData
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
lagrangianNode,
|
lagrangianNode,
|
||||||
NULL,
|
nullptr,
|
||||||
&lagrangianSolutions
|
&lagrangianSolutions
|
||||||
)
|
)
|
||||||
== kCCMIONoErr
|
== kCCMIONoErr
|
||||||
@ -366,10 +366,10 @@ Foam::ccm::reader::readField
|
|||||||
(
|
(
|
||||||
CCMIOGetState
|
CCMIOGetState
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
(globalState_->root),
|
(globalState_->root),
|
||||||
solutionName.c_str(),
|
solutionName.c_str(),
|
||||||
NULL,
|
nullptr,
|
||||||
&stateNode
|
&stateNode
|
||||||
)
|
)
|
||||||
!= kCCMIONoErr
|
!= kCCMIONoErr
|
||||||
@ -420,7 +420,7 @@ Foam::ccm::reader::readField
|
|||||||
(
|
(
|
||||||
CCMIONextEntity
|
CCMIONextEntity
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
stateNode,
|
stateNode,
|
||||||
kCCMIOProcessor,
|
kCCMIOProcessor,
|
||||||
&procI,
|
&procI,
|
||||||
@ -430,11 +430,11 @@ Foam::ccm::reader::readField
|
|||||||
|
|
||||||
&& CCMIOReadProcessor
|
&& CCMIOReadProcessor
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
processorNode,
|
processorNode,
|
||||||
NULL, // Ignore verticesNode
|
nullptr, // Ignore verticesNode
|
||||||
NULL, // Ignore topologyNode
|
nullptr, // Ignore topologyNode
|
||||||
NULL, // Ignore initialField
|
nullptr, // Ignore initialField
|
||||||
&solutionNode
|
&solutionNode
|
||||||
)
|
)
|
||||||
== kCCMIONoErr
|
== kCCMIONoErr
|
||||||
@ -448,7 +448,7 @@ Foam::ccm::reader::readField
|
|||||||
(
|
(
|
||||||
CCMIONextEntity
|
CCMIONextEntity
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
solutionNode,
|
solutionNode,
|
||||||
kCCMIOFieldPhase,
|
kCCMIOFieldPhase,
|
||||||
&phaseI,
|
&phaseI,
|
||||||
@ -465,7 +465,7 @@ Foam::ccm::reader::readField
|
|||||||
(
|
(
|
||||||
CCMIONextEntity
|
CCMIONextEntity
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
phaseNode,
|
phaseNode,
|
||||||
kCCMIOField,
|
kCCMIOField,
|
||||||
&fieldI,
|
&fieldI,
|
||||||
@ -480,10 +480,10 @@ Foam::ccm::reader::readField
|
|||||||
(
|
(
|
||||||
&(globalState_->error),
|
&(globalState_->error),
|
||||||
fieldNode,
|
fieldNode,
|
||||||
NULL,
|
nullptr,
|
||||||
shortName,
|
shortName,
|
||||||
&dims,
|
&dims,
|
||||||
NULL
|
nullptr
|
||||||
);
|
);
|
||||||
assertNoError
|
assertNoError
|
||||||
(
|
(
|
||||||
@ -501,7 +501,7 @@ Foam::ccm::reader::readField
|
|||||||
(
|
(
|
||||||
CCMIONextEntity
|
CCMIONextEntity
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
fieldNode,
|
fieldNode,
|
||||||
kCCMIOFieldData,
|
kCCMIOFieldData,
|
||||||
&dataI,
|
&dataI,
|
||||||
@ -518,20 +518,20 @@ Foam::ccm::reader::readField
|
|||||||
(
|
(
|
||||||
CCMIOEntitySize
|
CCMIOEntitySize
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
dataNode,
|
dataNode,
|
||||||
&n,
|
&n,
|
||||||
NULL
|
nullptr
|
||||||
)
|
)
|
||||||
== kCCMIONoErr
|
== kCCMIONoErr
|
||||||
|
|
||||||
&& CCMIOReadFieldDatad
|
&& CCMIOReadFieldDatad
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
dataNode,
|
dataNode,
|
||||||
&mapId,
|
&mapId,
|
||||||
&dataLocation,
|
&dataLocation,
|
||||||
NULL,
|
nullptr,
|
||||||
kCCMIOStart,
|
kCCMIOStart,
|
||||||
kCCMIOEnd
|
kCCMIOEnd
|
||||||
)
|
)
|
||||||
@ -549,10 +549,10 @@ Foam::ccm::reader::readField
|
|||||||
(
|
(
|
||||||
CCMIOEntityDescription
|
CCMIOEntityDescription
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
dataNode,
|
dataNode,
|
||||||
&len,
|
&len,
|
||||||
NULL
|
nullptr
|
||||||
)
|
)
|
||||||
== kCCMIONoErr
|
== kCCMIONoErr
|
||||||
)
|
)
|
||||||
@ -563,7 +563,7 @@ Foam::ccm::reader::readField
|
|||||||
(
|
(
|
||||||
CCMIOEntityDescription
|
CCMIOEntityDescription
|
||||||
(
|
(
|
||||||
NULL,
|
nullptr,
|
||||||
dataNode,
|
dataNode,
|
||||||
&len,
|
&len,
|
||||||
dataLabel
|
dataLabel
|
||||||
@ -577,7 +577,7 @@ Foam::ccm::reader::readField
|
|||||||
strstr(fieldName.c_str(), "SIG")
|
strstr(fieldName.c_str(), "SIG")
|
||||||
|| strstr(fieldName.c_str(), "EPS")
|
|| strstr(fieldName.c_str(), "EPS")
|
||||||
)
|
)
|
||||||
&& strstr(dataLabel, "So") == NULL
|
&& strstr(dataLabel, "So") == nullptr
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
okayCombination = false;
|
okayCombination = false;
|
||||||
@ -607,8 +607,8 @@ Foam::ccm::reader::readField
|
|||||||
(
|
(
|
||||||
&(globalState_->error),
|
&(globalState_->error),
|
||||||
dataNode,
|
dataNode,
|
||||||
NULL,
|
nullptr,
|
||||||
NULL,
|
nullptr,
|
||||||
rawData.begin(),
|
rawData.begin(),
|
||||||
kCCMIOStart,
|
kCCMIOStart,
|
||||||
kCCMIOEnd
|
kCCMIOEnd
|
||||||
|
|||||||
@ -40,6 +40,8 @@ SourceFiles
|
|||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
#include "runTimeSelectionTables.H"
|
#include "runTimeSelectionTables.H"
|
||||||
|
|
||||||
|
#define MOVING_MESH
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
|
|||||||
@ -1232,9 +1232,9 @@ Foam::dynamicRefineFvMesh::~dynamicRefineFvMesh()
|
|||||||
|
|
||||||
bool Foam::dynamicRefineFvMesh::update()
|
bool Foam::dynamicRefineFvMesh::update()
|
||||||
{
|
{
|
||||||
// Re-read dictionary. Choosen since usually -small so trivial amount
|
// Re-read dictionary. Usually small so takes trivial amount of time
|
||||||
// of time compared to actual refinement. Also very useful to be able
|
// compared to actual refinement. Also very useful to be able to modify
|
||||||
// to modify on-the-fly.
|
// on-the-fly.
|
||||||
dictionary refineDict
|
dictionary refineDict
|
||||||
(
|
(
|
||||||
IOdictionary
|
IOdictionary
|
||||||
|
|||||||
@ -40,6 +40,8 @@ SourceFiles
|
|||||||
#include "autoPtr.H"
|
#include "autoPtr.H"
|
||||||
#include "runTimeSelectionTables.H"
|
#include "runTimeSelectionTables.H"
|
||||||
|
|
||||||
|
#define MOVING_MESH
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
namespace Foam
|
namespace Foam
|
||||||
|
|||||||
@ -34,7 +34,6 @@ Description
|
|||||||
|
|
||||||
#include "point.H"
|
#include "point.H"
|
||||||
#include "floatVector.H"
|
#include "floatVector.H"
|
||||||
#include "Istream.H"
|
|
||||||
|
|
||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
@ -58,36 +57,30 @@ public:
|
|||||||
inline STLpoint()
|
inline STLpoint()
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct from base class
|
//- Construct from single-precision point
|
||||||
inline STLpoint(const floatVector& v)
|
inline STLpoint(const Vector<float>& p)
|
||||||
:
|
:
|
||||||
floatVector(v)
|
floatVector(p)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from double-precision point
|
||||||
|
inline STLpoint(const Vector<double>& p)
|
||||||
|
:
|
||||||
|
floatVector(float(p.x()), float(p.y()), float(p.z()))
|
||||||
|
{}
|
||||||
|
|
||||||
|
//- Construct from single-precision components
|
||||||
inline STLpoint(float x, float y, float z)
|
inline STLpoint(float x, float y, float z)
|
||||||
:
|
:
|
||||||
floatVector(x, y, z)
|
floatVector(x, y, z)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct from components
|
//- Construct from double-precision components
|
||||||
inline STLpoint(double x, double y, double z)
|
inline STLpoint(double x, double y, double z)
|
||||||
:
|
:
|
||||||
floatVector(float(x), float(y), float(z))
|
floatVector(float(x), float(y), float(z))
|
||||||
{}
|
{}
|
||||||
|
|
||||||
//- Construct from point
|
|
||||||
inline STLpoint(const point& pt)
|
|
||||||
:
|
|
||||||
floatVector(float(pt.x()), float(pt.y()), float(pt.z()))
|
|
||||||
{}
|
|
||||||
|
|
||||||
//- Construct from istream
|
|
||||||
inline STLpoint(Istream& is)
|
|
||||||
:
|
|
||||||
floatVector(is)
|
|
||||||
{}
|
|
||||||
|
|
||||||
|
|
||||||
// Member Operators
|
// Member Operators
|
||||||
|
|
||||||
|
|||||||
@ -1,18 +1,39 @@
|
|||||||
Info<< "Creating field dpdt\n" << endl;
|
#if defined(MOVING_MESH)
|
||||||
volScalarField dpdt
|
Info<< "Creating field dpdt for moving meshes\n" << endl;
|
||||||
(
|
|
||||||
IOobject
|
// Note: set to read if present and auto write to simplify dpdt correction
|
||||||
|
// by meshPhi
|
||||||
|
volScalarField dpdt
|
||||||
(
|
(
|
||||||
"dpdt",
|
IOobject
|
||||||
runTime.timeName(),
|
(
|
||||||
mesh,
|
"dpdt",
|
||||||
IOobject::NO_READ,
|
runTime.timeName(),
|
||||||
IOobject::NO_WRITE
|
mesh,
|
||||||
),
|
IOobject::READ_IF_PRESENT,
|
||||||
fvc::ddt(p)
|
IOobject::AUTO_WRITE
|
||||||
);
|
),
|
||||||
|
fvc::ddt(p)
|
||||||
|
);
|
||||||
|
#else
|
||||||
|
Info<< "Creating field dpdt\n" << endl;
|
||||||
|
|
||||||
|
volScalarField dpdt
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
"dpdt",
|
||||||
|
runTime.timeName(),
|
||||||
|
mesh,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
fvc::ddt(p)
|
||||||
|
);
|
||||||
|
#endif
|
||||||
|
|
||||||
if (!thermo.dpdt())
|
if (!thermo.dpdt())
|
||||||
{
|
{
|
||||||
dpdt == dimensionedScalar("0", dpdt.dimensions(), 0);
|
dpdt == dimensionedScalar("0", dpdt.dimensions(), 0);
|
||||||
|
dpdt.writeOpt() = IOobject::NO_WRITE;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -46,6 +46,7 @@ void Foam::solutionControl::read(const bool absTolOnly)
|
|||||||
solutionDict.lookupOrDefault("momentumPredictor", true);
|
solutionDict.lookupOrDefault("momentumPredictor", true);
|
||||||
transonic_ = solutionDict.lookupOrDefault("transonic", false);
|
transonic_ = solutionDict.lookupOrDefault("transonic", false);
|
||||||
consistent_ = solutionDict.lookupOrDefault("consistent", false);
|
consistent_ = solutionDict.lookupOrDefault("consistent", false);
|
||||||
|
frozenFlow_ = solutionDict.lookupOrDefault("frozenFlow", false);
|
||||||
|
|
||||||
// Read residual information
|
// Read residual information
|
||||||
const dictionary residualDict
|
const dictionary residualDict
|
||||||
@ -228,6 +229,7 @@ Foam::solutionControl::solutionControl(fvMesh& mesh, const word& algorithmName)
|
|||||||
momentumPredictor_(true),
|
momentumPredictor_(true),
|
||||||
transonic_(false),
|
transonic_(false),
|
||||||
consistent_(false),
|
consistent_(false),
|
||||||
|
frozenFlow_(false),
|
||||||
corr_(0),
|
corr_(0),
|
||||||
corrNonOrtho_(0)
|
corrNonOrtho_(0)
|
||||||
{}
|
{}
|
||||||
|
|||||||
@ -87,6 +87,10 @@ protected:
|
|||||||
// "consistent" approach of SIMPLEC
|
// "consistent" approach of SIMPLEC
|
||||||
bool consistent_;
|
bool consistent_;
|
||||||
|
|
||||||
|
//- Flag to indicate that the flow system of equations should not
|
||||||
|
// be evolved
|
||||||
|
bool frozenFlow_;
|
||||||
|
|
||||||
|
|
||||||
// Evolution
|
// Evolution
|
||||||
|
|
||||||
@ -199,6 +203,10 @@ public:
|
|||||||
// "consistent" approach of SIMPLEC
|
// "consistent" approach of SIMPLEC
|
||||||
inline bool consistent() const;
|
inline bool consistent() const;
|
||||||
|
|
||||||
|
//- Flag to indicate that the flow system of equations should not
|
||||||
|
// be evolved
|
||||||
|
inline bool frozenFlow() const;
|
||||||
|
|
||||||
|
|
||||||
// Evolution
|
// Evolution
|
||||||
|
|
||||||
|
|||||||
@ -73,6 +73,12 @@ inline bool Foam::solutionControl::consistent() const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
inline bool Foam::solutionControl::frozenFlow() const
|
||||||
|
{
|
||||||
|
return frozenFlow_;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
inline bool Foam::solutionControl::correctNonOrthogonal()
|
inline bool Foam::solutionControl::correctNonOrthogonal()
|
||||||
{
|
{
|
||||||
corrNonOrtho_++;
|
corrNonOrtho_++;
|
||||||
|
|||||||
@ -36,6 +36,7 @@ Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
transformFvPatchField<Type>(p, iF),
|
transformFvPatchField<Type>(p, iF),
|
||||||
|
refValue_(p.size()),
|
||||||
valueFraction_(p.size(), 1.0)
|
valueFraction_(p.size(), 1.0)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -50,6 +51,7 @@ Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
transformFvPatchField<Type>(ptf, p, iF, mapper),
|
transformFvPatchField<Type>(ptf, p, iF, mapper),
|
||||||
|
refValue_(ptf.refValue_, mapper),
|
||||||
valueFraction_(ptf.valueFraction_, mapper)
|
valueFraction_(ptf.valueFraction_, mapper)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -63,9 +65,17 @@ Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
transformFvPatchField<Type>(p, iF),
|
transformFvPatchField<Type>(p, iF),
|
||||||
|
refValue_(p.size(), pTraits<Type>::zero),
|
||||||
valueFraction_("valueFraction", dict, p.size())
|
valueFraction_("valueFraction", dict, p.size())
|
||||||
{
|
{
|
||||||
this->patchType() = dict.lookupOrDefault<word>("patchType", word::null);
|
this->patchType() = dict.lookupOrDefault<word>("patchType", word::null);
|
||||||
|
|
||||||
|
// Backwards compatibility - leave refValue as zero unless specified
|
||||||
|
if (dict.found("refValue"))
|
||||||
|
{
|
||||||
|
refValue_ = Field<Type>("refValue", dict, p.size());
|
||||||
|
}
|
||||||
|
|
||||||
evaluate();
|
evaluate();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -77,6 +87,7 @@ Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
transformFvPatchField<Type>(ptf),
|
transformFvPatchField<Type>(ptf),
|
||||||
|
refValue_(ptf.refValue_),
|
||||||
valueFraction_(ptf.valueFraction_)
|
valueFraction_(ptf.valueFraction_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -89,6 +100,7 @@ Foam::partialSlipFvPatchField<Type>::partialSlipFvPatchField
|
|||||||
)
|
)
|
||||||
:
|
:
|
||||||
transformFvPatchField<Type>(ptf, iF),
|
transformFvPatchField<Type>(ptf, iF),
|
||||||
|
refValue_(ptf.refValue_),
|
||||||
valueFraction_(ptf.valueFraction_)
|
valueFraction_(ptf.valueFraction_)
|
||||||
{}
|
{}
|
||||||
|
|
||||||
@ -102,6 +114,7 @@ void Foam::partialSlipFvPatchField<Type>::autoMap
|
|||||||
)
|
)
|
||||||
{
|
{
|
||||||
transformFvPatchField<Type>::autoMap(m);
|
transformFvPatchField<Type>::autoMap(m);
|
||||||
|
refValue_.autoMap(m);
|
||||||
valueFraction_.autoMap(m);
|
valueFraction_.autoMap(m);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -118,6 +131,7 @@ void Foam::partialSlipFvPatchField<Type>::rmap
|
|||||||
const partialSlipFvPatchField<Type>& dmptf =
|
const partialSlipFvPatchField<Type>& dmptf =
|
||||||
refCast<const partialSlipFvPatchField<Type>>(ptf);
|
refCast<const partialSlipFvPatchField<Type>>(ptf);
|
||||||
|
|
||||||
|
refValue_.rmap(dmptf.refValue_, addr);
|
||||||
valueFraction_.rmap(dmptf.valueFraction_, addr);
|
valueFraction_.rmap(dmptf.valueFraction_, addr);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -131,7 +145,8 @@ Foam::partialSlipFvPatchField<Type>::snGrad() const
|
|||||||
|
|
||||||
return
|
return
|
||||||
(
|
(
|
||||||
(1.0 - valueFraction_)*transform(I - sqr(nHat), pif) - pif
|
valueFraction_*refValue_
|
||||||
|
+ (1.0 - valueFraction_)*transform(I - sqr(nHat), pif) - pif
|
||||||
)*this->patch().deltaCoeffs();
|
)*this->patch().deltaCoeffs();
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -151,6 +166,8 @@ void Foam::partialSlipFvPatchField<Type>::evaluate
|
|||||||
|
|
||||||
Field<Type>::operator=
|
Field<Type>::operator=
|
||||||
(
|
(
|
||||||
|
valueFraction_*refValue_
|
||||||
|
+
|
||||||
(1.0 - valueFraction_)
|
(1.0 - valueFraction_)
|
||||||
*transform(I - sqr(nHat), this->patchInternalField())
|
*transform(I - sqr(nHat), this->patchInternalField())
|
||||||
);
|
);
|
||||||
@ -181,6 +198,7 @@ template<class Type>
|
|||||||
void Foam::partialSlipFvPatchField<Type>::write(Ostream& os) const
|
void Foam::partialSlipFvPatchField<Type>::write(Ostream& os) const
|
||||||
{
|
{
|
||||||
transformFvPatchField<Type>::write(os);
|
transformFvPatchField<Type>::write(os);
|
||||||
|
refValue_.writeEntry("refValue", os);
|
||||||
valueFraction_.writeEntry("valueFraction", os);
|
valueFraction_.writeEntry("valueFraction", os);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -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-2017 OpenFOAM Foundation
|
\\ / A nd | Copyright (C) 2011-2017 OpenFOAM Foundation
|
||||||
\\/ M anipulation |
|
\\/ M anipulation | Copyright (C) 2011-2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -34,7 +34,8 @@ Description
|
|||||||
Usage
|
Usage
|
||||||
\table
|
\table
|
||||||
Property | Description | Required | Default value
|
Property | Description | Required | Default value
|
||||||
valueFraction | fraction of value used for boundary [0-1] | yes |
|
refValue | Reference value at zero slip | no | 0
|
||||||
|
valueFraction | Fraction of refValue used for boundary [0-1] | yes |
|
||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
Example of the boundary condition specification:
|
Example of the boundary condition specification:
|
||||||
@ -42,6 +43,7 @@ Usage
|
|||||||
<patchName>
|
<patchName>
|
||||||
{
|
{
|
||||||
type partialSlip;
|
type partialSlip;
|
||||||
|
refValue uniform 0.001;
|
||||||
valueFraction uniform 0.1;
|
valueFraction uniform 0.1;
|
||||||
value uniform 0;
|
value uniform 0;
|
||||||
}
|
}
|
||||||
@ -76,6 +78,9 @@ class partialSlipFvPatchField
|
|||||||
{
|
{
|
||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
|
//- Reference value
|
||||||
|
Field<Type> refValue_;
|
||||||
|
|
||||||
//- Fraction (0-1) of value used for boundary condition
|
//- Fraction (0-1) of value used for boundary condition
|
||||||
scalarField valueFraction_;
|
scalarField valueFraction_;
|
||||||
|
|
||||||
@ -176,6 +181,16 @@ public:
|
|||||||
|
|
||||||
// Return defining fields
|
// Return defining fields
|
||||||
|
|
||||||
|
virtual Field<Type>& refValue()
|
||||||
|
{
|
||||||
|
return refValue_;
|
||||||
|
}
|
||||||
|
|
||||||
|
virtual const Field<Type>& refValue() const
|
||||||
|
{
|
||||||
|
return refValue_;
|
||||||
|
}
|
||||||
|
|
||||||
virtual scalarField& valueFraction()
|
virtual scalarField& valueFraction()
|
||||||
{
|
{
|
||||||
return valueFraction_;
|
return valueFraction_;
|
||||||
|
|||||||
@ -592,7 +592,7 @@ Foam::vector Foam::turbulentDFSEMInletFvPatchVectorField::uDashEddy
|
|||||||
|
|
||||||
void Foam::turbulentDFSEMInletFvPatchVectorField::calcOverlappingProcEddies
|
void Foam::turbulentDFSEMInletFvPatchVectorField::calcOverlappingProcEddies
|
||||||
(
|
(
|
||||||
List<List<eddy> >& overlappingEddies
|
List<List<eddy>>& overlappingEddies
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
int oldTag = UPstream::msgType();
|
int oldTag = UPstream::msgType();
|
||||||
@ -604,7 +604,7 @@ void Foam::turbulentDFSEMInletFvPatchVectorField::calcOverlappingProcEddies
|
|||||||
Pstream::scatterList(patchBBs);
|
Pstream::scatterList(patchBBs);
|
||||||
|
|
||||||
// Per processor indices into all segments to send
|
// Per processor indices into all segments to send
|
||||||
List<DynamicList<label> > dynSendMap(Pstream::nProcs());
|
List<DynamicList<label>> dynSendMap(Pstream::nProcs());
|
||||||
|
|
||||||
forAll(eddies_, i)
|
forAll(eddies_, i)
|
||||||
{
|
{
|
||||||
@ -1050,7 +1050,7 @@ void Foam::turbulentDFSEMInletFvPatchVectorField::updateCoeffs()
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Add contributions from overlapping eddies
|
// Add contributions from overlapping eddies
|
||||||
List<List<eddy> > overlappingEddies(Pstream::nProcs());
|
List<List<eddy>> overlappingEddies(Pstream::nProcs());
|
||||||
calcOverlappingProcEddies(overlappingEddies);
|
calcOverlappingProcEddies(overlappingEddies);
|
||||||
|
|
||||||
forAll(overlappingEddies, procI)
|
forAll(overlappingEddies, procI)
|
||||||
|
|||||||
@ -231,7 +231,7 @@ class turbulentDFSEMInletFvPatchVectorField
|
|||||||
//- Helper function to interpolate values from the boundary data or
|
//- Helper function to interpolate values from the boundary data or
|
||||||
// read from dictionary
|
// read from dictionary
|
||||||
template<class Type>
|
template<class Type>
|
||||||
tmp<Field<Type> > interpolateOrRead
|
tmp<Field<Type>> interpolateOrRead
|
||||||
(
|
(
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
const dictionary& dict,
|
const dictionary& dict,
|
||||||
@ -240,7 +240,7 @@ class turbulentDFSEMInletFvPatchVectorField
|
|||||||
|
|
||||||
//- Helper function to interpolate values from the boundary data
|
//- Helper function to interpolate values from the boundary data
|
||||||
template<class Type>
|
template<class Type>
|
||||||
tmp<Field<Type> > interpolateBoundaryData
|
tmp<Field<Type>> interpolateBoundaryData
|
||||||
(
|
(
|
||||||
const word& fieldName
|
const word& fieldName
|
||||||
) const;
|
) const;
|
||||||
@ -258,7 +258,7 @@ class turbulentDFSEMInletFvPatchVectorField
|
|||||||
// processor
|
// processor
|
||||||
void calcOverlappingProcEddies
|
void calcOverlappingProcEddies
|
||||||
(
|
(
|
||||||
List<List<eddy> >& overlappingEddies
|
List<List<eddy>>& overlappingEddies
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -30,7 +30,7 @@ License
|
|||||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::tmp<Foam::Field<Type> >
|
Foam::tmp<Foam::Field<Type>>
|
||||||
Foam::turbulentDFSEMInletFvPatchVectorField::interpolateOrRead
|
Foam::turbulentDFSEMInletFvPatchVectorField::interpolateOrRead
|
||||||
(
|
(
|
||||||
const word& fieldName,
|
const word& fieldName,
|
||||||
@ -40,7 +40,7 @@ Foam::turbulentDFSEMInletFvPatchVectorField::interpolateOrRead
|
|||||||
{
|
{
|
||||||
if (dict.found(fieldName))
|
if (dict.found(fieldName))
|
||||||
{
|
{
|
||||||
tmp<Field<Type> > tFld
|
tmp<Field<Type>> tFld
|
||||||
(
|
(
|
||||||
new Field<Type>
|
new Field<Type>
|
||||||
(
|
(
|
||||||
@ -62,7 +62,7 @@ Foam::turbulentDFSEMInletFvPatchVectorField::interpolateOrRead
|
|||||||
|
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::tmp<Foam::Field<Type> >
|
Foam::tmp<Foam::Field<Type>>
|
||||||
Foam::turbulentDFSEMInletFvPatchVectorField::interpolateBoundaryData
|
Foam::turbulentDFSEMInletFvPatchVectorField::interpolateBoundaryData
|
||||||
(
|
(
|
||||||
const word& fieldName
|
const word& fieldName
|
||||||
|
|||||||
@ -1024,7 +1024,7 @@ void Foam::isoAdvection::applyBruteForceBounding()
|
|||||||
bool clip = dict_.lookupOrDefault<bool>("clip", true);
|
bool clip = dict_.lookupOrDefault<bool>("clip", true);
|
||||||
if (clip)
|
if (clip)
|
||||||
{
|
{
|
||||||
alpha1_ = min(1.0, max(0.0, alpha1_));
|
alpha1_ = min(scalar(1.0), max(scalar(0.0), alpha1_));
|
||||||
alpha1Changed = true;
|
alpha1Changed = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
186
src/functionObjects/field/Curle/Curle.C
Normal file
186
src/functionObjects/field/Curle/Curle.C
Normal file
@ -0,0 +1,186 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
|
\\/ 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 "Curle.H"
|
||||||
|
#include "fvcDdt.H"
|
||||||
|
#include "mathematicalConstants.H"
|
||||||
|
#include "addToRunTimeSelectionTable.H"
|
||||||
|
|
||||||
|
using namespace Foam::constant;
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace functionObjects
|
||||||
|
{
|
||||||
|
defineTypeNameAndDebug(Curle, 0);
|
||||||
|
|
||||||
|
addToRunTimeSelectionTable
|
||||||
|
(
|
||||||
|
functionObject,
|
||||||
|
Curle,
|
||||||
|
dictionary
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * Protected Member Functions * * * * * * * * * * * //
|
||||||
|
|
||||||
|
bool Foam::functionObjects::Curle::calc()
|
||||||
|
{
|
||||||
|
if (foundObject<volScalarField>(fieldName_))
|
||||||
|
{
|
||||||
|
// Evaluate pressure force time derivative
|
||||||
|
|
||||||
|
const volScalarField& p = lookupObject<volScalarField>(fieldName_);
|
||||||
|
const volScalarField dpdt(scopedName("dpdt"), fvc::ddt(p));
|
||||||
|
const volScalarField::Boundary& dpdtBf = dpdt.boundaryField();
|
||||||
|
const surfaceVectorField::Boundary& SfBf = mesh_.Sf().boundaryField();
|
||||||
|
|
||||||
|
dimensionedVector dfdt
|
||||||
|
(
|
||||||
|
"0",
|
||||||
|
p.dimensions()*dimArea/dimTime,
|
||||||
|
vector::zero
|
||||||
|
);
|
||||||
|
|
||||||
|
for (auto patchi : patchSet_)
|
||||||
|
{
|
||||||
|
dfdt.value() += sum(dpdtBf[patchi]*SfBf[patchi]);
|
||||||
|
}
|
||||||
|
|
||||||
|
reduce(dfdt.value(), sumOp<vector>());
|
||||||
|
|
||||||
|
|
||||||
|
// Construct and store Curle acoustic pressure
|
||||||
|
|
||||||
|
const volVectorField& C = mesh_.C();
|
||||||
|
|
||||||
|
tmp<volScalarField> tpDash
|
||||||
|
(
|
||||||
|
new volScalarField
|
||||||
|
(
|
||||||
|
IOobject
|
||||||
|
(
|
||||||
|
resultName_,
|
||||||
|
mesh_.time().timeName(),
|
||||||
|
mesh_,
|
||||||
|
IOobject::NO_READ,
|
||||||
|
IOobject::NO_WRITE
|
||||||
|
),
|
||||||
|
mesh_,
|
||||||
|
dimensionedScalar("0", p.dimensions(), 0)
|
||||||
|
)
|
||||||
|
);
|
||||||
|
|
||||||
|
volScalarField& pDash = tpDash.ref();
|
||||||
|
const volVectorField d(scopedName("d"), C - x0_);
|
||||||
|
pDash = 4*mathematical::pi/c0_*(d/magSqr(d) & dfdt);
|
||||||
|
|
||||||
|
return store(resultName_, tpDash);
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::functionObjects::Curle::Curle
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const Time& runTime,
|
||||||
|
const dictionary& dict
|
||||||
|
)
|
||||||
|
:
|
||||||
|
fieldExpression(name, runTime, dict, "p"),
|
||||||
|
patchSet_(),
|
||||||
|
x0_("x0", dimLength, vector::zero),
|
||||||
|
c0_("c0", dimVelocity, 0)
|
||||||
|
{
|
||||||
|
read(dict);
|
||||||
|
|
||||||
|
setResultName(typeName, fieldName_);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
Foam::functionObjects::Curle::~Curle()
|
||||||
|
{}
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
bool Foam::functionObjects::Curle::read(const dictionary& dict)
|
||||||
|
{
|
||||||
|
if (fieldExpression::read(dict))
|
||||||
|
{
|
||||||
|
patchSet_ =
|
||||||
|
mesh_.boundaryMesh().patchSet(wordReList(dict.lookup("patches")));
|
||||||
|
|
||||||
|
if (patchSet_.empty())
|
||||||
|
{
|
||||||
|
WarningInFunction
|
||||||
|
<< "No patches defined"
|
||||||
|
<< endl;
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Read the reference speed of sound
|
||||||
|
dict.lookup("c0") >> c0_;
|
||||||
|
|
||||||
|
|
||||||
|
// Set the location of the effective point source to the area-average
|
||||||
|
// of the patch face centres
|
||||||
|
const volVectorField::Boundary& Cbf = mesh_.C().boundaryField();
|
||||||
|
const surfaceScalarField::Boundary& magSfBf =
|
||||||
|
mesh_.magSf().boundaryField();
|
||||||
|
|
||||||
|
x0_.value() = vector::zero;
|
||||||
|
scalar sumMagSf = 0;
|
||||||
|
for (auto patchi : patchSet_)
|
||||||
|
{
|
||||||
|
x0_.value() += sum(Cbf[patchi]*magSfBf[patchi]);
|
||||||
|
sumMagSf += sum(magSfBf[patchi]);
|
||||||
|
}
|
||||||
|
|
||||||
|
reduce(x0_.value(), sumOp<vector>());
|
||||||
|
reduce(sumMagSf, sumOp<scalar>());
|
||||||
|
|
||||||
|
x0_.value() /= sumMagSf + ROOTVSMALL;
|
||||||
|
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
173
src/functionObjects/field/Curle/Curle.H
Normal file
173
src/functionObjects/field/Curle/Curle.H
Normal file
@ -0,0 +1,173 @@
|
|||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
========= |
|
||||||
|
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||||
|
\\ / O peration |
|
||||||
|
\\ / A nd | Copyright (C) 2017 OpenCFD Ltd.
|
||||||
|
\\/ 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::functionObjects::Curle
|
||||||
|
|
||||||
|
Group
|
||||||
|
grpFieldFunctionObjects
|
||||||
|
|
||||||
|
Description
|
||||||
|
Calculates the acoustic pressure based on Curle's analogy.
|
||||||
|
|
||||||
|
Curle's analogy is implemented as:
|
||||||
|
|
||||||
|
\f[
|
||||||
|
p' = 4 \frac{\pi}{c_0}\frac{\vec d}{|\vec d|^2}\frac{d(F)}{d(t)}
|
||||||
|
\f]
|
||||||
|
|
||||||
|
|
||||||
|
where
|
||||||
|
\vartable
|
||||||
|
p' | Curle's acoustic pressure [Pa] or [Pa (m3/rho)]
|
||||||
|
c_0 | Reference speed of sound [m/s]
|
||||||
|
\vec d | Distance vector to observer locations [m]
|
||||||
|
F | Force [N] or [N (m3/rho)]
|
||||||
|
\endvartable
|
||||||
|
|
||||||
|
Note
|
||||||
|
Only the normal-pressure force is included in the force calculation
|
||||||
|
|
||||||
|
|
||||||
|
Usage
|
||||||
|
Example of function object specification:
|
||||||
|
\verbatim
|
||||||
|
Curle1
|
||||||
|
{
|
||||||
|
type Curle;
|
||||||
|
libs ("libfieldFunctionObjects.so");
|
||||||
|
...
|
||||||
|
patches (surface1 surface2);
|
||||||
|
c0 330;
|
||||||
|
}
|
||||||
|
\endverbatim
|
||||||
|
|
||||||
|
Where the entries comprise:
|
||||||
|
\table
|
||||||
|
Property | Description | Required | Default value
|
||||||
|
type | Type name: Curle | yes |
|
||||||
|
field | Pressure field name | no | p
|
||||||
|
result | Acoustic pressure field name | no | Curle
|
||||||
|
patches | Sound generation patch names | yes |
|
||||||
|
c0 | Reference speed of sound | yes |
|
||||||
|
\endtable
|
||||||
|
|
||||||
|
|
||||||
|
See also
|
||||||
|
- Foam::functionObjects::fieldExpression
|
||||||
|
- Foam::functionObjects::fvMeshFunctionObject
|
||||||
|
|
||||||
|
SourceFiles
|
||||||
|
Curle.C
|
||||||
|
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
#ifndef functionObjects_Curle_H
|
||||||
|
#define functionObjects_Curle_H
|
||||||
|
|
||||||
|
#include "fieldExpression.H"
|
||||||
|
#include "dimensionedScalar.H"
|
||||||
|
#include "dimensionedVector.H"
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
namespace Foam
|
||||||
|
{
|
||||||
|
namespace functionObjects
|
||||||
|
{
|
||||||
|
|
||||||
|
/*---------------------------------------------------------------------------*\
|
||||||
|
Class Curle Declaration
|
||||||
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
|
class Curle
|
||||||
|
:
|
||||||
|
public fieldExpression
|
||||||
|
{
|
||||||
|
// Private data
|
||||||
|
|
||||||
|
// Read from dictionary
|
||||||
|
|
||||||
|
//- Patches to integrate forces over
|
||||||
|
labelHashSet patchSet_;
|
||||||
|
|
||||||
|
//- Area-averaged centre of patch faces
|
||||||
|
dimensionedVector x0_;
|
||||||
|
|
||||||
|
//- Reference speed of souund
|
||||||
|
dimensionedScalar c0_;
|
||||||
|
|
||||||
|
|
||||||
|
// Private Member Functions
|
||||||
|
|
||||||
|
//- Disallow default bitwise copy construct
|
||||||
|
Curle(const Curle&) = delete;
|
||||||
|
|
||||||
|
//- Disallow default bitwise assignment
|
||||||
|
void operator=(const Curle&) = delete;
|
||||||
|
|
||||||
|
|
||||||
|
protected:
|
||||||
|
|
||||||
|
//- Calculate the acoustic pressure field and return true if successful
|
||||||
|
virtual bool calc();
|
||||||
|
|
||||||
|
|
||||||
|
public:
|
||||||
|
|
||||||
|
//- Runtime type information
|
||||||
|
TypeName("Curle");
|
||||||
|
|
||||||
|
|
||||||
|
// Constructors
|
||||||
|
|
||||||
|
//- Construct from Time and dictionary
|
||||||
|
Curle
|
||||||
|
(
|
||||||
|
const word& name,
|
||||||
|
const Time& runTime,
|
||||||
|
const dictionary& dict
|
||||||
|
);
|
||||||
|
|
||||||
|
|
||||||
|
//- Destructor
|
||||||
|
virtual ~Curle();
|
||||||
|
|
||||||
|
|
||||||
|
// Member Functions
|
||||||
|
|
||||||
|
//- Read the Curle data
|
||||||
|
virtual bool read(const dictionary&);
|
||||||
|
};
|
||||||
|
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
} // End namespace functionObjects
|
||||||
|
} // End namespace Foam
|
||||||
|
|
||||||
|
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||||
|
|
||||||
|
#endif
|
||||||
|
|
||||||
|
// ************************************************************************* //
|
||||||
@ -52,6 +52,7 @@ PecletNo/PecletNo.C
|
|||||||
blendingFactor/blendingFactor.C
|
blendingFactor/blendingFactor.C
|
||||||
pressure/pressure.C
|
pressure/pressure.C
|
||||||
MachNo/MachNo.C
|
MachNo/MachNo.C
|
||||||
|
Curle/Curle.C
|
||||||
|
|
||||||
fieldsExpression/fieldsExpression.C
|
fieldsExpression/fieldsExpression.C
|
||||||
add/add.C
|
add/add.C
|
||||||
|
|||||||
@ -92,14 +92,14 @@ Usage
|
|||||||
Where the entries comprise:
|
Where the entries comprise:
|
||||||
\table
|
\table
|
||||||
Property | Description | Required | Default value
|
Property | Description | Required | Default value
|
||||||
type | type name: pressure | yes |
|
type | type name: pressure | yes |
|
||||||
field | Name of the pressure field | no | p
|
field | Name of the pressure field | no | p
|
||||||
U | Name of the velocity field | no | U
|
U | Name of the velocity field | no | U
|
||||||
rho | Name of the density field | no | rho
|
rho | Name of the density field | no | rho
|
||||||
result | Name of the resulting field | no | derived from p
|
result | Name of the resulting field | no | derived from p
|
||||||
calcTotal | Calculate total coefficient | yes |
|
calcTotal | Calculate total coefficient | yes |
|
||||||
pRef | Reference pressure for total pressure | no | 0
|
pRef | Reference pressure for total pressure | no | 0
|
||||||
calcCoeff | Calculate pressure coefficient | yes |
|
calcCoeff | Calculate pressure coefficient | yes |
|
||||||
pInf | Freestream pressure for coefficient calculation | no |
|
pInf | Freestream pressure for coefficient calculation | no |
|
||||||
UInf | Freestream velocity for coefficient calculation | no |
|
UInf | Freestream velocity for coefficient calculation | no |
|
||||||
rhoInf | Freestream density for coefficient calculation | no |
|
rhoInf | Freestream density for coefficient calculation | no |
|
||||||
|
|||||||
@ -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 | Copyright (C) 2015-2016 OpenCFD Ltd.
|
\\/ M anipulation | Copyright (C) 2015-2017 OpenCFD Ltd.
|
||||||
-------------------------------------------------------------------------------
|
-------------------------------------------------------------------------------
|
||||||
License
|
License
|
||||||
This file is part of OpenFOAM.
|
This file is part of OpenFOAM.
|
||||||
@ -114,7 +114,10 @@ bool Foam::functionObjects::valueAverage::read(const dictionary& dict)
|
|||||||
|
|
||||||
dict.lookup("functionObject") >> functionObjectName_;
|
dict.lookup("functionObject") >> functionObjectName_;
|
||||||
dict.lookup("fields") >> fieldNames_;
|
dict.lookup("fields") >> fieldNames_;
|
||||||
window_ = dict.lookupOrDefault<scalar>("window", -1);
|
if (dict.readIfPresent("window", window_))
|
||||||
|
{
|
||||||
|
window_ = obr().time().userTimeToTime(window_);
|
||||||
|
}
|
||||||
|
|
||||||
totalTime_.setSize(fieldNames_.size());
|
totalTime_.setSize(fieldNames_.size());
|
||||||
forAll(totalTime_, i)
|
forAll(totalTime_, i)
|
||||||
|
|||||||
@ -72,6 +72,11 @@ Description
|
|||||||
patches and suppress writing the internalMesh.
|
patches and suppress writing the internalMesh.
|
||||||
Consecutive output numbering can be used in conjunction with \c overwrite.
|
Consecutive output numbering can be used in conjunction with \c overwrite.
|
||||||
|
|
||||||
|
See also
|
||||||
|
Foam::functionObjects::vtkWrite
|
||||||
|
Foam::functionObjects::fvMeshFunctionObject
|
||||||
|
Foam::functionObjects::timeControl
|
||||||
|
|
||||||
SourceFiles
|
SourceFiles
|
||||||
ensightWrite.C
|
ensightWrite.C
|
||||||
ensightWriteTemplates.C
|
ensightWriteTemplates.C
|
||||||
|
|||||||
@ -62,6 +62,7 @@ Usage
|
|||||||
\endtable
|
\endtable
|
||||||
|
|
||||||
See also
|
See also
|
||||||
|
Foam::functionObjects::ensightWrite
|
||||||
Foam::functionObjects::fvMeshFunctionObject
|
Foam::functionObjects::fvMeshFunctionObject
|
||||||
Foam::functionObjects::timeControl
|
Foam::functionObjects::timeControl
|
||||||
|
|
||||||
|
|||||||
@ -123,7 +123,7 @@ void Foam::pairPatchAgglomeration::setEdgeWeights
|
|||||||
const label nCoarseI = max(fineToCoarse) + 1;
|
const label nCoarseI = max(fineToCoarse) + 1;
|
||||||
labelListList coarseToFine(invertOneToMany(nCoarseI, fineToCoarse));
|
labelListList coarseToFine(invertOneToMany(nCoarseI, fineToCoarse));
|
||||||
|
|
||||||
HashSet<edge, Hash<edge> > fineFeaturedFaces(coarsePatch.nEdges()/10);
|
HashSet<edge, Hash<edge>> fineFeaturedFaces(coarsePatch.nEdges()/10);
|
||||||
|
|
||||||
// Map fine faces with featured edge into coarse faces
|
// Map fine faces with featured edge into coarse faces
|
||||||
forAllConstIter(EdgeMap<scalar>, facePairWeight_, iter)
|
forAllConstIter(EdgeMap<scalar>, facePairWeight_, iter)
|
||||||
|
|||||||
@ -180,9 +180,9 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
virtual autoPtr<InjectionModel<CloudType> > clone() const
|
virtual autoPtr<InjectionModel<CloudType>> clone() const
|
||||||
{
|
{
|
||||||
return autoPtr<InjectionModel<CloudType> >
|
return autoPtr<InjectionModel<CloudType>>
|
||||||
(
|
(
|
||||||
new InjectedParticleDistributionInjection<CloudType>(*this)
|
new InjectedParticleDistributionInjection<CloudType>(*this)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -145,9 +145,9 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
virtual autoPtr<InjectionModel<CloudType> > clone() const
|
virtual autoPtr<InjectionModel<CloudType>> clone() const
|
||||||
{
|
{
|
||||||
return autoPtr<InjectionModel<CloudType> >
|
return autoPtr<InjectionModel<CloudType>>
|
||||||
(
|
(
|
||||||
new InjectedParticleInjection<CloudType>(*this)
|
new InjectedParticleInjection<CloudType>(*this)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -82,7 +82,7 @@ label singleStepDOFs = 0;
|
|||||||
|
|
||||||
const vector& molV(mol().v());
|
const vector& molV(mol().v());
|
||||||
|
|
||||||
const vector& molOmega(inv(molMoI) & mol().pi());
|
const vector molOmega(inv(molMoI) & mol().pi());
|
||||||
|
|
||||||
vector molPiGlobal = mol().Q() & mol().pi();
|
vector molPiGlobal = mol().Q() & mol().pi();
|
||||||
|
|
||||||
|
|||||||
@ -274,7 +274,7 @@ public:
|
|||||||
return R_();
|
return R_();
|
||||||
}
|
}
|
||||||
|
|
||||||
//- Update and return the co-ordinate roation for a list of cells
|
//- Update and return the co-ordinate rotation for a list of cells
|
||||||
const coordinateRotation& R
|
const coordinateRotation& R
|
||||||
(
|
(
|
||||||
const polyMesh& mesh,
|
const polyMesh& mesh,
|
||||||
|
|||||||
@ -358,8 +358,8 @@ Foam::pointToPointPlanarInterpolation::pointToPointPlanarInterpolation
|
|||||||
const bool nearestOnly,
|
const bool nearestOnly,
|
||||||
const coordinateSystem& referenceCS,
|
const coordinateSystem& referenceCS,
|
||||||
const label sourceSize,
|
const label sourceSize,
|
||||||
const List<FixedList<label, 3> >& nearestVertex,
|
const List<FixedList<label, 3>>& nearestVertex,
|
||||||
const List<FixedList<scalar, 3> >& nearestVertexWeight
|
const List<FixedList<scalar, 3>>& nearestVertexWeight
|
||||||
)
|
)
|
||||||
:
|
:
|
||||||
perturb_(perturb),
|
perturb_(perturb),
|
||||||
|
|||||||
@ -123,8 +123,8 @@ public:
|
|||||||
const bool nearestOnly,
|
const bool nearestOnly,
|
||||||
const coordinateSystem& referenceCS,
|
const coordinateSystem& referenceCS,
|
||||||
const label sourceSize,
|
const label sourceSize,
|
||||||
const List<FixedList<label, 3> >& nearestVertex,
|
const List<FixedList<label, 3>>& nearestVertex,
|
||||||
const List<FixedList<scalar, 3> >& nearestVertexWeight
|
const List<FixedList<scalar, 3>>& nearestVertexWeight
|
||||||
);
|
);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
|
|||||||
@ -1047,7 +1047,7 @@ bool Foam::cellCellStencils::cellVolumeWeight::update()
|
|||||||
interpolationCells_.transfer(interpolationCells);
|
interpolationCells_.transfer(interpolationCells);
|
||||||
|
|
||||||
|
|
||||||
List<Map<label> > compactMap;
|
List<Map<label>> compactMap;
|
||||||
mapDistribute map(globalCells, cellStencil_, compactMap);
|
mapDistribute map(globalCells, cellStencil_, compactMap);
|
||||||
cellInterpolationMap_.transfer(map);
|
cellInterpolationMap_.transfer(map);
|
||||||
|
|
||||||
|
|||||||
@ -488,7 +488,7 @@ void Foam::cellCellStencils::inverseDistance::markDonors
|
|||||||
|
|
||||||
|
|
||||||
// Indices of tgtcells to send over to each processor
|
// Indices of tgtcells to send over to each processor
|
||||||
List<DynamicList<label> > tgtSendCells(Pstream::nProcs());
|
List<DynamicList<label>> tgtSendCells(Pstream::nProcs());
|
||||||
forAll(srcOverlapProcs, i)
|
forAll(srcOverlapProcs, i)
|
||||||
{
|
{
|
||||||
label procI = srcOverlapProcs[i];
|
label procI = srcOverlapProcs[i];
|
||||||
@ -1548,7 +1548,7 @@ void Foam::cellCellStencils::inverseDistance::createStencil
|
|||||||
}
|
}
|
||||||
|
|
||||||
// Re-do the mapDistribute
|
// Re-do the mapDistribute
|
||||||
List<Map<label> > compactMap;
|
List<Map<label>> compactMap;
|
||||||
mapDistribute map(globalCells, cellStencil_, compactMap);
|
mapDistribute map(globalCells, cellStencil_, compactMap);
|
||||||
cellInterpolationMap_.transfer(map);
|
cellInterpolationMap_.transfer(map);
|
||||||
}
|
}
|
||||||
@ -1902,7 +1902,7 @@ bool Foam::cellCellStencils::inverseDistance::update()
|
|||||||
}
|
}
|
||||||
interpolationCells_.transfer(interpolationCells);
|
interpolationCells_.transfer(interpolationCells);
|
||||||
|
|
||||||
List<Map<label> > compactMap;
|
List<Map<label>> compactMap;
|
||||||
mapDistribute map(globalCells, cellStencil_, compactMap);
|
mapDistribute map(globalCells, cellStencil_, compactMap);
|
||||||
cellInterpolationMap_.transfer(map);
|
cellInterpolationMap_.transfer(map);
|
||||||
|
|
||||||
|
|||||||
@ -317,7 +317,7 @@ void Foam::cellCellStencils::trackingInverseDistance::markDonors
|
|||||||
|
|
||||||
|
|
||||||
// Indices of tgtcells to send over to each processor
|
// Indices of tgtcells to send over to each processor
|
||||||
List<DynamicList<label> > tgtSendCells(Pstream::nProcs());
|
List<DynamicList<label>> tgtSendCells(Pstream::nProcs());
|
||||||
forAll(srcOverlapProcs, i)
|
forAll(srcOverlapProcs, i)
|
||||||
{
|
{
|
||||||
label procI = srcOverlapProcs[i];
|
label procI = srcOverlapProcs[i];
|
||||||
@ -768,7 +768,7 @@ bool Foam::cellCellStencils::trackingInverseDistance::update()
|
|||||||
}
|
}
|
||||||
interpolationCells_.transfer(interpolationCells);
|
interpolationCells_.transfer(interpolationCells);
|
||||||
|
|
||||||
List<Map<label> > compactMap;
|
List<Map<label>> compactMap;
|
||||||
mapDistribute map(globalCells, cellStencil_, compactMap);
|
mapDistribute map(globalCells, cellStencil_, compactMap);
|
||||||
cellInterpolationMap_.transfer(map);
|
cellInterpolationMap_.transfer(map);
|
||||||
|
|
||||||
|
|||||||
@ -80,16 +80,8 @@ Foam::oversetFvPatchField<Type>::oversetFvPatchField
|
|||||||
{
|
{
|
||||||
if (!isA<oversetFvPatch>(p))
|
if (!isA<oversetFvPatch>(p))
|
||||||
{
|
{
|
||||||
FatalIOErrorIn
|
FatalIOErrorInFunction(dict)
|
||||||
(
|
<< " patch type '" << p.type()
|
||||||
"oversetFvPatchField<Type>::oversetFvPatchField"
|
|
||||||
"("
|
|
||||||
"const fvPatch&, "
|
|
||||||
"const DimensionedField<Type, volMesh>&, "
|
|
||||||
"const dictionary&"
|
|
||||||
")",
|
|
||||||
dict
|
|
||||||
) << " patch type '" << p.type()
|
|
||||||
<< "' not constraint type '" << typeName << "'"
|
<< "' not constraint type '" << typeName << "'"
|
||||||
<< "\n for patch " << p.name()
|
<< "\n for patch " << p.name()
|
||||||
<< " of field " << this->internalField().name()
|
<< " of field " << this->internalField().name()
|
||||||
|
|||||||
@ -103,9 +103,9 @@ public:
|
|||||||
oversetFvPatchField(const oversetFvPatchField<Type>&);
|
oversetFvPatchField(const oversetFvPatchField<Type>&);
|
||||||
|
|
||||||
//- Construct and return a clone
|
//- Construct and return a clone
|
||||||
virtual tmp<fvPatchField<Type> > clone() const
|
virtual tmp<fvPatchField<Type>> clone() const
|
||||||
{
|
{
|
||||||
return tmp<fvPatchField<Type> >
|
return tmp<fvPatchField<Type>>
|
||||||
(
|
(
|
||||||
new oversetFvPatchField<Type>(*this)
|
new oversetFvPatchField<Type>(*this)
|
||||||
);
|
);
|
||||||
@ -119,12 +119,12 @@ public:
|
|||||||
);
|
);
|
||||||
|
|
||||||
//- Construct and return a clone setting internal field reference
|
//- Construct and return a clone setting internal field reference
|
||||||
virtual tmp<fvPatchField<Type> > clone
|
virtual tmp<fvPatchField<Type>> clone
|
||||||
(
|
(
|
||||||
const DimensionedField<Type, volMesh>& iF
|
const DimensionedField<Type, volMesh>& iF
|
||||||
) const
|
) const
|
||||||
{
|
{
|
||||||
return tmp<fvPatchField<Type> >
|
return tmp<fvPatchField<Type>>
|
||||||
(
|
(
|
||||||
new oversetFvPatchField<Type>(*this, iF)
|
new oversetFvPatchField<Type>(*this, iF)
|
||||||
);
|
);
|
||||||
|
|||||||
@ -108,19 +108,8 @@ void Foam::setRefCells
|
|||||||
|
|
||||||
if (refCells.size() != regionNeedReference.size())
|
if (refCells.size() != regionNeedReference.size())
|
||||||
{
|
{
|
||||||
FatalIOErrorIn
|
FatalIOErrorInFunction(dict)
|
||||||
(
|
<< "Number of refCells " << refCells.size()
|
||||||
"setRefCell\n"
|
|
||||||
"(\n"
|
|
||||||
" const volScalarField&,\n"
|
|
||||||
" const volScalarField&,\n"
|
|
||||||
" const dictionary&,\n"
|
|
||||||
" labelList&,\n"
|
|
||||||
" scalarField&,\n"
|
|
||||||
" const bool\n"
|
|
||||||
")\n",
|
|
||||||
dict
|
|
||||||
) << "Number of refCells " << refCells.size()
|
|
||||||
<< " does not correspond to number of regions "
|
<< " does not correspond to number of regions "
|
||||||
<< regionNeedReference.size()
|
<< regionNeedReference.size()
|
||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
@ -146,19 +135,8 @@ void Foam::setRefCells
|
|||||||
&& regionRefCells[regionI] == -1
|
&& regionRefCells[regionI] == -1
|
||||||
)
|
)
|
||||||
{
|
{
|
||||||
FatalIOErrorIn
|
FatalIOErrorInFunction(dict)
|
||||||
(
|
<< "Have no reference cell for region " << regionI
|
||||||
"setRefCell\n"
|
|
||||||
"(\n"
|
|
||||||
" const volScalarField&,\n"
|
|
||||||
" const volScalarField&,\n"
|
|
||||||
" const dictionary&,\n"
|
|
||||||
" labelList&,\n"
|
|
||||||
" scalarField&,\n"
|
|
||||||
" const bool\n"
|
|
||||||
")\n",
|
|
||||||
dict
|
|
||||||
) << "Have no reference cell for region " << regionI
|
|
||||||
<< nl
|
<< nl
|
||||||
<< "Overall per-region reference cells "
|
<< "Overall per-region reference cells "
|
||||||
<< regionRefCells
|
<< regionRefCells
|
||||||
@ -173,19 +151,8 @@ void Foam::setRefCells
|
|||||||
|
|
||||||
if (refPoints.size() != regionNeedReference.size())
|
if (refPoints.size() != regionNeedReference.size())
|
||||||
{
|
{
|
||||||
FatalIOErrorIn
|
FatalIOErrorInFunction(dict)
|
||||||
(
|
<< "Number of refPoints " << refPoints.size()
|
||||||
"setRefCell\n"
|
|
||||||
"(\n"
|
|
||||||
" const volScalarField&,\n"
|
|
||||||
" const volScalarField&,\n"
|
|
||||||
" const dictionary&,\n"
|
|
||||||
" labelList&,\n"
|
|
||||||
" scalarField&,\n"
|
|
||||||
" const bool\n"
|
|
||||||
")\n",
|
|
||||||
dict
|
|
||||||
) << "Number of refPoints " << refPoints.size()
|
|
||||||
<< " does not correspond to number of regions "
|
<< " does not correspond to number of regions "
|
||||||
<< regionNeedReference.size()
|
<< regionNeedReference.size()
|
||||||
<< exit(FatalIOError);
|
<< exit(FatalIOError);
|
||||||
@ -226,19 +193,8 @@ void Foam::setRefCells
|
|||||||
{
|
{
|
||||||
if (hasRef[regionI] != 1)
|
if (hasRef[regionI] != 1)
|
||||||
{
|
{
|
||||||
FatalIOErrorIn
|
FatalIOErrorInFunction(dict)
|
||||||
(
|
<< "Unable to set reference cell for field " << field.name()
|
||||||
"setRefCell\n"
|
|
||||||
"(\n"
|
|
||||||
" const volScalarField&,\n"
|
|
||||||
" const volScalarField&,\n"
|
|
||||||
" const dictionary&,\n"
|
|
||||||
" labelList&,\n"
|
|
||||||
" scalarField&,\n"
|
|
||||||
" const bool\n"
|
|
||||||
")\n",
|
|
||||||
dict
|
|
||||||
) << "Unable to set reference cell for field " << field.name()
|
|
||||||
<< nl
|
<< nl
|
||||||
<< " Reference points " << refPointName
|
<< " Reference points " << refPointName
|
||||||
<< " " << refPoints
|
<< " " << refPoints
|
||||||
@ -251,19 +207,8 @@ void Foam::setRefCells
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalIOErrorIn
|
FatalIOErrorInFunction(dict)
|
||||||
(
|
<< "Unable to set reference cell for field " << field.name()
|
||||||
"setRefCell\n"
|
|
||||||
"(\n"
|
|
||||||
" const volScalarField&,\n"
|
|
||||||
" const volScalarField&,\n"
|
|
||||||
" const dictionary&,\n"
|
|
||||||
" labelList&,\n"
|
|
||||||
" scalarField&,\n"
|
|
||||||
" const bool\n"
|
|
||||||
")\n",
|
|
||||||
dict
|
|
||||||
) << "Unable to set reference cell for field " << field.name()
|
|
||||||
<< nl
|
<< nl
|
||||||
<< " Please supply either " << refCellName
|
<< " Please supply either " << refCellName
|
||||||
<< " or " << refPointName << nl << exit(FatalIOError);
|
<< " or " << refPointName << nl << exit(FatalIOError);
|
||||||
|
|||||||
@ -118,7 +118,7 @@ public:
|
|||||||
|
|
||||||
//- Return the windowed data
|
//- Return the windowed data
|
||||||
template<class Type>
|
template<class Type>
|
||||||
tmp<Field<Type> > apply
|
tmp<Field<Type>> apply
|
||||||
(
|
(
|
||||||
const Field<Type>& fld,
|
const Field<Type>& fld,
|
||||||
const label windowI
|
const label windowI
|
||||||
|
|||||||
@ -42,10 +42,8 @@ Foam::autoPtr<Foam::windowModel> Foam::windowModel::New
|
|||||||
|
|
||||||
if (!cstrIter.found())
|
if (!cstrIter.found())
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorInFunction
|
||||||
(
|
<< "Unknown windowModel type "
|
||||||
"windowModel::New(const dictionary&, const label)"
|
|
||||||
) << "Unknown windowModel type "
|
|
||||||
<< modelType << nl << nl
|
<< modelType << nl << nl
|
||||||
<< "Valid windowModel types are:" << nl
|
<< "Valid windowModel types are:" << nl
|
||||||
<< dictionaryConstructorTablePtr_->sortedToc()
|
<< dictionaryConstructorTablePtr_->sortedToc()
|
||||||
|
|||||||
@ -24,7 +24,7 @@ License
|
|||||||
\*---------------------------------------------------------------------------*/
|
\*---------------------------------------------------------------------------*/
|
||||||
|
|
||||||
template<class Type>
|
template<class Type>
|
||||||
Foam::tmp<Foam::Field<Type> > Foam::windowModel::apply
|
Foam::tmp<Foam::Field<Type>> Foam::windowModel::apply
|
||||||
(
|
(
|
||||||
const Field<Type>& fld,
|
const Field<Type>& fld,
|
||||||
const label windowI
|
const label windowI
|
||||||
@ -44,7 +44,7 @@ Foam::tmp<Foam::Field<Type> > Foam::windowModel::apply
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
tmp<Field<Type> > tresult(new Field<Type>(nSamples, pTraits<Type>::zero));
|
tmp<Field<Type>> tresult(new Field<Type>(nSamples, pTraits<Type>::zero));
|
||||||
Field<Type>& result = tresult.ref();
|
Field<Type>& result = tresult.ref();
|
||||||
|
|
||||||
label nWindow = nWindowsTotal(fld.size());
|
label nWindow = nWindowsTotal(fld.size());
|
||||||
|
|||||||
@ -108,7 +108,7 @@ public:
|
|||||||
virtual wordList fieldNames(const label timeIndex) const = 0;
|
virtual wordList fieldNames(const label timeIndex) const = 0;
|
||||||
|
|
||||||
//- Return a scalar field at a given time
|
//- Return a scalar field at a given time
|
||||||
virtual tmp<Field<scalar> > field
|
virtual tmp<Field<scalar>> field
|
||||||
(
|
(
|
||||||
const label timeIndex,
|
const label timeIndex,
|
||||||
const label fieldIndex,
|
const label fieldIndex,
|
||||||
@ -116,7 +116,7 @@ public:
|
|||||||
) const = 0;
|
) const = 0;
|
||||||
|
|
||||||
//- Return a vector field at a given time
|
//- Return a vector field at a given time
|
||||||
virtual tmp<Field<vector> > field
|
virtual tmp<Field<vector>> field
|
||||||
(
|
(
|
||||||
const label timeIndex,
|
const label timeIndex,
|
||||||
const label fieldIndex,
|
const label fieldIndex,
|
||||||
@ -124,7 +124,7 @@ public:
|
|||||||
) const = 0;
|
) const = 0;
|
||||||
|
|
||||||
//- Return a sphericalTensor field at a given time
|
//- Return a sphericalTensor field at a given time
|
||||||
virtual tmp<Field<sphericalTensor> > field
|
virtual tmp<Field<sphericalTensor>> field
|
||||||
(
|
(
|
||||||
const label timeIndex,
|
const label timeIndex,
|
||||||
const label fieldIndex,
|
const label fieldIndex,
|
||||||
@ -132,7 +132,7 @@ public:
|
|||||||
) const = 0;
|
) const = 0;
|
||||||
|
|
||||||
//- Return a symmTensor field at a given time
|
//- Return a symmTensor field at a given time
|
||||||
virtual tmp<Field<symmTensor> > field
|
virtual tmp<Field<symmTensor>> field
|
||||||
(
|
(
|
||||||
const label timeIndex,
|
const label timeIndex,
|
||||||
const label fieldIndex,
|
const label fieldIndex,
|
||||||
@ -140,7 +140,7 @@ public:
|
|||||||
) const = 0;
|
) const = 0;
|
||||||
|
|
||||||
//- Return a tensor field at a given time
|
//- Return a tensor field at a given time
|
||||||
virtual tmp<Field<tensor> > field
|
virtual tmp<Field<tensor>> field
|
||||||
(
|
(
|
||||||
const label timeIndex,
|
const label timeIndex,
|
||||||
const label fieldIndex,
|
const label fieldIndex,
|
||||||
|
|||||||
@ -159,11 +159,7 @@ void Foam::fileFormats::FLMAsurfaceFormat<Face>::write
|
|||||||
{
|
{
|
||||||
if (!os.good())
|
if (!os.good())
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorInFunction
|
||||||
(
|
|
||||||
"fileFormats::FLMAsurfaceFormat::write"
|
|
||||||
"(OSstream&, const MeshedSurfaceProxy<Face>&)"
|
|
||||||
)
|
|
||||||
<< "bad output state "
|
<< "bad output state "
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
@ -352,11 +348,7 @@ void Foam::fileFormats::FLMAsurfaceFormat<Face>::write
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
FatalErrorIn
|
FatalErrorInFunction
|
||||||
(
|
|
||||||
"fileFormats::FLMAsurfaceFormat::write"
|
|
||||||
"(const fileName&, const MeshedSurfaceProxy<Face>&)"
|
|
||||||
)
|
|
||||||
<< "Cannot open file for writing " << filename
|
<< "Cannot open file for writing " << filename
|
||||||
<< exit(FatalError);
|
<< exit(FatalError);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -64,7 +64,7 @@ class boundaryRadiationProperties
|
|||||||
// Private data
|
// Private data
|
||||||
|
|
||||||
//- Ptr list of boundaryRadiationProperties
|
//- Ptr list of boundaryRadiationProperties
|
||||||
List<autoPtr<boundaryRadiationPropertiesPatch> >
|
List<autoPtr<boundaryRadiationPropertiesPatch>>
|
||||||
radBoundaryPropertiesPtrList_;
|
radBoundaryPropertiesPtrList_;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -153,7 +153,7 @@ public:
|
|||||||
) const = 0;
|
) const = 0;
|
||||||
|
|
||||||
//- Return net solid sensible enthalpy [J/Kg]
|
//- Return net solid sensible enthalpy [J/Kg]
|
||||||
virtual tmp<DimensionedField<scalar, volMesh> > RRsHs() const = 0;
|
virtual tmp<DimensionedField<scalar, volMesh>> RRsHs() const = 0;
|
||||||
|
|
||||||
//- Return specie Table for gases
|
//- Return specie Table for gases
|
||||||
virtual const speciesTable& gasTable() const = 0;
|
virtual const speciesTable& gasTable() const = 0;
|
||||||
|
|||||||
@ -188,7 +188,7 @@ public:
|
|||||||
inline tmp<volScalarField::Internal> RRs() const;
|
inline tmp<volScalarField::Internal> RRs() const;
|
||||||
|
|
||||||
//- Return net solid sensible enthalpy
|
//- Return net solid sensible enthalpy
|
||||||
inline tmp<DimensionedField<scalar, volMesh> > RRsHs() const;
|
inline tmp<DimensionedField<scalar, volMesh>> RRsHs() const;
|
||||||
|
|
||||||
//- Solve the reaction system for the given time step
|
//- Solve the reaction system for the given time step
|
||||||
// and return the characteristic time
|
// and return the characteristic time
|
||||||
|
|||||||
@ -97,10 +97,10 @@ Foam::solidChemistryModel<CompType, SolidThermo>::RRs() const
|
|||||||
|
|
||||||
|
|
||||||
template<class CompType, class SolidThermo>
|
template<class CompType, class SolidThermo>
|
||||||
inline Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh> >
|
inline Foam::tmp<Foam::DimensionedField<Foam::scalar, Foam::volMesh>>
|
||||||
Foam::solidChemistryModel<CompType, SolidThermo>::RRsHs() const
|
Foam::solidChemistryModel<CompType, SolidThermo>::RRsHs() const
|
||||||
{
|
{
|
||||||
tmp<DimensionedField<scalar, volMesh> > tRRsHs
|
tmp<DimensionedField<scalar, volMesh>> tRRsHs
|
||||||
(
|
(
|
||||||
new DimensionedField<scalar, volMesh>
|
new DimensionedField<scalar, volMesh>
|
||||||
(
|
(
|
||||||
|
|||||||
@ -259,14 +259,14 @@ public:
|
|||||||
//- Surface tension [N/m]
|
//- Surface tension [N/m]
|
||||||
virtual scalar sigma(scalar p, scalar T) const = 0;
|
virtual scalar sigma(scalar p, scalar T) const = 0;
|
||||||
|
|
||||||
//- Vapour diffussivity [m2/s]
|
//- Vapour diffusivity [m2/s]
|
||||||
virtual scalar D(scalar p, scalar T) const = 0;
|
virtual scalar D(scalar p, scalar T) const = 0;
|
||||||
|
|
||||||
//- Vapour diffussivity [m2/s] with specified binary pair
|
//- Vapour diffusivity [m2/s] with specified binary pair
|
||||||
virtual scalar D(scalar p, scalar T, scalar Wb) const = 0;
|
virtual scalar D(scalar p, scalar T, scalar Wb) const = 0;
|
||||||
|
|
||||||
//- Invert the vapour pressure relationship to retrieve the
|
//- Invert the vapour pressure relationship to retrieve the
|
||||||
// boiling temperuture as a function of pressure
|
// boiling temperature as a function of pressure
|
||||||
virtual scalar pvInvert(scalar p) const;
|
virtual scalar pvInvert(scalar p) const;
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@ -33,6 +33,7 @@ Foam::thermophysicalPropertiesSelector<ThermophysicalProperties>
|
|||||||
return propertiesPtr_();
|
return propertiesPtr_();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
template<class ThermophysicalProperties>
|
template<class ThermophysicalProperties>
|
||||||
inline Foam::scalar
|
inline Foam::scalar
|
||||||
Foam::thermophysicalPropertiesSelector<ThermophysicalProperties>::W() const
|
Foam::thermophysicalPropertiesSelector<ThermophysicalProperties>::W() const
|
||||||
|
|||||||
@ -72,7 +72,8 @@ Foam::scalar Foam::waveModels::Grimshaw::eta
|
|||||||
const scalar eps2 = eps*eps;
|
const scalar eps2 = eps*eps;
|
||||||
const scalar eps3 = eps*eps2;
|
const scalar eps3 = eps*eps2;
|
||||||
|
|
||||||
const scalar C = sqrt(mag(g_)*h)*sqrt(1.0 + eps - 0.05*eps2 - (3.0/70.0)*eps3);
|
const scalar C =
|
||||||
|
sqrt(mag(g_)*h)*sqrt(1.0 + eps - 0.05*eps2 - (3.0/70.0)*eps3);
|
||||||
|
|
||||||
const scalar ts = 3.5*h/sqrt(H/h);
|
const scalar ts = 3.5*h/sqrt(H/h);
|
||||||
const scalar xa = -C*t + ts - X0 + x*cos(theta) + y*sin(theta);
|
const scalar xa = -C*t + ts - X0 + x*cos(theta) + y*sin(theta);
|
||||||
@ -109,7 +110,8 @@ Foam::vector Foam::waveModels::Grimshaw::Uf
|
|||||||
const scalar eps2 = eps*eps;
|
const scalar eps2 = eps*eps;
|
||||||
const scalar eps3 = eps*eps2;
|
const scalar eps3 = eps*eps2;
|
||||||
|
|
||||||
const scalar C = sqrt(mag(g_)*h)*sqrt(1.0 + eps - 0.05*eps2 - (3.0/70.0)*eps3);
|
const scalar C =
|
||||||
|
sqrt(mag(g_)*h)*sqrt(1.0 + eps - 0.05*eps2 - (3.0/70.0)*eps3);
|
||||||
|
|
||||||
const scalar ts = 3.5*h/sqrt(eps);
|
const scalar ts = 3.5*h/sqrt(eps);
|
||||||
const scalar xa = -C*t + ts - X0 + x*cos(theta) + y*sin(theta);
|
const scalar xa = -C*t + ts - X0 + x*cos(theta) + y*sin(theta);
|
||||||
@ -228,19 +230,19 @@ void Foam::waveModels::Grimshaw::setVelocity
|
|||||||
|
|
||||||
if (fraction > 0)
|
if (fraction > 0)
|
||||||
{
|
{
|
||||||
const label paddlei = faceToPaddle_[facei];
|
const label paddlei = faceToPaddle_[facei];
|
||||||
|
|
||||||
const vector Uf = this->Uf
|
const vector Uf = this->Uf
|
||||||
(
|
(
|
||||||
waveHeight_,
|
waveHeight_,
|
||||||
waterDepthRef_,
|
waterDepthRef_,
|
||||||
xPaddle_[paddlei],
|
xPaddle_[paddlei],
|
||||||
yPaddle_[paddlei],
|
yPaddle_[paddlei],
|
||||||
waveAngle_,
|
waveAngle_,
|
||||||
t,
|
t,
|
||||||
x0_,
|
x0_,
|
||||||
z
|
z
|
||||||
);
|
);
|
||||||
|
|
||||||
U_[facei] = fraction*Uf*tCoeff;
|
U_[facei] = fraction*Uf*tCoeff;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -320,19 +320,19 @@ void Foam::waveModels::McCowan::setVelocity
|
|||||||
|
|
||||||
if (fraction > 0)
|
if (fraction > 0)
|
||||||
{
|
{
|
||||||
const label paddlei = faceToPaddle_[facei];
|
const label paddlei = faceToPaddle_[facei];
|
||||||
|
|
||||||
const vector Uf = this->Uf
|
const vector Uf = this->Uf
|
||||||
(
|
(
|
||||||
waveHeight_,
|
waveHeight_,
|
||||||
waterDepthRef_,
|
waterDepthRef_,
|
||||||
xPaddle_[paddlei],
|
xPaddle_[paddlei],
|
||||||
yPaddle_[paddlei],
|
yPaddle_[paddlei],
|
||||||
waveAngle_,
|
waveAngle_,
|
||||||
t,
|
t,
|
||||||
x0_,
|
x0_,
|
||||||
z
|
z
|
||||||
);
|
);
|
||||||
|
|
||||||
U_[facei] = fraction*Uf*tCoeff;
|
U_[facei] = fraction*Uf*tCoeff;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -74,14 +74,14 @@ protected:
|
|||||||
virtual scalar newtonRapsonF1
|
virtual scalar newtonRapsonF1
|
||||||
(
|
(
|
||||||
const scalar x0,
|
const scalar x0,
|
||||||
const scalar H,
|
const scalar H,
|
||||||
const scalar h
|
const scalar h
|
||||||
) const;
|
) const;
|
||||||
|
|
||||||
virtual scalar newtonRapsonF2
|
virtual scalar newtonRapsonF2
|
||||||
(
|
(
|
||||||
const scalar x0,
|
const scalar x0,
|
||||||
const scalar H,
|
const scalar H,
|
||||||
const scalar h,
|
const scalar h,
|
||||||
const scalar xa,
|
const scalar xa,
|
||||||
const scalar m,
|
const scalar m,
|
||||||
|
|||||||
@ -615,7 +615,11 @@ void Foam::waveModels::StokesV::initialise
|
|||||||
|
|
||||||
f1 = pi*H/d - 2*pi/(k*d)*(lambda + l3*b33 + l5*(b35 + b55));
|
f1 = pi*H/d - 2*pi/(k*d)*(lambda + l3*b33 + l5*(b35 + b55));
|
||||||
|
|
||||||
f2 = (2*pi*d)/(mag(g_)*sqr(T)) - k*d/(2*pi)*tanh(k*d)*(1 + l2*c1 + l4*c2);
|
f2 =
|
||||||
|
(
|
||||||
|
(2*pi*d)/(mag(g_)*sqr(T))
|
||||||
|
- k*d/(2*pi)*tanh(k*d)*(1 + l2*c1 + l4*c2)
|
||||||
|
);
|
||||||
|
|
||||||
const scalar lambdaPr =
|
const scalar lambdaPr =
|
||||||
(f1*Bmat21 - f2*Bmat11)/(Bmat11*Bmat22 - Bmat12*Bmat21);
|
(f1*Bmat21 - f2*Bmat11)/(Bmat11*Bmat22 - Bmat12*Bmat21);
|
||||||
|
|||||||
@ -32,7 +32,6 @@ fuel
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 16.0428;
|
molWeight 16.0428;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
@ -58,7 +57,6 @@ oxidant
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1; //9.52305854241338;
|
|
||||||
molWeight 28.8504;
|
molWeight 28.8504;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
@ -84,7 +82,6 @@ burntProducts
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1; //10.5230585424134;
|
|
||||||
molWeight 27.6333203887463;
|
molWeight 27.6333203887463;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
|
|||||||
@ -32,8 +32,6 @@ fuel
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
|
|
||||||
molWeight 16.0428;
|
molWeight 16.0428;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
@ -48,7 +46,6 @@ fuel
|
|||||||
lowCpCoeffs ( 7.78741500000000e-01 1.74766800000000e-02 -2.78340900000000e-05
|
lowCpCoeffs ( 7.78741500000000e-01 1.74766800000000e-02 -2.78340900000000e-05
|
||||||
3.04970800000000e-08 -1.22393100000000e-11 -9.82522900000000e+03
|
3.04970800000000e-08 -1.22393100000000e-11 -9.82522900000000e+03
|
||||||
1.37221900000000e+01);
|
1.37221900000000e+01);
|
||||||
|
|
||||||
}
|
}
|
||||||
transport
|
transport
|
||||||
{
|
{
|
||||||
@ -61,7 +58,6 @@ oxidant
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 28.8504;
|
molWeight 28.8504;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
@ -87,8 +83,6 @@ burntProducts
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
|
|
||||||
molWeight 27.6333203887;
|
molWeight 27.6333203887;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
|
|||||||
@ -30,7 +30,6 @@ mixture
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 100;
|
molWeight 100;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -19,7 +19,6 @@ O2
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 31.9988;
|
molWeight 31.9988;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
@ -41,7 +40,6 @@ H2O
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 18.0153;
|
molWeight 18.0153;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
@ -63,7 +61,6 @@ C3H8
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 44.01;
|
molWeight 44.01;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
@ -85,7 +82,6 @@ C7H16
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 100.204;
|
molWeight 100.204;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
@ -107,7 +103,6 @@ CO2
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 44.01;
|
molWeight 44.01;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
@ -129,7 +124,6 @@ N2
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 28.0134;
|
molWeight 28.0134;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
|
|||||||
@ -19,7 +19,6 @@ PMMA
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 100;
|
molWeight 100;
|
||||||
}
|
}
|
||||||
transport
|
transport
|
||||||
|
|||||||
@ -46,7 +46,6 @@ gas
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 18.0153;
|
molWeight 18.0153;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
|
|||||||
@ -19,7 +19,6 @@ O2
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 31.9988;
|
molWeight 31.9988;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
@ -41,7 +40,6 @@ H2O
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 18.0153;
|
molWeight 18.0153;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
@ -63,7 +61,6 @@ CH4
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 16.0428;
|
molWeight 16.0428;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
@ -85,7 +82,6 @@ CO2
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 44.01;
|
molWeight 44.01;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
@ -107,7 +103,6 @@ N2
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 28.0134;
|
molWeight 28.0134;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
@ -129,7 +124,6 @@ C3H8
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 44.0962;
|
molWeight 44.0962;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
@ -151,7 +145,6 @@ CORRUGATED
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 115.82;
|
molWeight 115.82;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
@ -173,7 +166,6 @@ CH2O
|
|||||||
{
|
{
|
||||||
specie
|
specie
|
||||||
{
|
{
|
||||||
nMoles 1;
|
|
||||||
molWeight 30.02628;
|
molWeight 30.02628;
|
||||||
}
|
}
|
||||||
thermodynamics
|
thermodynamics
|
||||||
|
|||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user