View Issue Details
ID | Project | Category | View Status | Date Submitted | Last Update |
---|---|---|---|---|---|
0003623 | OpenFOAM | Feature | public | 2021-02-05 03:09 | 2021-02-09 09:59 |
Reporter | jp | Assigned To | henry | ||
Priority | low | Severity | feature | Reproducibility | always |
Status | closed | Resolution | unable to reproduce | ||
Platform | GNU/Linux | OS | Ubuntu | OS Version | 20.04 |
Summary | 0003623: Scale factor for surface field without additional operation | ||||
Description | A surfaceFieldValue can be used to compute fluxes of fields through a patch. Special operations can be performed on the patch: sum, average, max, areaIntegrate and "none", among others. An optional additional parameter may be provided to scale the result, for example, to change units or account for different depth in a 2D model. If an operation, like "sum" is performed, the user can apply a scaleFactor on the result. If the operation "none" is selected, no scaling is applied by the software (which sounds reasonable). However, the user may only be interested in scaling the result (without performing any kind of reduction like max, sum, etc.). A reasonable workaround would be to include a dummy operation "scale", that would allow for the scaling operation without any additional reduction operation. The scaling operation is guarded by: if (operation_ != operationType::none) | ||||
Steps To Reproduce | Add the following to the control dict, scales the result: movingWallPatch { type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); log true; writeControl writeTime; writeFields true; regionType patch; name movingWall; operation areaAverage; scaleFactor 2; fields ( p phi U ); } but this does not: movingWallPatch { type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); log true; writeControl writeTime; writeFields true; regionType patch; name movingWall; operation none; scaleFactor 2; fields ( p phi U ); } | ||||
Additional Information | Add a new "scale" or "scaleOnly" operation on line 226 of surfaceFieldValue.H. In this way, no additional operation will be performed on the switch of processSameTypeValues() in surfaceFieldValueTemplates.C for this case, but as (operation_ != operationType::none) in line 366 of surfaceFieldValueTemplates.C, the operation: values *= scaleFactor_; will be executed. | ||||
Tags | No tags attached. | ||||
|
What's the point of enabling the execution of `values *= scaleFactor_;` if the values aren't then going to be used to generate a result? |
|
Have you tested your proposal? |
|
With operation none; scaleFactor 2; what "values" is scaleFactor applied to, i.e. in the statement values *= scaleFactor_; what are the values? |
|
Perhaps what I'm doing is not the most efficient way, and definitely not the best example... sorry for that! The idea was to export the scaled data on the patch: example { type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); name outlet; fields (phi); writeFields true; regionType patch; operation none; scaleFactor 1000; surfaceFormat raw; } I get the same result with: example { type surfaceFieldValue; libs ("libfieldFunctionObjects.so"); name outlet; fields (phi); writeFields true; regionType patch; operation none; surfaceFormat raw; } I may also want to export the results in vtk instead of raw format... Although no condensation operation takes place, it may still be useful to be able to scale the result... |
|
Have you tested your proposal? |
|
The proposed change does not appear to work as the reporter intended and insufficient information provided. |
Date Modified | Username | Field | Change |
---|---|---|---|
2021-02-05 03:09 | jp | New Issue | |
2021-02-05 13:41 | will | Note Added: 0011864 | |
2021-02-05 13:45 | henry | Note Added: 0011865 | |
2021-02-05 13:47 | henry | Note Added: 0011866 | |
2021-02-06 04:38 | jp | Note Added: 0011867 | |
2021-02-06 08:22 | henry | Note Added: 0011868 | |
2021-02-09 09:59 | henry | Assigned To | => henry |
2021-02-09 09:59 | henry | Status | new => closed |
2021-02-09 09:59 | henry | Resolution | open => unable to reproduce |
2021-02-09 09:59 | henry | Note Added: 0011871 |