Maxwell model for viscoelasticity using the upper-convected time
derivative of the stress tensor. See http://en.wikipedia.org/wiki/Upper-convected_Maxwell_model The model includes an additional viscosity (nu) from the transport model from which it is instantiated, which makes it equivalent to the Oldroyd-B model for the case of an incompressible transport model. See https://en.wikipedia.org/wiki/Oldroyd-B_model
This commit is contained in:
@ -45,6 +45,9 @@ makeBaseTurbulenceModel
|
||||
#include "Stokes.H"
|
||||
makeLaminarModel(Stokes);
|
||||
|
||||
#include "Maxwell.H"
|
||||
makeLaminarModel(Maxwell);
|
||||
|
||||
|
||||
// -------------------------------------------------------------------------- //
|
||||
// RAS models
|
||||
|
||||
240
src/TurbulenceModels/turbulenceModels/laminar/Maxwell/Maxwell.C
Normal file
240
src/TurbulenceModels/turbulenceModels/laminar/Maxwell/Maxwell.C
Normal file
@ -0,0 +1,240 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 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 "Maxwell.H"
|
||||
#include "fvOptions.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace laminarModels
|
||||
{
|
||||
|
||||
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
|
||||
|
||||
template<class BasicTurbulenceModel>
|
||||
Maxwell<BasicTurbulenceModel>::Maxwell
|
||||
(
|
||||
const alphaField& alpha,
|
||||
const rhoField& rho,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& alphaRhoPhi,
|
||||
const surfaceScalarField& phi,
|
||||
const transportModel& transport,
|
||||
const word& propertiesName,
|
||||
const word& type
|
||||
)
|
||||
:
|
||||
laminarModel<BasicTurbulenceModel>
|
||||
(
|
||||
type,
|
||||
alpha,
|
||||
rho,
|
||||
U,
|
||||
alphaRhoPhi,
|
||||
phi,
|
||||
transport,
|
||||
propertiesName
|
||||
),
|
||||
|
||||
nuM_
|
||||
(
|
||||
dimensioned<scalar>
|
||||
(
|
||||
"nuM",
|
||||
dimViscosity,
|
||||
this->coeffDict_.lookup("nuM")
|
||||
)
|
||||
),
|
||||
|
||||
lambda_
|
||||
(
|
||||
dimensioned<scalar>
|
||||
(
|
||||
"lambda",
|
||||
dimTime,
|
||||
this->coeffDict_.lookup("lambda")
|
||||
)
|
||||
),
|
||||
|
||||
sigma_
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("sigma", U.group()),
|
||||
this->runTime_.timeName(),
|
||||
this->mesh_,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::AUTO_WRITE
|
||||
),
|
||||
this->mesh_
|
||||
)
|
||||
{
|
||||
if (type == typeName)
|
||||
{
|
||||
this->printCoeffs(type);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
|
||||
|
||||
template<class BasicTurbulenceModel>
|
||||
bool Maxwell<BasicTurbulenceModel>::read()
|
||||
{
|
||||
if (laminarModel<BasicTurbulenceModel>::read())
|
||||
{
|
||||
nuM_.readIfPresent(this->coeffDict());
|
||||
lambda_.readIfPresent(this->coeffDict());
|
||||
|
||||
return true;
|
||||
}
|
||||
else
|
||||
{
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
template<class BasicTurbulenceModel>
|
||||
tmp<Foam::volSymmTensorField>
|
||||
Maxwell<BasicTurbulenceModel>::R() const
|
||||
{
|
||||
return sigma_;
|
||||
}
|
||||
|
||||
template<class BasicTurbulenceModel>
|
||||
tmp<Foam::volSymmTensorField>
|
||||
Maxwell<BasicTurbulenceModel>::devRhoReff() const
|
||||
{
|
||||
return tmp<volSymmTensorField>
|
||||
(
|
||||
new volSymmTensorField
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
IOobject::groupName("devRhoReff", this->U_.group()),
|
||||
this->runTime_.timeName(),
|
||||
this->mesh_,
|
||||
IOobject::NO_READ,
|
||||
IOobject::NO_WRITE
|
||||
),
|
||||
this->alpha_*this->rho_*sigma_
|
||||
- (this->alpha_*this->rho_*this->nu())
|
||||
*dev(twoSymm(fvc::grad(this->U_)))
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasicTurbulenceModel>
|
||||
tmp<Foam::fvVectorMatrix>
|
||||
Maxwell<BasicTurbulenceModel>::divDevRhoReff
|
||||
(
|
||||
volVectorField& U
|
||||
) const
|
||||
{
|
||||
return
|
||||
(
|
||||
fvc::div
|
||||
(
|
||||
this->alpha_*this->rho_*this->nuM_*fvc::grad(U)
|
||||
)
|
||||
+ fvc::div(this->alpha_*this->rho_*sigma_)
|
||||
- fvc::div(this->alpha_*this->rho_*this->nu()*dev2(T(fvc::grad(U))))
|
||||
- fvm::laplacian(this->alpha_*this->rho_*nu0(), U)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasicTurbulenceModel>
|
||||
tmp<Foam::fvVectorMatrix>
|
||||
Maxwell<BasicTurbulenceModel>::divDevRhoReff
|
||||
(
|
||||
const volScalarField& rho,
|
||||
volVectorField& U
|
||||
) const
|
||||
{
|
||||
return
|
||||
(
|
||||
fvc::div
|
||||
(
|
||||
this->alpha_*rho*this->nuM_*fvc::grad(U)
|
||||
)
|
||||
+ fvc::div(this->alpha_*rho*sigma_)
|
||||
- fvc::div(this->alpha_*rho*this->nu()*dev2(T(fvc::grad(U))))
|
||||
- fvm::laplacian(this->alpha_*rho*nu0(), U)
|
||||
);
|
||||
}
|
||||
|
||||
|
||||
template<class BasicTurbulenceModel>
|
||||
void Maxwell<BasicTurbulenceModel>::correct()
|
||||
{
|
||||
// Local references
|
||||
const alphaField& alpha = this->alpha_;
|
||||
const rhoField& rho = this->rho_;
|
||||
const surfaceScalarField& alphaRhoPhi = this->alphaRhoPhi_;
|
||||
const volVectorField& U = this->U_;
|
||||
volSymmTensorField& sigma = this->sigma_;
|
||||
fv::options& fvOptions(fv::options::New(this->mesh_));
|
||||
|
||||
laminarModel<BasicTurbulenceModel>::correct();
|
||||
|
||||
tmp<volTensorField> tgradU(fvc::grad(U));
|
||||
const volTensorField& gradU = tgradU();
|
||||
dimensionedScalar rLambda = 1.0/(lambda_);
|
||||
|
||||
// Note sigma is positive on lhs of momentum eqn
|
||||
volSymmTensorField P
|
||||
(
|
||||
twoSymm(sigma & gradU)
|
||||
- nuM_*rLambda*twoSymm(gradU)
|
||||
);
|
||||
|
||||
// Viscoelastic stress equation
|
||||
tmp<fvSymmTensorMatrix> sigmaEqn
|
||||
(
|
||||
fvm::ddt(alpha, rho, sigma)
|
||||
+ fvm::div(alphaRhoPhi, sigma)
|
||||
+ fvm::Sp(alpha*rho*rLambda, sigma)
|
||||
==
|
||||
alpha*rho*P
|
||||
+ fvOptions(alpha, rho, sigma)
|
||||
);
|
||||
|
||||
sigmaEqn.ref().relax();
|
||||
fvOptions.constrain(sigmaEqn.ref());
|
||||
solve(sigmaEqn);
|
||||
fvOptions.correct(sigma_);
|
||||
}
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace laminarModels
|
||||
} // End namespace Foam
|
||||
|
||||
// ************************************************************************* //
|
||||
174
src/TurbulenceModels/turbulenceModels/laminar/Maxwell/Maxwell.H
Normal file
174
src/TurbulenceModels/turbulenceModels/laminar/Maxwell/Maxwell.H
Normal file
@ -0,0 +1,174 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 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/>.
|
||||
|
||||
Class
|
||||
Foam::laminarModels::Maxwell
|
||||
|
||||
Group
|
||||
grpLaminar
|
||||
|
||||
Description
|
||||
Maxwell model for viscoelasticity using the upper-convected time
|
||||
derivative of the stress tensor.
|
||||
See http://en.wikipedia.org/wiki/Upper-convected_Maxwell_model
|
||||
|
||||
The model includes an additional viscosity (nu) from the transport
|
||||
model from which it is instantiated, which makes it equivalent to
|
||||
the Oldroyd-B model for the case of an incompressible transport
|
||||
model (where nu is non-zero).
|
||||
See https://en.wikipedia.org/wiki/Oldroyd-B_model
|
||||
|
||||
Reference:
|
||||
\verbatim
|
||||
Amoreira, L. J., & Oliveira, P. J. (2010).
|
||||
Comparison of different formulations for the numerical calculation
|
||||
of unsteady incompressible viscoelastic fluid flow.
|
||||
Adv. Appl. Math. Mech, 4, 483-502.
|
||||
\endverbatim
|
||||
|
||||
SourceFiles
|
||||
Maxwell.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef Maxwell_H
|
||||
#define Maxwell_H
|
||||
|
||||
#include "laminarModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace laminarModels
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class Maxwell Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
template<class BasicTurbulenceModel>
|
||||
class Maxwell
|
||||
:
|
||||
public laminarModel<BasicTurbulenceModel>
|
||||
{
|
||||
|
||||
protected:
|
||||
|
||||
// Protected data
|
||||
|
||||
// Model coefficients
|
||||
|
||||
dimensionedScalar nuM_;
|
||||
dimensionedScalar lambda_;
|
||||
|
||||
|
||||
// Fields
|
||||
|
||||
volSymmTensorField sigma_;
|
||||
|
||||
|
||||
// Protected Member Functions
|
||||
|
||||
//- Return the turbulence viscosity
|
||||
tmp<volScalarField> nu0() const
|
||||
{
|
||||
return this->nu() + nuM_;
|
||||
}
|
||||
|
||||
|
||||
public:
|
||||
|
||||
typedef typename BasicTurbulenceModel::alphaField alphaField;
|
||||
typedef typename BasicTurbulenceModel::rhoField rhoField;
|
||||
typedef typename BasicTurbulenceModel::transportModel transportModel;
|
||||
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("Maxwell");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from components
|
||||
Maxwell
|
||||
(
|
||||
const alphaField& alpha,
|
||||
const rhoField& rho,
|
||||
const volVectorField& U,
|
||||
const surfaceScalarField& alphaRhoPhi,
|
||||
const surfaceScalarField& phi,
|
||||
const transportModel& transport,
|
||||
const word& propertiesName = turbulenceModel::propertiesName,
|
||||
const word& type = typeName
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~Maxwell()
|
||||
{}
|
||||
|
||||
|
||||
// Member Functions
|
||||
|
||||
//- Read model coefficients if they have changed
|
||||
virtual bool read();
|
||||
|
||||
//- Return the Reynolds stress tensor
|
||||
virtual tmp<volSymmTensorField> R() const;
|
||||
|
||||
//- Return the effective stress tensor
|
||||
virtual tmp<volSymmTensorField> devRhoReff() const;
|
||||
|
||||
//- Return the source term for the momentum equation
|
||||
virtual tmp<fvVectorMatrix> divDevRhoReff(volVectorField& U) const;
|
||||
|
||||
//- Return the source term for the momentum equation
|
||||
virtual tmp<fvVectorMatrix> divDevRhoReff
|
||||
(
|
||||
const volScalarField& rho,
|
||||
volVectorField& U
|
||||
) const;
|
||||
|
||||
//- Solve the turbulence equations and correct eddy-Viscosity and
|
||||
// related properties
|
||||
virtual void correct();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace laminarModels
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#ifdef NoRepository
|
||||
#include "Maxwell.C"
|
||||
#endif
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,46 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volVectorField;
|
||||
object U;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
Uinlet (0.03876 0 0);
|
||||
|
||||
dimensions [0 1 -1 0 0 0 0];
|
||||
|
||||
internalField uniform (0 0 0);
|
||||
|
||||
boundaryField
|
||||
{
|
||||
inlet
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform $Uinlet;
|
||||
}
|
||||
|
||||
outlet
|
||||
{
|
||||
type zeroGradient;
|
||||
value uniform (0 0 0);
|
||||
}
|
||||
|
||||
wall
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform (0 0 0);
|
||||
}
|
||||
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,42 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
object p;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 2 -2 0 0 0 0];
|
||||
|
||||
internalField uniform 0;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
inlet
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
|
||||
outlet
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform 0;
|
||||
}
|
||||
|
||||
wall
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,38 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volSymmTensorField;
|
||||
object R;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 2 -2 0 0 0 0];
|
||||
|
||||
internalField uniform (0 0 0 0 0 0);
|
||||
|
||||
boundaryField
|
||||
{
|
||||
inlet
|
||||
{
|
||||
type fixedValue;
|
||||
value $internalField;
|
||||
}
|
||||
|
||||
".*"
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,21 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: 3.0.1 |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object transportProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
transportModel Newtonian;
|
||||
|
||||
nu [0 2 -1 0 0 0 0] 1e-5;
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,32 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object turbulenceProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
simulationType laminar;
|
||||
|
||||
laminar
|
||||
{
|
||||
laminarModel Maxwell;
|
||||
|
||||
MaxwellCoeffs
|
||||
{
|
||||
nuM 0.002;
|
||||
lambda 0.03;
|
||||
}
|
||||
|
||||
printCoeffs on;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,112 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
convertToMeters 0.0032;
|
||||
|
||||
vertices
|
||||
(
|
||||
(-40 0 -1)
|
||||
( 0 0 -1)
|
||||
( 30 0 -1)
|
||||
(-40 1 -1)
|
||||
( 0 1 -1)
|
||||
( 30 1 -1)
|
||||
(-40 4 -1)
|
||||
( 0 4 -1)
|
||||
|
||||
(-40 0 1)
|
||||
( 0 0 1)
|
||||
( 30 0 1)
|
||||
(-40 1 1)
|
||||
( 0 1 1)
|
||||
( 30 1 1)
|
||||
(-40 4 1)
|
||||
( 0 4 1)
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 4 3 8 9 12 11) (40 12 1) simpleGrading (0.02 0.4 1)
|
||||
hex (1 2 5 4 9 10 13 12) (30 12 1) simpleGrading (50 0.4 1)
|
||||
hex (3 4 7 6 11 12 15 14) (40 24 1) simpleGrading (0.02 ((0.5 0.5 4.0) (0.5 0.5 0.25)) 1)
|
||||
);
|
||||
|
||||
edges
|
||||
(
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
inlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(0 3 11 8)
|
||||
(3 6 14 11)
|
||||
);
|
||||
}
|
||||
|
||||
walls
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(6 7 15 14)
|
||||
(7 4 12 15)
|
||||
(4 5 13 12)
|
||||
);
|
||||
}
|
||||
|
||||
outlet
|
||||
{
|
||||
type patch;
|
||||
faces
|
||||
(
|
||||
(2 5 13 10)
|
||||
);
|
||||
}
|
||||
|
||||
centreline
|
||||
{
|
||||
type symmetryPlane;
|
||||
faces
|
||||
(
|
||||
(0 1 9 8)
|
||||
(1 2 10 9)
|
||||
);
|
||||
}
|
||||
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
faces
|
||||
(
|
||||
(0 1 4 3)
|
||||
(3 4 7 6)
|
||||
(1 2 5 4)
|
||||
(8 9 12 11)
|
||||
(11 12 15 14)
|
||||
(9 10 13 12)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
mergePatchPairs
|
||||
(
|
||||
);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,52 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object controlDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application pimpleFoam;
|
||||
|
||||
startFrom latestTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
stopAt endTime;
|
||||
|
||||
endTime 0.25;
|
||||
|
||||
deltaT 2e-4;
|
||||
|
||||
writeControl runTime;
|
||||
|
||||
writeInterval 0.01;
|
||||
|
||||
purgeWrite 0;
|
||||
|
||||
writeFormat ascii;
|
||||
|
||||
writePrecision 8;
|
||||
|
||||
writeCompression off;
|
||||
|
||||
timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
runTimeModifiable true;
|
||||
|
||||
functions
|
||||
{
|
||||
#includeFunc graphs
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,54 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object fvSchemes;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
ddtSchemes
|
||||
{
|
||||
default backward;
|
||||
}
|
||||
|
||||
gradSchemes
|
||||
{
|
||||
default Gauss linear;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
|
||||
div(phi,U) Gauss linearUpwind grad(U);
|
||||
div(phi,sigma) Gauss vanAlbada;
|
||||
|
||||
div(sigma) Gauss linear;
|
||||
div((nu*dev2(T(grad(U))))) Gauss linear;
|
||||
div((nuM*grad(U))) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default Gauss linear corrected;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
{
|
||||
default linear;
|
||||
}
|
||||
|
||||
snGradSchemes
|
||||
{
|
||||
default corrected;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,67 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object fvSolution;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
solvers
|
||||
{
|
||||
p
|
||||
{
|
||||
solver GAMG;
|
||||
smoother DIC;
|
||||
tolerance 1e-6;
|
||||
relTol 0.05;
|
||||
}
|
||||
|
||||
"(U|sigma)"
|
||||
{
|
||||
solver smoothSolver;
|
||||
smoother symGaussSeidel;
|
||||
tolerance 1e-6;
|
||||
relTol 0.1;
|
||||
}
|
||||
|
||||
pFinal
|
||||
{
|
||||
$p;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
"(U|sigma)Final"
|
||||
{
|
||||
$U;
|
||||
relTol 0;
|
||||
}
|
||||
}
|
||||
|
||||
PIMPLE
|
||||
{
|
||||
momentumPredictor off;
|
||||
nOuterCorrectors 15;
|
||||
nCorrectors 1;
|
||||
nNonOrthogonalCorrectors 0;
|
||||
pRefCell 0;
|
||||
pRefValue 0;
|
||||
turbOnFinalIterOnly no;
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
{
|
||||
equations
|
||||
{
|
||||
".*" 1;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,62 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Web: www.OpenFOAM.org
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Description
|
||||
Writes graph data for specified fields along a line, specified by start
|
||||
and end points.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
// Sampling and I/O settings
|
||||
#includeEtc "caseDicts/postProcessing/graphs/sampleDict.cfg"
|
||||
|
||||
// Override settings here, e.g.
|
||||
// setConfig { type midPoint; }
|
||||
|
||||
type sets;
|
||||
libs ("libsampling.so");
|
||||
|
||||
writeControl writeTime;
|
||||
|
||||
interpolationScheme cellPoint;
|
||||
|
||||
setFormat raw;
|
||||
|
||||
setConfig
|
||||
{
|
||||
type midPoint; // midPoint
|
||||
axis distance; // x, y, z, xyz
|
||||
}
|
||||
|
||||
sets
|
||||
(
|
||||
lineA
|
||||
{
|
||||
$setConfig;
|
||||
start (-0.0016 0 0);
|
||||
end (-0.0016 0.0128 0);
|
||||
}
|
||||
|
||||
lineB
|
||||
{
|
||||
$setConfig;
|
||||
start (-0.0048 0 0);
|
||||
end (-0.0048 0.0128 0);
|
||||
}
|
||||
|
||||
lineC
|
||||
{
|
||||
$setConfig;
|
||||
start (-0.032 0 0);
|
||||
end (-0.032 0.0128 0);
|
||||
}
|
||||
);
|
||||
|
||||
fields (U);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,32 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volVectorField;
|
||||
object U;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 1 -1 0 0 0 0];
|
||||
|
||||
internalField uniform (0 0 0);
|
||||
|
||||
boundaryField
|
||||
{
|
||||
wall
|
||||
{
|
||||
type fixedValue;
|
||||
value uniform (0 0 0);
|
||||
}
|
||||
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,31 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volScalarField;
|
||||
object p;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 2 -2 0 0 0 0];
|
||||
|
||||
internalField uniform 0;
|
||||
|
||||
boundaryField
|
||||
{
|
||||
walls
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,32 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class volSymmTensorField;
|
||||
object R;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
dimensions [0 2 -2 0 0 0 0];
|
||||
|
||||
internalField uniform (0 0 0 0 0 0);
|
||||
|
||||
boundaryField
|
||||
{
|
||||
walls
|
||||
{
|
||||
type zeroGradient;
|
||||
}
|
||||
|
||||
#includeEtc "caseDicts/setConstraintTypes"
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
12
tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/Allclean
Executable file
12
tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/Allclean
Executable file
@ -0,0 +1,12 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Source tutorial clean functions
|
||||
. $WM_PROJECT_DIR/bin/tools/CleanFunctions
|
||||
|
||||
cleanCase
|
||||
rm -rf postProcessing *.dat validation/*.eps
|
||||
|
||||
wclean validation/WatersKing
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
15
tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/Allrun
Executable file
15
tutorials/incompressible/pimpleFoam/laminar/planarPoiseuille/Allrun
Executable file
@ -0,0 +1,15 @@
|
||||
#!/bin/sh
|
||||
cd ${0%/*} || exit 1 # Run from this directory
|
||||
|
||||
# Source tutorial run functions
|
||||
. $WM_PROJECT_DIR/bin/tools/RunFunctions
|
||||
|
||||
runApplication blockMesh
|
||||
runApplication $(getApplication)
|
||||
|
||||
wmake validation/WatersKing
|
||||
runApplication WatersKing
|
||||
|
||||
( cd validation && ./createGraph )
|
||||
|
||||
#------------------------------------------------------------------------------
|
||||
@ -0,0 +1,38 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
location "constant";
|
||||
object fvOptions;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
momentumSource
|
||||
{
|
||||
type vectorSemiImplicitSource;
|
||||
active yes;
|
||||
|
||||
vectorSemiImplicitSourceCoeffs
|
||||
{
|
||||
timeStart 0.0;
|
||||
duration 1000;
|
||||
selectionMode all;
|
||||
|
||||
volumeMode specific;
|
||||
injectionRateSuSp
|
||||
{
|
||||
U ((5 0 0) 0);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,21 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object transportProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
transportModel Newtonian;
|
||||
|
||||
nu [0 2 -1 0 0 0 0] 0.1; // kinematic -> 0.002 dynamic
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,32 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object turbulenceProperties;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
simulationType laminar;
|
||||
|
||||
laminar
|
||||
{
|
||||
laminarModel Maxwell;
|
||||
|
||||
MaxwellCoeffs
|
||||
{
|
||||
nuM 1;
|
||||
lambda 5;
|
||||
}
|
||||
|
||||
printCoeffs on;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,96 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object blockMeshDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
convertToMeters 0.1;
|
||||
|
||||
vertices
|
||||
(
|
||||
(-1 0 -1)
|
||||
( 1 0 -1)
|
||||
( 1 10 -1)
|
||||
(-1 10 -1)
|
||||
|
||||
(-1 0 1)
|
||||
( 1 0 1)
|
||||
( 1 10 1)
|
||||
(-1 10 1)
|
||||
);
|
||||
|
||||
blocks
|
||||
(
|
||||
hex (0 1 2 3 4 5 6 7) (1 40 1) simpleGrading (1 4 1)
|
||||
);
|
||||
|
||||
edges
|
||||
(
|
||||
);
|
||||
|
||||
boundary
|
||||
(
|
||||
left
|
||||
{
|
||||
type cyclic;
|
||||
neighbourPatch right;
|
||||
faces
|
||||
(
|
||||
(0 3 7 4)
|
||||
);
|
||||
}
|
||||
|
||||
right
|
||||
{
|
||||
type cyclic;
|
||||
neighbourPatch left;
|
||||
faces
|
||||
(
|
||||
(1 2 6 5)
|
||||
);
|
||||
}
|
||||
|
||||
walls
|
||||
{
|
||||
type wall;
|
||||
faces
|
||||
(
|
||||
(0 1 5 4)
|
||||
);
|
||||
}
|
||||
|
||||
centreline
|
||||
{
|
||||
type symmetryPlane;
|
||||
faces
|
||||
(
|
||||
(2 3 7 6)
|
||||
);
|
||||
}
|
||||
|
||||
frontAndBack
|
||||
{
|
||||
type empty;
|
||||
faces
|
||||
(
|
||||
(0 1 2 3)
|
||||
(4 5 6 7)
|
||||
);
|
||||
}
|
||||
);
|
||||
|
||||
mergePatchPairs
|
||||
(
|
||||
);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,54 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object controlDict;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
application pimpleFoam;
|
||||
|
||||
startFrom startTime;
|
||||
|
||||
startTime 0;
|
||||
|
||||
stopAt endTime;
|
||||
|
||||
endTime 25;
|
||||
|
||||
deltaT 5e-3;
|
||||
|
||||
writeControl runTime;
|
||||
|
||||
writeInterval 1;
|
||||
|
||||
purgeWrite 0;
|
||||
|
||||
writeFormat ascii;
|
||||
|
||||
writePrecision 8;
|
||||
|
||||
writeCompression off;
|
||||
|
||||
timeFormat general;
|
||||
|
||||
timePrecision 6;
|
||||
|
||||
runTimeModifiable true;
|
||||
|
||||
functions
|
||||
{
|
||||
#includeFunc residuals
|
||||
#includeFunc singleGraph
|
||||
#includeFunc probes
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,54 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object fvSchemes;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
ddtSchemes
|
||||
{
|
||||
default backward;
|
||||
}
|
||||
|
||||
gradSchemes
|
||||
{
|
||||
default Gauss linear;
|
||||
}
|
||||
|
||||
divSchemes
|
||||
{
|
||||
default none;
|
||||
|
||||
div(phi,U) Gauss linearUpwind grad(U);
|
||||
div(phi,sigma) Gauss vanAlbada;
|
||||
|
||||
div(sigma) Gauss linear;
|
||||
div((nu*dev2(T(grad(U))))) Gauss linear;
|
||||
div((nuM*grad(U))) Gauss linear;
|
||||
}
|
||||
|
||||
laplacianSchemes
|
||||
{
|
||||
default Gauss linear uncorrected;
|
||||
}
|
||||
|
||||
interpolationSchemes
|
||||
{
|
||||
default linear;
|
||||
}
|
||||
|
||||
snGradSchemes
|
||||
{
|
||||
default uncorrected;
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,67 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
| ========= | |
|
||||
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
|
||||
| \\ / O peration | Version: dev |
|
||||
| \\ / A nd | Web: www.OpenFOAM.org |
|
||||
| \\/ M anipulation | |
|
||||
\*---------------------------------------------------------------------------*/
|
||||
FoamFile
|
||||
{
|
||||
version 2.0;
|
||||
format ascii;
|
||||
class dictionary;
|
||||
object fvSolution;
|
||||
}
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
solvers
|
||||
{
|
||||
p
|
||||
{
|
||||
solver GAMG;
|
||||
smoother DIC;
|
||||
tolerance 1e-6;
|
||||
relTol 0.05;
|
||||
}
|
||||
|
||||
"(U|sigma)"
|
||||
{
|
||||
solver smoothSolver;
|
||||
smoother symGaussSeidel;
|
||||
tolerance 1e-6;
|
||||
relTol 0.1;
|
||||
}
|
||||
|
||||
pFinal
|
||||
{
|
||||
$p;
|
||||
relTol 0;
|
||||
}
|
||||
|
||||
"(U|sigma)Final"
|
||||
{
|
||||
$U;
|
||||
relTol 0;
|
||||
}
|
||||
}
|
||||
|
||||
PIMPLE
|
||||
{
|
||||
momentumPredictor off;
|
||||
nOuterCorrectors 15;
|
||||
nCorrectors 3;
|
||||
nNonOrthogonalCorrectors 0;
|
||||
pRefCell 0;
|
||||
pRefValue 0;
|
||||
turbOnFinalIterOnly no;
|
||||
}
|
||||
|
||||
relaxationFactors
|
||||
{
|
||||
equations
|
||||
{
|
||||
".*" 1;
|
||||
}
|
||||
}
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,21 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Web: www.OpenFOAM.org
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Description
|
||||
Writes out values of fields from cells nearest to specified locations.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#includeEtc "caseDicts/postProcessing/probes/probes.cfg"
|
||||
|
||||
fields (U);
|
||||
probeLocations
|
||||
(
|
||||
(0 1 0)
|
||||
);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,19 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Web: www.OpenFOAM.org
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Description
|
||||
For specified fields, writes out the initial residuals for the first
|
||||
solution of each time step; for non-scalar fields (e.g. vectors), writes
|
||||
the largest of the residuals for each component (e.g. x, y, z).
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#includeEtc "caseDicts/postProcessing/numerical/residuals.cfg"
|
||||
|
||||
fields (p sigma);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,48 @@
|
||||
/*--------------------------------*- C++ -*----------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Web: www.OpenFOAM.org
|
||||
\\/ M anipulation |
|
||||
-------------------------------------------------------------------------------
|
||||
Description
|
||||
Writes graph data for specified fields along a line, specified by start
|
||||
and end points.
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
|
||||
// Sampling and I/O settings
|
||||
#includeEtc "caseDicts/postProcessing/graphs/sampleDict.cfg"
|
||||
|
||||
// Override settings here, e.g.
|
||||
// setConfig { type midPoint; }
|
||||
|
||||
type sets;
|
||||
libs ("libsampling.so");
|
||||
|
||||
writeControl writeTime;
|
||||
|
||||
interpolationScheme cellPoint;
|
||||
|
||||
setFormat raw;
|
||||
|
||||
setConfig
|
||||
{
|
||||
type midPoint; // midPoint
|
||||
axis distance; // x, y, z, xyz
|
||||
}
|
||||
|
||||
sets
|
||||
(
|
||||
line
|
||||
{
|
||||
$setConfig;
|
||||
start (0 0 0);
|
||||
end (0 1 0);
|
||||
}
|
||||
);
|
||||
|
||||
fields (U);
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,3 @@
|
||||
WatersKing.C
|
||||
|
||||
EXE = $(FOAM_USER_APPBIN)/WatersKing
|
||||
@ -0,0 +1,14 @@
|
||||
EXE_INC = \
|
||||
-I$(LIB_SRC)/TurbulenceModels/turbulenceModels/lnInclude \
|
||||
-I$(LIB_SRC)/TurbulenceModels/incompressible/lnInclude \
|
||||
-I$(LIB_SRC)/transportModels \
|
||||
-I$(LIB_SRC)/transportModels/incompressible/singlePhaseTransportModel \
|
||||
-I$(LIB_SRC)/finiteVolume/lnInclude \
|
||||
-I$(LIB_SRC)/meshTools/lnInclude
|
||||
|
||||
EXE_LIBS = \
|
||||
-lturbulenceModels \
|
||||
-lincompressibleTurbulenceModels \
|
||||
-lincompressibleTransportModels \
|
||||
-lfiniteVolume \
|
||||
-lmeshTools
|
||||
@ -0,0 +1,146 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
|
||||
\\ / O peration |
|
||||
\\ / A nd | Copyright (C) 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/>.
|
||||
|
||||
Application
|
||||
WatersKing
|
||||
|
||||
Description
|
||||
Analytical solution for the start-up planar Poiseuille flow of an
|
||||
Oldroyd-B fluid.
|
||||
|
||||
References:
|
||||
\verbatim
|
||||
Waters, N. D., & King, M. J. (1970).
|
||||
Unsteady flow of an elasto-viscous liquid.
|
||||
Rheologica Acta, 9, 345-355.
|
||||
|
||||
Amoreira, L. J., & Oliveira, P. J. (2010).
|
||||
Comparison of different formulations for the numerical
|
||||
calculation of unsteady incompressible viscoelastic fluid
|
||||
flow. Adv. Appl. Math. Mech, 4, 483-502.
|
||||
\endverbatim
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#include "fvCFD.H"
|
||||
#include "singlePhaseTransportModel.H"
|
||||
#include "turbulentTransportModel.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
#include "setRootCase.H"
|
||||
#include "createTime.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#include "createMesh.H"
|
||||
#include "createFields.H"
|
||||
|
||||
const scalar h = mesh.bounds().span().y();
|
||||
Info<< "Height from centreline to wall = " << h << endl;
|
||||
|
||||
label centrelineID = mesh.boundary().findPatchID("centreline");
|
||||
const vector patchToCell =
|
||||
mesh.boundary()[centrelineID].Cf()[0]
|
||||
- mesh.C()[mesh.findNearestCell(location)];
|
||||
|
||||
const scalar y = patchToCell.y()/h;
|
||||
Info<< "Normalised distance from centreline = " << y << nl << endl;
|
||||
|
||||
const scalar nu0 = nu1 + nu2;
|
||||
const scalar E = lambda*nu0/(rho*sqr(h));
|
||||
const scalar beta = nu2/nu0;
|
||||
const scalar UInf = K*sqr(h)/3.0/nu0;
|
||||
|
||||
Info<< "Waters and King parameters:" << nl
|
||||
<< "E = " << E << nl
|
||||
<< "beta = " << beta << nl
|
||||
<< "K = " << K << nl
|
||||
<< "UInf = " << UInf << nl << endl;
|
||||
|
||||
label order = 8;
|
||||
|
||||
scalarField ak(order, 0);
|
||||
scalarField bk(order, 0);
|
||||
scalarField ck(order, 0);
|
||||
scalarField B(order, 0);
|
||||
|
||||
forAll(ak, i)
|
||||
{
|
||||
scalar k = i + 1;
|
||||
ak[i] = (2.0*k - 1)/2.0*constant::mathematical::pi*::sqrt(E);
|
||||
bk[i] = (1.0 + beta*sqr(ak[i]))/2.0;
|
||||
ck[i] = ::sqrt(mag(sqr(bk[i]) - sqr(ak[i])));
|
||||
B[i] = 48*::pow(-1, k)/::pow((2*k - 1)*constant::mathematical::pi, 3)*
|
||||
::cos((2*k - 1)*constant::mathematical::pi*y/2);
|
||||
}
|
||||
|
||||
scalarField A(order, 0);
|
||||
OFstream file(runTime.path()/"WatersKing.dat");
|
||||
const scalar LOGVGREAT = ::log(VGREAT);
|
||||
while (!runTime.end())
|
||||
{
|
||||
scalar t = runTime.timeOutputValue()/lambda;
|
||||
forAll(A, i)
|
||||
{
|
||||
if (bk[i]*t < LOGVGREAT)
|
||||
{
|
||||
if (bk[i] >= ak[i])
|
||||
{
|
||||
A[i] = (bk[i] - sqr(ak[i]))/ck[i]*::sinh(ck[i]*t)
|
||||
+ ::cosh(ck[i]*t);
|
||||
}
|
||||
else
|
||||
{
|
||||
A[i] = (bk[i] - sqr(ak[i]))/ck[i]*::sin(ck[i]*t)
|
||||
+ ::cos(ck[i]*t);
|
||||
}
|
||||
A[i] *= ::exp(-bk[i]*t);
|
||||
}
|
||||
else
|
||||
{
|
||||
Info<< "Coefficient A[" << order << "] = 0" << endl;
|
||||
order = i;
|
||||
Info<< "Resizing A and B to " << order << endl;
|
||||
A.resize(order);
|
||||
B.resize(order);
|
||||
}
|
||||
}
|
||||
scalar U = UInf*(1.5*(1 - sqr(y)) + sum(A*B));
|
||||
file<< runTime.timeName() << token::TAB << U << endl;
|
||||
runTime++;
|
||||
}
|
||||
|
||||
Info<< nl << "ExecutionTime = " << runTime.elapsedCpuTime() << " s"
|
||||
<< " ClockTime = " << runTime.elapsedClockTime() << " s"
|
||||
<< nl << endl;
|
||||
|
||||
Info<< "End\n" << endl;
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
// ************************************************************************* //
|
||||
@ -0,0 +1,64 @@
|
||||
Info<< "Reading transportProperties\n" << endl;
|
||||
IOdictionary transportProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"transportProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
const scalar nu2 =
|
||||
dimensionedScalar
|
||||
(
|
||||
"nu",
|
||||
dimViscosity,
|
||||
transportProperties.lookup("nu")
|
||||
).value();
|
||||
|
||||
Info<< "Reading viscoelastic properties\n" << endl;
|
||||
IOdictionary turbulenceProperties
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"turbulenceProperties",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
const dictionary& MaxwellCoeffs =
|
||||
turbulenceProperties.subDict("laminar").subDict("MaxwellCoeffs");
|
||||
const scalar nu1 = readScalar(MaxwellCoeffs.lookup("nuM"));
|
||||
const scalar lambda = readScalar(MaxwellCoeffs.lookup("lambda"));
|
||||
|
||||
const scalar rho = 1;
|
||||
|
||||
Info<< "Reading pressure gradient\n" << endl;
|
||||
IOdictionary fvOptions
|
||||
(
|
||||
IOobject
|
||||
(
|
||||
"fvOptions",
|
||||
runTime.constant(),
|
||||
mesh,
|
||||
IOobject::MUST_READ,
|
||||
IOobject::NO_WRITE
|
||||
)
|
||||
);
|
||||
const dictionary& gradPDict =
|
||||
fvOptions.subDict("momentumSource").subDict
|
||||
(
|
||||
"vectorSemiImplicitSourceCoeffs"
|
||||
).subDict
|
||||
(
|
||||
"injectionRateSuSp"
|
||||
);
|
||||
const scalar K =
|
||||
Tuple2<vector, scalar>(gradPDict.lookup("U")).first().x();
|
||||
|
||||
dictionary probes(IFstream(runTime.system()/"probes")());
|
||||
const point location = pointField(probes.lookup("probeLocations"))[0];
|
||||
@ -0,0 +1,27 @@
|
||||
#!/bin/sh
|
||||
|
||||
tail -n +4 ../postProcessing/probes/0/U | \
|
||||
tr -s " " | tr -d '(' | cut -d " " -f2-3 > ../Numerical.dat
|
||||
|
||||
if ! which gnuplot > /dev/null 2>&1
|
||||
then
|
||||
echo "gnuplot not found - skipping graph creation" >&2
|
||||
exit 1
|
||||
fi
|
||||
|
||||
gnuplot<<EOF
|
||||
set terminal postscript eps color enhanced "Helvetica,20"
|
||||
set output "planarPoiseuille.eps"
|
||||
set xlabel "Time / [s]" font "Helvetica,24"
|
||||
set ylabel "Velocity / [m/s]" font "Helvetica,24"
|
||||
set grid
|
||||
set key right top
|
||||
set xrange [0:25]
|
||||
set yrange [0:8]
|
||||
plot \
|
||||
"../Numerical.dat" t "OpenFOAM (every 100 pts)" \
|
||||
with linespoints pointinterval 100 lt 1 pt 6 ps 1.5, \
|
||||
"../WatersKing.dat" with lines t "Analytical" lt -1
|
||||
EOF
|
||||
|
||||
# ----------------------------------------------------------------- end-of-file
|
||||
Reference in New Issue
Block a user