function1Properties 2.76 KB
Newer Older
shunbo's avatar
shunbo committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2112                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "constant";
    object      function1Properties;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

// The 'x' values for evaluation
x
(
    0
    0.25
    0.5
    0.75
    1
);


constant1 constant 100;

table1 table
(
    (0 0)(10 1)
);

table2
{
    type table;
    values
    (
        (0 0)(10 1)
    );
}

table3
{
    type table;
    file "<constant>/table-values";
}

poly1 polynomial
(
    (0 1)
    (1 1)
);

poly2
{
    type polynomial;
    coeffs
    (
        (0 1)
        (1 1)
    );
}

function2
{
    type        expression;
    expression  #{ sqr(arg()) #};
}

function2b expression;

function2bCoeffs
{
    type        expression;
    expression  #{ sqr(arg()) #};
}


stepf1
{
    type        step;
    start       0.24;
    duration    0.5;
}

rampf1
{
    type        linearRamp;
    start       0.24;
    duration    0.5;
}


sine1
{
    type        sine;
    frequency   0.1;
    scale       1;
    level       0;
}

sine2
{
    type        sine;
    period      10;
    scale       1;
    level       0;
}

cosine1
{
    type        cosine;
    period      10;
    scale       1;
    level       0;
}


sine6
{
    type        sine;
    period      6;
    t0          -1.5;  // want cos
    scale       1;
    level       0;
}


cosine6
{
    type        cosine;
    period      6;
    scale       1;
    level       0;
}


expr1
{
    type expression;

    functions<scalar>
    {
        func1 constant 21;
        func2 constant 15;
        sin   constant -5;
    }

    functions<vector>
    {
        vfunc3 constant (1 2 3);
        vfunc4 constant (3 2 1);
    }

    expression
    #{
        100 * fn:vfunc3() & fn:vfunc4() * (vector::z) .z()
      * (fn:sin(arg()) + fn:func1(fn:func2()))
    #};
}


expr2
{
    type expression;

    functions<scalar>
    {
        func1 constant 21;
        func2 constant 15;
        sin   constant -5;
    }

    functions<vector>
    {
        vfunc3 constant (1 2 3);
        vfunc4 constant (3 2 1);
    }

    expression
    #{
        (fn:vfunc3() & vector::z) * arg()
    #};
}


// ************************************************************************* //