mirror of
https://develop.openfoam.com/Development/openfoam.git
synced 2025-11-28 03:28:01 +00:00
INT: Integration of isoAdvector and supporting material
Community contribution from Johan Roenby, DHI
IsoAdvector is a geometric Volume-of-Fluid method for advection of a
sharp interface between two incompressible fluids. It works on both
structured and unstructured meshes with no requirements on cell shapes.
IsoAdvector is as an alternative choice for the interface compression
treatment with the MULES limiter implemented in the interFoam family
of solvers.
The isoAdvector concept and code was developed at DHI and was funded
by a Sapere Aude postdoc grant to Johan Roenby from The Danish Council
for Independent Research | Technology and Production Sciences (Grant-ID:
DFF - 1337-00118B - FTP).
Co-funding is also provided by the GTS grant to DHI from the Danish
Agency for Science, Technology and Innovation.
The ideas behind and performance of the isoAdvector scheme is
documented in:
Roenby J, Bredmose H, Jasak H. 2016 A computational method for sharp
interface advection. R. Soc. open sci. 3: 160405.
[http://dx.doi.org/10.1098/rsos.160405](http://dx.doi.org/10.1098/rsos.160405)
Videos showing isoAdvector's performance with a number of standard
test cases can be found in this youtube channel:
https://www.youtube.com/channel/UCt6Idpv4C8TTgz1iUX0prAA
Project contributors:
* Johan Roenby <jro@dhigroup.com> (Inventor and main developer)
* Hrvoje Jasak <hrvoje.jasak@fsb.hr> (Consistent treatment of
boundary faces including processor boundaries, parallelisation,
code clean up
* Henrik Bredmose <hbre@dtu.dk> (Assisted in the conceptual
development)
* Vuko Vukcevic <vuko.vukcevic@fsb.hr> (Code review, profiling,
porting to foam-extend, bug fixing, testing)
* Tomislav Maric <tomislav@sourceflux.de> (Source file
rearrangement)
* Andy Heather <a.heather@opencfd.co.uk> (Integration into OpenFOAM
for v1706 release)
See the integration repository below to see the full set of changes
implemented for release into OpenFOAM v1706
https://develop.openfoam.com/Community/Integration-isoAdvector
This commit is contained in:
199
src/functionObjects/field/setFlow/setFlow.H
Normal file
199
src/functionObjects/field/setFlow/setFlow.H
Normal file
@ -0,0 +1,199 @@
|
||||
/*---------------------------------------------------------------------------*\
|
||||
========= |
|
||||
\\ / 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::setFlow
|
||||
|
||||
Group
|
||||
grpFieldFunctionObjects
|
||||
|
||||
Description
|
||||
Provides options to set the velocity and flux fields as a function of time
|
||||
|
||||
Useful for testing advection behaviour of numerical schemes by e.g.
|
||||
imposing solid body rotation, vortex flows. All types include a scaling
|
||||
Foam::Function1 type enabling the strength of the transformation to vary as
|
||||
a function of time.
|
||||
|
||||
Usage
|
||||
Example of function object specification:
|
||||
\verbatim
|
||||
setFlow1
|
||||
{
|
||||
type setFlow;
|
||||
libs ("libfieldFunctionObjects.so");
|
||||
...
|
||||
mode rotation;
|
||||
scale 1;
|
||||
reverseTime 1;
|
||||
omega 6.28318530718;
|
||||
origin (0.5 0 0.5);
|
||||
refDir (1 0 0);
|
||||
axis (0 1 0);
|
||||
}
|
||||
\endverbatim
|
||||
|
||||
Where the entries comprise:
|
||||
\table
|
||||
Property | Description | Required | Default value
|
||||
type | Type name: setFlow | yes |
|
||||
U | Name of velocity field | no | U
|
||||
rho | Name of density field | no | none
|
||||
phi | Name of flux field | no | phi
|
||||
mode | operating mode - see below | yes |
|
||||
\endtable
|
||||
|
||||
Available \c mode types include:
|
||||
- function
|
||||
- rortation
|
||||
- vortex2D
|
||||
- vortex3D
|
||||
|
||||
|
||||
See also
|
||||
Foam::functionObjects::fvMeshFunctionObject
|
||||
|
||||
SourceFiles
|
||||
setFlow.C
|
||||
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
#ifndef functionObjects_setFlow_H
|
||||
#define functionObjects_setFlow_H
|
||||
|
||||
#include "fvMeshFunctionObject.H"
|
||||
#include "Function1.H"
|
||||
#include "Enum.H"
|
||||
#include "point.H"
|
||||
#include "volFieldsFwd.H"
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
namespace Foam
|
||||
{
|
||||
namespace functionObjects
|
||||
{
|
||||
|
||||
/*---------------------------------------------------------------------------*\
|
||||
Class setFlow Declaration
|
||||
\*---------------------------------------------------------------------------*/
|
||||
|
||||
class setFlow
|
||||
:
|
||||
public fvMeshFunctionObject
|
||||
{
|
||||
enum class modeType
|
||||
{
|
||||
FUNCTION,
|
||||
ROTATION,
|
||||
VORTEX2D,
|
||||
VORTEX3D
|
||||
};
|
||||
|
||||
static const Foam::Enum<modeType> modeTypeNames;
|
||||
|
||||
|
||||
// Private Data
|
||||
|
||||
//- Name of vecloity field, default = "U"
|
||||
word UName_;
|
||||
|
||||
//- Name of density field, default = "none"
|
||||
word rhoName_;
|
||||
|
||||
//- Name of flux field, default = "phi"
|
||||
word phiName_;
|
||||
|
||||
//- Operating mode
|
||||
modeType mode_;
|
||||
|
||||
//- Reverse time
|
||||
scalar reverseTime_;
|
||||
|
||||
//- Scaling function
|
||||
autoPtr<Function1<scalar>> scalePtr_;
|
||||
|
||||
|
||||
// Rotation
|
||||
|
||||
//- Origin
|
||||
point origin_;
|
||||
|
||||
//- Rotation tensor for rotational mode
|
||||
tensor R_;
|
||||
|
||||
//- Rotational speed function
|
||||
autoPtr<Function1<scalar>> omegaPtr_;
|
||||
|
||||
|
||||
// Function
|
||||
|
||||
//- Velocity function
|
||||
autoPtr<Function1<vector>> velocityPtr_;
|
||||
|
||||
|
||||
// Private Member Functions
|
||||
|
||||
//- Set the flux field
|
||||
void setPhi(const volVectorField& U);
|
||||
|
||||
|
||||
public:
|
||||
|
||||
//- Runtime type information
|
||||
TypeName("setFlow");
|
||||
|
||||
|
||||
// Constructors
|
||||
|
||||
//- Construct from Time and dictionary
|
||||
setFlow
|
||||
(
|
||||
const word& name,
|
||||
const Time& runTime,
|
||||
const dictionary& dict
|
||||
);
|
||||
|
||||
|
||||
//- Destructor
|
||||
virtual ~setFlow();
|
||||
|
||||
|
||||
virtual bool read(const dictionary& dict);
|
||||
|
||||
virtual bool execute();
|
||||
|
||||
virtual bool write();
|
||||
};
|
||||
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
} // End namespace functionObjects
|
||||
} // End namespace Foam
|
||||
|
||||
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
|
||||
|
||||
#endif
|
||||
|
||||
// ************************************************************************* //
|
||||
Reference in New Issue
Block a user