DimensionedFunction1: Function1 with dimensions

This can be used identically to a standard Function1. In addition, it
also permits specification of the dimensions. This allows the dimensions
to be checked. It also permits unit conversions. For example:

    <name>
    {
        type        table;

        // Dimensions
        xDimensions [CAD];  // Optional. Argument dimensions/units.
                            // Here, this specifies coordinates are in
                            // crank angle degrees (available if using
                            // engine time).
        dimensions  [mm];   // Optional. Value dimensions/units.
                            // Here, values are in mm.

        // Tablulated data
        values
        (
            (0 0)
            (60 12)         // <-- i.e., 12 mm at 60 degrees
            (180 20)
            (240 8)
            (360 0)
        );
        outOfBounds repeat;
    }

This replaces TimeFunction1, as it allows per-function control over
whether the function is considered to be one of real-time or user-time.
This commit is contained in:
Will Bainbridge
2023-07-27 15:48:23 +01:00
parent 3a52ee2ac5
commit bf044f5c47
89 changed files with 1514 additions and 1018 deletions

View File

@ -2,7 +2,7 @@
========= |
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
\\ / O peration | Website: https://openfoam.org
\\ / A nd | Copyright (C) 2011-2022 OpenFOAM Foundation
\\ / A nd | Copyright (C) 2011-2023 OpenFOAM Foundation
\\/ M anipulation |
-------------------------------------------------------------------------------
License
@ -129,8 +129,11 @@ class Table
//- Interpolation scheme
const word interpolationScheme_;
//- Table reader
const autoPtr<TableReader<Type>> reader_;
//- Table data
List<Tuple2<scalar, Type>> values_;
const List<Tuple2<scalar, Type>> values_;
//- Extracted values
mutable autoPtr<scalarField> tableSamplesPtr_;
@ -144,9 +147,6 @@ class Table
//- Cached weights
mutable scalarField weights_;
//- Table reader
const autoPtr<TableReader<Type>> reader_;
// Private Member Functions
@ -183,6 +183,9 @@ public:
//- Construct from name and dictionary
Table(const word& name, const dictionary& dict);
//- Construct from name and Istream
Table(const word& name, Istream& dict);
//- Copy constructor
Table(const Table<Type>& tbl);
@ -205,12 +208,6 @@ public:
return interpolationScheme_;
}
//- Return the reader
const autoPtr<TableReader<Type>>& reader() const
{
return reader_;
}
//- Return table data
const List<Tuple2<scalar, Type>>& values() const
{