File tree 2 files changed +64
-11
lines changed
etc/caseDicts/functions/fields
2 files changed +64
-11
lines changed Original file line number Diff line number Diff line change 2
2
========= |
3
3
\\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
4
\\ / O peration | Website: https://openfoam.org
5
- \\ / A nd | Version: dev
5
+ \\ / A nd | Version: dev (20241102)
6
6
\\/ M anipulation |
7
+ -------------------------------------------------------------------------------
8
+ Description
9
+ Caches and writes Mach number based on compressibility
10
+
7
11
\*---------------------------------------------------------------------------*/
8
12
9
13
type coded;
14
+ libs ( " libutilityFunctionObjects.so" );
10
15
11
- libs (" libutilityFunctionObjects.so" );
16
+ executeControl writeTime;
17
+ writeControl writeTime;
12
18
13
- name compressibilityMachNo;
19
+ codeFields
20
+ #{
21
+ fields.append (" psi" );
22
+ fields.append (" U" );
23
+ #};
14
24
15
- writeControl writeTime;
25
+ codeExecute
26
+ #{
27
+ const volScalarField& psi = mesh ().lookupObject <volScalarField>(" psi" );
28
+ const volVectorField& U = mesh ().lookupObject <volVectorField>(" UMean" );
29
+
30
+ store (" Ma" , mag (U)*sqrt (psi));
31
+ #};
16
32
17
33
codeWrite
18
34
#{
19
- const volVectorField& U (mesh ().lookupObject <volVectorField>(" U" ));
20
- const volScalarField& psi (mesh ().lookupObject <volScalarField>(" psi" ));
21
-
22
- volScalarField::New (
23
- " Ma" ,
24
- mag (U) * sqrt (psi)
25
- )->write ();
35
+ return writeObject (" Ma" );
26
36
#};
27
37
28
38
// ************************************************************************* //
Original file line number Diff line number Diff line change
1
+ /* --------------------------------*- C++ -*----------------------------------*\
2
+ ========= |
3
+ \\ / F ield | OpenFOAM: The Open Source CFD Toolbox
4
+ \\ / O peration | Website: https://openfoam.org
5
+ \\ / A nd | Version: dev (20241102)
6
+ \\/ M anipulation |
7
+ -------------------------------------------------------------------------------
8
+ Description
9
+ Caches and writes mass flux
10
+
11
+ \*---------------------------------------------------------------------------*/
12
+
13
+ type coded;
14
+ libs ( " libutilityFunctionObjects.so" );
15
+
16
+ executeControl writeTime;
17
+ writeControl writeTime;
18
+
19
+ codeInclude
20
+ #{
21
+ #include " fvcFlux.H"
22
+ #};
23
+
24
+ codeFields
25
+ #{
26
+ fields.append (" rho" );
27
+ fields.append (" U" );
28
+ #};
29
+
30
+ codeExecute
31
+ #{
32
+ const volScalarField& rho = mesh ().lookupObject <volScalarField>(" rho" );
33
+ const volVectorField& U = mesh ().lookupObject <volVectorField>(" U" );
34
+
35
+ store (" varphi" , linearInterpolate (rho*U) & mesh ().Sf ());
36
+ #};
37
+
38
+ codeWrite
39
+ #{
40
+ return writeObject (" varphi" );
41
+ #};
42
+
43
+ // ************************************************************************* //
You can’t perform that action at this time.
0 commit comments