pimpleFoam: Merged dynamic mesh functionality of pimpleDyMFoam into pimpleFoam

and replaced pimpleDyMFoam with a script which reports this change.

The pimpleDyMFoam tutorials have been moved into the pimpleFoam directory.

This change is the first of a set of developments to merge dynamic mesh
functionality into the standard solvers to improve consistency, usability,
flexibility and maintainability of these solvers.

Henry G. Weller
CFD Direct Ltd.
This commit is contained in:
Henry Weller
2017-11-22 16:31:30 +00:00
parent 349a2ab2b2
commit d1fa9b6339
139 changed files with 268 additions and 248 deletions

View File

@ -125,13 +125,16 @@ public:
virtual bool update() = 0;
};
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace Foam
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#include "staticFvMesh.H"
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
#endif
// ************************************************************************* //

View File

@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include "staticFvMesh.H"
#include "dynamicFvMesh.H"
// * * * * * * * * * * * * * * * * Selectors * * * * * * * * * * * * * * * * //

View File

@ -0,0 +1,51 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 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/>.
Global
createUf
Description
Creates and initialises the velocity field Uf if present.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
autoPtr<surfaceVectorField> Uf;
IOobject UfHeader
(
"Uf",
runTime.timeName(),
mesh,
IOobject::MUST_READ,
IOobject::AUTO_WRITE
);
if (UfHeader.typeHeaderOk<surfaceVectorField>(true))
{
Info<< "Reading face velocity Uf\n" << endl;
Uf = new surfaceVectorField(UfHeader, mesh);
}
// ************************************************************************* //

View File

@ -0,0 +1,55 @@
/*---------------------------------------------------------------------------*\
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration |
\\ / A nd | Copyright (C) 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/>.
Global
updateUf
Description
Constructs the face velocity field Uf if not already constructed.
\*---------------------------------------------------------------------------*/
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
if (mesh.changing())
{
if (!Uf.valid())
{
Info<< "Constructing face velocity Uf" << endl;
Uf = new surfaceVectorField
(
IOobject
(
"Uf",
runTime.timeName(),
mesh,
IOobject::READ_IF_PRESENT,
IOobject::AUTO_WRITE
),
fvc::interpolate(U)
);
}
}
// ************************************************************************* //

View File

@ -265,6 +265,32 @@ ddtCorr
}
template<class Type>
tmp<GeometricField<typename flux<Type>::type, fvsPatchField, surfaceMesh>>
ddtCorr
(
const volScalarField& rho,
const GeometricField<Type, fvPatchField, volMesh>& U,
const GeometricField
<
typename flux<Type>::type,
fvsPatchField,
surfaceMesh
>& phi,
const autoPtr<GeometricField<Type, fvsPatchField, surfaceMesh>>& Uf
)
{
if (U.mesh().changing())
{
return ddtCorr(rho, U, Uf());
}
else
{
return ddtCorr(rho, U, phi);
}
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
} // End namespace fvc

View File

@ -214,6 +214,29 @@ namespace fvc
surfaceMesh
>& phi
);
template<class Type>
tmp
<
GeometricField
<
typename Foam::flux<Type>::type,
fvsPatchField,
surfaceMesh
>
>
ddtCorr
(
const volScalarField& rho,
const GeometricField<Type, fvPatchField, volMesh>& U,
const GeometricField
<
typename Foam::flux<Type>::type,
fvsPatchField,
surfaceMesh
>& phi,
const autoPtr<GeometricField<Type, fvsPatchField, surfaceMesh>>& Uf
);
}

View File

@ -228,7 +228,7 @@ void Foam::fvc::correctUf
{
const fvMesh& mesh = U.mesh();
if (phi.mesh().changing())
if (mesh.changing())
{
Uf() = fvc::interpolate(U);
surfaceVectorField n(mesh.Sf()/mesh.magSf());
@ -237,4 +237,23 @@ void Foam::fvc::correctUf
}
void Foam::fvc::correctRhoUf
(
autoPtr<surfaceVectorField>& rhoUf,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi
)
{
const fvMesh& mesh = U.mesh();
if (mesh.changing())
{
rhoUf() = fvc::interpolate(rho*U);
surfaceVectorField n(mesh.Sf()/mesh.magSf());
rhoUf() += n*(fvc::absolute(phi, rho, U)/mesh.magSf() - (n & rhoUf()));
}
}
// ************************************************************************* //

View File

@ -154,6 +154,14 @@ namespace fvc
const volVectorField& U,
const surfaceScalarField& phi
);
void correctRhoUf
(
autoPtr<surfaceVectorField>& rhoUf,
const volScalarField& rho,
const volVectorField& U,
const surfaceScalarField& phi
);
}