View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003421 | OpenFOAM | Bug | public | 2020-01-06 03:27 | 2020-01-07 10:47 |
Reporter | SamMallinson | Assigned To | henry | ||
Priority | normal | Severity | minor | Reproducibility | always |
Status | closed | Resolution | no change required | ||
Platform | Linux | OS | Debian | OS Version | bullseye |
Summary | 0003421: Cannot #include parameters in system/forces | ||||
Description | To avoid errors associated with repeating oneself (see https://en.wikipedia.org/wiki/Don%27t_repeat_yourself), it is preferred to #include parameters from a single file across many OpenFOAM dictionaries. It appears, however, that this is not alway possible. In particular, if you try to #include a parameters file in system/forces, it does not recognize it and instead gives an error. For example, for the pimpleFoam tutorial propellor, if we have the following in a file system/parameters: density 1.0; CRx 0; CRy 0; CRz 0; and we #include "./system/parameters" in system/forces: #include "./system/parameters" forces { type forces; libs ("libforces.so"); writeControl timeStep; timeInterval 1; log yes; patches ("propeller.*"); rho rhoInf; // Indicates incompressible log true; rhoInf $density; // Redundant for incompressible CofR ($CRx $CRy $CRz); // Rotation around centre line of propeller pitchAxis (0 1 0); } then we get an error: .... Reading surface description: zNormal isoQ propeller --> FOAM Warning : From function bool Foam::functionObjectList::read() in file db/functionObjects/functionObjectList/functionObjectList.C at line 682 Reading "/mnt/simulations/sam/propeller/system/controlDict" from line 18 to line 28 Entry density is not a dictionary --> FOAM Warning : From function bool Foam::functionObjectList::read() in file db/functionObjects/functionObjectList/functionObjectList.C at line 682 Reading "/mnt/simulations/sam/propeller/system/controlDict" from line 18 to line 28 Entry CRx is not a dictionary --> FOAM Warning : From function bool Foam::functionObjectList::read() in file db/functionObjects/functionObjectList/functionObjectList.C at line 682 Reading "/mnt/simulations/sam/propeller/system/controlDict" from line 18 to line 28 Entry CRy is not a dictionary --> FOAM Warning : From function bool Foam::functionObjectList::read() in file db/functionObjects/functionObjectList/functionObjectList.C at line 682 Reading "/mnt/simulations/sam/propeller/system/controlDict" from line 18 to line 28 Entry CRz is not a dictionary forces forces: Not including porosity effects Starting time loop .... | ||||
Steps To Reproduce | 1. copy tutorial to separate directory 2. add file system/parameters 3. modify system/forces 4. ./Allrun | ||||
Tags | No tags attached. | ||||
|
adding files system/parameters (new) and system/forces (modified) forces (952 bytes)
/*--------------------------------*- C++ -*----------------------------------*\ ========= | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox \\ / O peration | Website: https://openfoam.org \\ / A nd | Version: 7 \\/ M anipulation | \*---------------------------------------------------------------------------*/ #include "./system/parameters" forces { type forces; libs ("libforces.so"); writeControl timeStep; timeInterval 1; log yes; patches ("propeller.*"); rho rhoInf; // Indicates incompressible log true; rhoInf $density; // Redundant for incompressible CofR ($CRx $CRy $CRz); // Rotation around centre line of propeller pitchAxis (0 1 0); } // ************************************************************************* // |
|
forces { #include "./system/parameters" . . . |
|
I can confirm that works - many thanks! |
|
User error |
Date Modified | Username | Field | Change |
---|---|---|---|
2020-01-06 03:27 | SamMallinson | New Issue | |
2020-01-06 03:28 | SamMallinson | File Added: parameters | |
2020-01-06 03:28 | SamMallinson | File Added: forces | |
2020-01-06 03:28 | SamMallinson | Note Added: 0011038 | |
2020-01-06 09:22 | henry | Note Added: 0011039 | |
2020-01-06 23:09 | SamMallinson | Note Added: 0011040 | |
2020-01-07 10:47 | henry | Assigned To | => henry |
2020-01-07 10:47 | henry | Status | new => closed |
2020-01-07 10:47 | henry | Resolution | open => no change required |
2020-01-07 10:47 | henry | Note Added: 0011042 |