diff --git a/src/OpenFOAM/primitives/functions/DataEntry/Sine/Sine.C b/src/OpenFOAM/primitives/functions/DataEntry/Sine/Sine.C
new file mode 100644
index 000000000..8bedc6324
--- /dev/null
+++ b/src/OpenFOAM/primitives/functions/DataEntry/Sine/Sine.C
@@ -0,0 +1,102 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "Sine.H"
+#include "mathematicalConstants.H"
+
+// * * * * * * * * * * * * * * * * Constructors * * * * * * * * * * * * * * //
+
+template
+void Foam::DataEntryTypes::Sine::read(const dictionary& coeffs)
+{
+ t0_ = coeffs.lookupOrDefault("t0", 0);
+ amplitude_ = coeffs.lookupOrDefault("amplitude", 1);
+ frequency_ = readScalar(coeffs.lookup("frequency"));
+ scale_ = pTraits(coeffs.lookup("scale"));
+ level_ = pTraits(coeffs.lookup("level"));
+}
+
+
+template
+Foam::DataEntryTypes::Sine::Sine
+(
+ const word& entryName,
+ const dictionary& dict,
+ const word& ext
+)
+:
+ DataEntry(entryName)
+{
+ read(dict.subDict(entryName + ext));
+}
+
+
+template
+Foam::DataEntryTypes::Sine::Sine(const Sine& se)
+:
+ DataEntry(se),
+ t0_(se.t0_),
+ amplitude_(se.amplitude_),
+ frequency_(se.frequency_),
+ level_(se.level_)
+{}
+
+
+// * * * * * * * * * * * * * * * * Destructor * * * * * * * * * * * * * * * //
+
+template
+Foam::DataEntryTypes::Sine::~Sine()
+{}
+
+
+// * * * * * * * * * * * * * * * Member Functions * * * * * * * * * * * * * //
+
+template
+Type Foam::DataEntryTypes::Sine::value(const scalar t) const
+{
+ return
+ amplitude_*sin(constant::mathematical::twoPi*frequency_*(t - t0_))
+ *scale_
+ + level_;
+}
+
+
+template
+Type Foam::DataEntryTypes::Sine::integrate
+(
+ const scalar t1,
+ const scalar t2
+) const
+{
+ NotImplemented;
+ return level_;
+}
+
+
+// * * * * * * * * * * * * * * IOStream operators * * * * * * * * * * * * * //
+
+#include "SineIO.C"
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/primitives/functions/DataEntry/Sine/Sine.H b/src/OpenFOAM/primitives/functions/DataEntry/Sine/Sine.H
new file mode 100644
index 000000000..fb0826881
--- /dev/null
+++ b/src/OpenFOAM/primitives/functions/DataEntry/Sine/Sine.H
@@ -0,0 +1,200 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+Class
+ Foam::DataEntryTypes::Sine
+
+Description
+ Templated sine function with support for an offset level.
+
+ \f[
+ a sin(2 \pi f (t - t_0)) s + l
+ \f]
+
+ where
+
+ \vartable
+ a | Amplitude
+ f | Frequency [1/s]
+ s | Type scale factor
+ l | Type offset level
+ t_0 | Start time [s]
+ t | Time [s]
+ \endvartable
+
+ Example for a scalar:
+ \verbatim
+ sine;
+ Coeffs
+ {
+ frequency 10;
+ amplitude 0.1;
+ scale 2e-6;
+ level 2e-6;
+ }
+ \endverbatim
+
+ Example for a vector:
+ \verbatim
+ sine;
+ Coeffs
+ {
+ frequency 10;
+ amplitude 1;
+ scale (1 0.1 0);
+ level (10 1 0);
+ }
+ \endverbatim
+
+SourceFiles
+ Sine.C
+
+\*---------------------------------------------------------------------------*/
+
+#ifndef Sine_H
+#define Sine_H
+
+#include "DataEntry.H"
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+namespace Foam
+{
+
+// Forward declaration of friend functions and operators
+namespace DataEntryTypes
+{
+ template class Sine;
+};
+
+template
+Ostream& operator<<(Ostream&, const DataEntryTypes::Sine&);
+
+namespace DataEntryTypes
+{
+
+/*---------------------------------------------------------------------------*\
+ Class Sine Declaration
+\*---------------------------------------------------------------------------*/
+
+template
+class Sine
+:
+ public DataEntry
+{
+ // Private data
+
+ //- Start-time for the sin function
+ scalar t0_;
+
+ //- Scalar amplitude of the sin function
+ scalar amplitude_;
+
+ //- Frequency of the sin function
+ scalar frequency_;
+
+ //- Scaling factor of the sin function
+ Type scale_;
+
+ //- Level to which the sin function is added
+ Type level_;
+
+
+ // Private Member Functions
+
+ //- Read the coefficients from the given dictionary
+ void read(const dictionary& coeffs);
+
+ //- Disallow default bitwise assignment
+ void operator===(const Sine&);
+
+
+public:
+
+ // Runtime type information
+ TypeName("sine");
+
+
+ // Constructors
+
+ //- Construct from entry name and dictionary
+ Sine
+ (
+ const word& entryName,
+ const dictionary& dict,
+ const word& ext = "Coeffs"
+ );
+
+ //- Copy constructor
+ Sine(const Sine& se);
+
+ //- Construct and return a clone
+ virtual tmp> clone() const
+ {
+ return tmp>(new Sine(*this));
+ }
+
+
+ //- Destructor
+ virtual ~Sine();
+
+
+ // Member Functions
+
+ //- Return value for time t
+ Type value(const scalar t) const;
+
+ //- Integrate between the two time values t1 and t2
+ Type integrate(const scalar t1, const scalar t2) const;
+
+
+ // I/O
+
+ //- Ostream Operator
+ friend Ostream& operator<<
+ (
+ Ostream& os,
+ const Sine& cnst
+ );
+
+ //- Write in dictionary format
+ virtual void writeData(Ostream& os) const;
+};
+
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+} // End namespace DataEntryTypes
+} // End namespace Foam
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#ifdef NoRepository
+# include "Sine.C"
+#endif
+
+// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
+
+#endif
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/primitives/functions/DataEntry/Sine/SineIO.C b/src/OpenFOAM/primitives/functions/DataEntry/Sine/SineIO.C
new file mode 100644
index 000000000..afbaba8de
--- /dev/null
+++ b/src/OpenFOAM/primitives/functions/DataEntry/Sine/SineIO.C
@@ -0,0 +1,70 @@
+/*---------------------------------------------------------------------------*\
+ ========= |
+ \\ / 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 .
+
+\*---------------------------------------------------------------------------*/
+
+#include "Sine.H"
+
+// * * * * * * * * * * * * * * * IOstream Operators * * * * * * * * * * * * //
+
+template
+Foam::Ostream& Foam::operator<<
+(
+ Ostream& os,
+ const DataEntryTypes::Sine& se
+)
+{
+ os << static_cast& >(se)
+ << token::SPACE << se.t0_
+ << token::SPACE << se.amplitude_
+ << token::SPACE << se.frequency_
+ << token::SPACE << se.scale_
+ << token::SPACE << se.level_;
+
+ // Check state of Ostream
+ os.check
+ (
+ "Ostream& operator<<(Ostream&, const Sine&)"
+ );
+
+ return os;
+}
+
+
+template
+void Foam::DataEntryTypes::Sine::writeData(Ostream& os) const
+{
+ DataEntry::writeData(os);
+ os << token::END_STATEMENT << nl;
+ os << indent << word(this->name() + "Coeffs") << nl;
+ os << indent << token::BEGIN_BLOCK << incrIndent << nl;
+ os.writeKeyword("t0") << t0_ << token::END_STATEMENT << nl;
+ os.writeKeyword("amplitude") << amplitude_ << token::END_STATEMENT << nl;
+ os.writeKeyword("frequency") << frequency_ << token::END_STATEMENT << nl;
+ os.writeKeyword("scale") << scale_ << token::END_STATEMENT << nl;
+ os.writeKeyword("level") << level_ << token::END_STATEMENT << nl;
+ os << decrIndent << indent << token::END_BLOCK << endl;
+}
+
+
+// ************************************************************************* //
diff --git a/src/OpenFOAM/primitives/functions/DataEntry/makeDataEntries.C b/src/OpenFOAM/primitives/functions/DataEntry/makeDataEntries.C
index 06ce41633..db8f3f749 100644
--- a/src/OpenFOAM/primitives/functions/DataEntry/makeDataEntries.C
+++ b/src/OpenFOAM/primitives/functions/DataEntry/makeDataEntries.C
@@ -25,6 +25,7 @@ License
#include "Constant.H"
#include "PolynomialEntry.H"
+#include "Sine.H"
#include "CSV.H"
#include "Table.H"
#include "TableFile.H"
@@ -40,17 +41,13 @@ namespace Foam
{
makeDataEntry(label);
makeDataEntryType(Constant, label);
-
// Polynomial functions and interpolation do evaluate to label
// Instead evaluate a scalar and convert to label as appropriate
- // makeDataEntryType(Polynomial, label);
- // makeDataEntryType(CSV, label);
- // makeDataEntryType(Table, label);
- // makeDataEntryType(TableFile, label);
makeDataEntry(scalar);
makeDataEntryType(Constant, scalar);
makeDataEntryType(Polynomial, scalar);
+ makeDataEntryType(Sine, scalar);
makeDataEntryType(CSV, scalar);
makeDataEntryType(Table, scalar);
makeDataEntryType(TableFile, scalar);
@@ -58,6 +55,7 @@ namespace Foam
makeDataEntry(vector);
makeDataEntryType(Constant, vector);
makeDataEntryType(Polynomial, vector);
+ makeDataEntryType(Sine, vector);
makeDataEntryType(CSV, vector);
makeDataEntryType(Table, vector);
makeDataEntryType(TableFile, vector);
@@ -65,6 +63,7 @@ namespace Foam
makeDataEntry(sphericalTensor);
makeDataEntryType(Constant, sphericalTensor);
makeDataEntryType(Polynomial, sphericalTensor);
+ makeDataEntryType(Sine, sphericalTensor);
makeDataEntryType(CSV, sphericalTensor);
makeDataEntryType(Table, sphericalTensor);
makeDataEntryType(TableFile, sphericalTensor);
@@ -72,6 +71,7 @@ namespace Foam
makeDataEntry(symmTensor);
makeDataEntryType(Constant, symmTensor);
makeDataEntryType(Polynomial, symmTensor);
+ makeDataEntryType(Sine, symmTensor);
makeDataEntryType(CSV, symmTensor);
makeDataEntryType(Table, symmTensor);
makeDataEntryType(TableFile, symmTensor);
@@ -79,6 +79,7 @@ namespace Foam
makeDataEntry(tensor);
makeDataEntryType(Constant, tensor);
makeDataEntryType(Polynomial, tensor);
+ makeDataEntryType(Sine, tensor);
makeDataEntryType(CSV, tensor);
makeDataEntryType(Table, tensor);
makeDataEntryType(TableFile, tensor);