Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Development
openfoam
Commits
98de2293
Commit
98de2293
authored
Mar 18, 2017
by
Henry Weller
Browse files
Function1: Added "Ramp" to the names of the ramp functions to avoid conflict
with more general forms of those functions.
parent
dd154781
Changes
12
Hide whitespace changes
Inline
Side-by-side
src/OpenFOAM/Make/files
View file @
98de2293
...
...
@@ -79,11 +79,11 @@ primitives/triad/triad.C
/* Run-time selectable functions */
primitives/functions/Function1/makeDataEntries.C
primitives/functions/Function1/ramp/ramp.C
primitives/functions/Function1/linear/linear.C
primitives/functions/Function1/quadratic/quadratic.C
primitives/functions/Function1/quarterSine/quarterSine.C
primitives/functions/Function1/quarterCosine/quarterCosine.C
primitives/functions/Function1/halfCosine/halfCosine.C
primitives/functions/Function1/linear
Ramp
/linear
Ramp
.C
primitives/functions/Function1/quadratic
Ramp
/quadratic
Ramp
.C
primitives/functions/Function1/quarterSine
Ramp
/quarterSine
Ramp
.C
primitives/functions/Function1/quarterCosine
Ramp
/quarterCosine
Ramp
.C
primitives/functions/Function1/halfCosine
Ramp
/halfCosine
Ramp
.C
primitives/functions/Polynomial/polynomialFunction.C
primitives/subModelBase/subModelBase.C
...
...
src/OpenFOAM/primitives/functions/Function1/halfCosine/halfCosine.C
→
src/OpenFOAM/primitives/functions/Function1/halfCosine
Ramp
/halfCosine
Ramp
.C
View file @
98de2293
...
...
@@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include
"halfCosine.H"
#include
"halfCosine
Ramp
.H"
#include
"mathematicalConstants.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
...
...
@@ -32,14 +32,14 @@ namespace Foam
{
namespace
Function1Types
{
makeScalarFunction1
(
halfCosine
);
makeScalarFunction1
(
halfCosine
Ramp
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
Function1Types
::
halfCosine
::
halfCosine
Foam
::
Function1Types
::
halfCosine
Ramp
::
halfCosine
Ramp
(
const
word
&
entryName
,
const
dictionary
&
dict
...
...
@@ -51,13 +51,13 @@ Foam::Function1Types::halfCosine::halfCosine
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam
::
Function1Types
::
halfCosine
::~
halfCosine
()
Foam
::
Function1Types
::
halfCosine
Ramp
::~
halfCosine
Ramp
()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam
::
scalar
Foam
::
Function1Types
::
halfCosine
::
value
(
const
scalar
t
)
const
Foam
::
scalar
Foam
::
Function1Types
::
halfCosine
Ramp
::
value
(
const
scalar
t
)
const
{
return
0
.
5
*
(
1
-
cos
(
constant
::
mathematical
::
pi
*
linearRamp
(
t
)));
}
...
...
src/OpenFOAM/primitives/functions/Function1/halfCosine/halfCosine.H
→
src/OpenFOAM/primitives/functions/Function1/halfCosine
Ramp
/halfCosine
Ramp
.H
View file @
98de2293
...
...
@@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::Function1Types::halfCosine
Foam::Function1Types::halfCosine
Ramp
Description
Half-cosine ramp function starting from 0 and increasing to 1 from \c start
...
...
@@ -32,12 +32,12 @@ See also
Foam::Function1Types::ramp
SourceFiles
halfCosine.C
halfCosine
Ramp
.C
\*---------------------------------------------------------------------------*/
#ifndef halfCosine_H
#define halfCosine_H
#ifndef halfCosine
Ramp
_H
#define halfCosine
Ramp
_H
#include
"ramp.H"
...
...
@@ -49,29 +49,29 @@ namespace Function1Types
{
/*---------------------------------------------------------------------------*\
Class halfCosine Declaration
Class halfCosine
Ramp
Declaration
\*---------------------------------------------------------------------------*/
class
halfCosine
class
halfCosine
Ramp
:
public
ramp
{
// Private Member Functions
//- Disallow default bitwise assignment
void
operator
=
(
const
halfCosine
&
);
void
operator
=
(
const
halfCosine
Ramp
&
);
public:
// Runtime type information
TypeName
(
"halfCosine"
);
TypeName
(
"halfCosine
Ramp
"
);
// Constructors
//- Construct from entry name and dictionary
halfCosine
halfCosine
Ramp
(
const
word
&
entryName
,
const
dictionary
&
dict
...
...
@@ -79,7 +79,7 @@ public:
//- Destructor
virtual
~
halfCosine
();
virtual
~
halfCosine
Ramp
();
// Member Functions
...
...
src/OpenFOAM/primitives/functions/Function1/linear/linear.C
→
src/OpenFOAM/primitives/functions/Function1/linear
Ramp
/linear
Ramp
.C
View file @
98de2293
...
...
@@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include
"linear.H"
#include
"linear
Ramp
.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
...
...
@@ -31,14 +31,14 @@ namespace Foam
{
namespace
Function1Types
{
makeScalarFunction1
(
linear
);
makeScalarFunction1
(
linear
Ramp
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
Function1Types
::
linear
::
linear
Foam
::
Function1Types
::
linear
Ramp
::
linear
Ramp
(
const
word
&
entryName
,
const
dictionary
&
dict
...
...
@@ -50,15 +50,15 @@ Foam::Function1Types::linear::linear
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam
::
Function1Types
::
linear
::~
linear
()
Foam
::
Function1Types
::
linear
Ramp
::~
linear
Ramp
()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam
::
scalar
Foam
::
Function1Types
::
linear
::
value
(
const
scalar
t
)
const
Foam
::
scalar
Foam
::
Function1Types
::
linear
Ramp
::
value
(
const
scalar
t
)
const
{
return
linearRamp
(
t
);
return
ramp
::
linearRamp
(
t
);
}
...
...
src/OpenFOAM/primitives/functions/Function1/linear/linear.H
→
src/OpenFOAM/primitives/functions/Function1/linear
Ramp
/linear
Ramp
.H
View file @
98de2293
...
...
@@ -22,22 +22,22 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::Function1Types::linear
Foam::Function1Types::linear
Ramp
Description
Linear ramp function starting from 0 and increasing linearly to 1 from
\c
start over the \c duration and remaining at 1 thereafter.
Linear ramp function starting from 0 and increasing linear
Ramp
ly to 1 from
\c
start over the \c duration and remaining at 1 thereafter.
See also
Foam::Function1Types::ramp
SourceFiles
linear.C
linear
Ramp
.C
\*---------------------------------------------------------------------------*/
#ifndef linear_H
#define linear_H
#ifndef linear
Ramp
_H
#define linear
Ramp
_H
#include
"ramp.H"
...
...
@@ -49,29 +49,29 @@ namespace Function1Types
{
/*---------------------------------------------------------------------------*\
Class linear Declaration
Class linear
Ramp
Declaration
\*---------------------------------------------------------------------------*/
class
linear
class
linear
Ramp
:
public
ramp
{
// Private Member Functions
//- Disallow default bitwise assignment
void
operator
=
(
const
linear
&
);
void
operator
=
(
const
linear
Ramp
&
);
public:
// Runtime type information
TypeName
(
"linear"
);
TypeName
(
"linear
Ramp
"
);
// Constructors
//- Construct from entry name and dictionary
linear
linear
Ramp
(
const
word
&
entryName
,
const
dictionary
&
dict
...
...
@@ -79,7 +79,7 @@ public:
//- Destructor
virtual
~
linear
();
virtual
~
linear
Ramp
();
// Member Functions
...
...
src/OpenFOAM/primitives/functions/Function1/quadratic/quadratic.C
→
src/OpenFOAM/primitives/functions/Function1/quadratic
Ramp
/quadratic
Ramp
.C
View file @
98de2293
...
...
@@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include
"quadratic.H"
#include
"quadratic
Ramp
.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
...
...
@@ -31,14 +31,14 @@ namespace Foam
{
namespace
Function1Types
{
makeScalarFunction1
(
quadratic
);
makeScalarFunction1
(
quadratic
Ramp
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
Function1Types
::
quadratic
::
quadratic
Foam
::
Function1Types
::
quadratic
Ramp
::
quadratic
Ramp
(
const
word
&
entryName
,
const
dictionary
&
dict
...
...
@@ -50,13 +50,13 @@ Foam::Function1Types::quadratic::quadratic
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam
::
Function1Types
::
quadratic
::~
quadratic
()
Foam
::
Function1Types
::
quadratic
Ramp
::~
quadratic
Ramp
()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam
::
scalar
Foam
::
Function1Types
::
quadratic
::
value
(
const
scalar
t
)
const
Foam
::
scalar
Foam
::
Function1Types
::
quadratic
Ramp
::
value
(
const
scalar
t
)
const
{
return
sqr
(
linearRamp
(
t
));
}
...
...
src/OpenFOAM/primitives/functions/Function1/quadratic/quadratic.H
→
src/OpenFOAM/primitives/functions/Function1/quadratic
Ramp
/quadratic
Ramp
.H
View file @
98de2293
...
...
@@ -22,22 +22,22 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::Function1Types::quadratic
Foam::Function1Types::quadratic
Ramp
Description
Quadratic ramp function starting from 0 and increasing quadratically
to 1
from \c t_0 over the \c duration and remaining at 1 thereafter.
Quadratic ramp function starting from 0 and increasing quadratic
Ramp
ally
to 1
from \c t_0 over the \c duration and remaining at 1 thereafter.
See also
Foam::Function1Types::ramp
SourceFiles
quadratic.C
quadratic
Ramp
.C
\*---------------------------------------------------------------------------*/
#ifndef quadratic_H
#define quadratic_H
#ifndef quadratic
Ramp
_H
#define quadratic
Ramp
_H
#include
"ramp.H"
...
...
@@ -49,29 +49,29 @@ namespace Function1Types
{
/*---------------------------------------------------------------------------*\
Class quadratic Declaration
Class quadratic
Ramp
Declaration
\*---------------------------------------------------------------------------*/
class
quadratic
class
quadratic
Ramp
:
public
ramp
{
// Private Member Functions
//- Disallow default bitwise assignment
void
operator
=
(
const
quadratic
&
);
void
operator
=
(
const
quadratic
Ramp
&
);
public:
// Runtime type information
TypeName
(
"quadratic"
);
TypeName
(
"quadratic
Ramp
"
);
// Constructors
//- Construct from entry name and dictionary
quadratic
quadratic
Ramp
(
const
word
&
entryName
,
const
dictionary
&
dict
...
...
@@ -79,7 +79,7 @@ public:
//- Destructor
virtual
~
quadratic
();
virtual
~
quadratic
Ramp
();
// Member Functions
...
...
src/OpenFOAM/primitives/functions/Function1/quarterCosine/quarterCosine.C
→
src/OpenFOAM/primitives/functions/Function1/quarterCosine
Ramp
/quarterCosine
Ramp
.C
View file @
98de2293
...
...
@@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include
"quarterCosine.H"
#include
"quarterCosine
Ramp
.H"
#include
"mathematicalConstants.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
...
...
@@ -32,14 +32,14 @@ namespace Foam
{
namespace
Function1Types
{
makeScalarFunction1
(
quarterCosine
);
makeScalarFunction1
(
quarterCosine
Ramp
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
Function1Types
::
quarterCosine
::
quarterCosine
Foam
::
Function1Types
::
quarterCosine
Ramp
::
quarterCosine
Ramp
(
const
word
&
entryName
,
const
dictionary
&
dict
...
...
@@ -51,13 +51,16 @@ Foam::Function1Types::quarterCosine::quarterCosine
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam
::
Function1Types
::
quarterCosine
::~
quarterCosine
()
Foam
::
Function1Types
::
quarterCosine
Ramp
::~
quarterCosine
Ramp
()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam
::
scalar
Foam
::
Function1Types
::
quarterCosine
::
value
(
const
scalar
t
)
const
Foam
::
scalar
Foam
::
Function1Types
::
quarterCosineRamp
::
value
(
const
scalar
t
)
const
{
return
1
-
cos
(
0
.
5
*
constant
::
mathematical
::
pi
*
linearRamp
(
t
));
}
...
...
src/OpenFOAM/primitives/functions/Function1/quarterCosine/quarterCosine.H
→
src/OpenFOAM/primitives/functions/Function1/quarterCosine
Ramp
/quarterCosine
Ramp
.H
View file @
98de2293
...
...
@@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::Function1Types::quarterCosine
Foam::Function1Types::quarterCosine
Ramp
Description
Quarter-cosine ramp function starting from 0 and increasing to 1 from \c
...
...
@@ -32,12 +32,12 @@ See also
Foam::Function1Types::ramp
SourceFiles
quarterCosine.C
quarterCosine
Ramp
.C
\*---------------------------------------------------------------------------*/
#ifndef quarterCosine_H
#define quarterCosine_H
#ifndef quarterCosine
Ramp
_H
#define quarterCosine
Ramp
_H
#include
"ramp.H"
...
...
@@ -49,29 +49,29 @@ namespace Function1Types
{
/*---------------------------------------------------------------------------*\
Class quarterCosine Declaration
Class quarterCosine
Ramp
Declaration
\*---------------------------------------------------------------------------*/
class
quarterCosine
class
quarterCosine
Ramp
:
public
ramp
{
// Private Member Functions
//- Disallow default bitwise assignment
void
operator
=
(
const
quarterCosine
&
);
void
operator
=
(
const
quarterCosine
Ramp
&
);
public:
// Runtime type information
TypeName
(
"quarterCosine"
);
TypeName
(
"quarterCosine
Ramp
"
);
// Constructors
//- Construct from entry name and dictionary
quarterCosine
quarterCosine
Ramp
(
const
word
&
entryName
,
const
dictionary
&
dict
...
...
@@ -79,7 +79,7 @@ public:
//- Destructor
virtual
~
quarterCosine
();
virtual
~
quarterCosine
Ramp
();
// Member Functions
...
...
src/OpenFOAM/primitives/functions/Function1/quarterSine/quarterSine.C
→
src/OpenFOAM/primitives/functions/Function1/quarterSine
Ramp
/quarterSine
Ramp
.C
View file @
98de2293
...
...
@@ -23,7 +23,7 @@ License
\*---------------------------------------------------------------------------*/
#include
"quarterSine.H"
#include
"quarterSine
Ramp
.H"
#include
"mathematicalConstants.H"
// * * * * * * * * * * * * * * Static Data Members * * * * * * * * * * * * * //
...
...
@@ -32,14 +32,14 @@ namespace Foam
{
namespace
Function1Types
{
makeScalarFunction1
(
quarterSine
);
makeScalarFunction1
(
quarterSine
Ramp
);
}
}
// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
Foam
::
Function1Types
::
quarterSine
::
quarterSine
Foam
::
Function1Types
::
quarterSine
Ramp
::
quarterSine
Ramp
(
const
word
&
entryName
,
const
dictionary
&
dict
...
...
@@ -51,13 +51,13 @@ Foam::Function1Types::quarterSine::quarterSine
// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
Foam
::
Function1Types
::
quarterSine
::~
quarterSine
()
Foam
::
Function1Types
::
quarterSine
Ramp
::~
quarterSine
Ramp
()
{}
// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
Foam
::
scalar
Foam
::
Function1Types
::
quarterSine
::
value
(
const
scalar
t
)
const
Foam
::
scalar
Foam
::
Function1Types
::
quarterSine
Ramp
::
value
(
const
scalar
t
)
const
{
return
sin
(
0
.
5
*
constant
::
mathematical
::
pi
*
linearRamp
(
t
));
}
...
...
src/OpenFOAM/primitives/functions/Function1/quarterSine/quarterSine.H
→
src/OpenFOAM/primitives/functions/Function1/quarterSine
Ramp
/quarterSine
Ramp
.H
View file @
98de2293
...
...
@@ -22,7 +22,7 @@ License
along with OpenFOAM. If not, see <http://www.gnu.org/licenses/>.
Class
Foam::Function1Types::quarterSine
Foam::Function1Types::quarterSine
Ramp
Description
Quarter-sine ramp function starting from 0 and increasing to 1 from \c start
...
...
@@ -32,12 +32,12 @@ See also
Foam::Function1Types::ramp
SourceFiles
quarterSine.C
quarterSine
Ramp
.C
\*---------------------------------------------------------------------------*/
#ifndef quarterSine_H
#define quarterSine_H
#ifndef quarterSine
Ramp
_H
#define quarterSine
Ramp
_H
#include
"ramp.H"
...
...
@@ -49,29 +49,29 @@ namespace Function1Types
{
/*---------------------------------------------------------------------------*\
Class quarterSine Declaration
Class quarterSine
Ramp
Declaration
\*---------------------------------------------------------------------------*/
class
quarterSine
class
quarterSine
Ramp
:
public
ramp
{
// Private Member Functions
//- Disallow default bitwise assignment
void
operator
=
(
const
quarterSine
&
);
void
operator
=
(
const
quarterSine
Ramp
&
);
public:
// Runtime type information
TypeName
(
"quarterSine"
);
TypeName
(
"quarterSine
Ramp
"
);
// Constructors
//- Construct from entry name and dictionary
quarterSine
quarterSine
Ramp
(
const
word
&
entryName
,
const
dictionary
&
dict
...
...
@@ -79,7 +79,7 @@ public:
//- Destructor
virtual
~
quarterSine
();
virtual
~
quarterSine
Ramp
();
// Member Functions
...
...
tutorials/multiphase/potentialFreeSurfaceFoam/oscillatingBox/0.orig/U
View file @
98de2293
...
...
@@ -41,18 +41,27 @@ boundaryField
normalVelocity
{
type uniformFixedValue;
uniformValue sine;
uniformValue
Coeffs
uniformValue
{
frequency 1;
amplitude table
(
( 0 0)
( 10 0.025)
(1000 0.025)
);
scale (0 1 0);
level (0 0 0);
type scale;
value
{
type sine;
frequency 1;
amplitude 0.025;
scale (0 1 0);
level (0 0 0);
}
scale
{
type linearRamp;