View Issue Details

IDProjectCategoryView StatusLast Update
0004218OpenFOAMBugpublic2025-03-05 11:04
Reporterblocksgearing0d Assigned Tohenry  
PrioritylowSeveritytextReproducibilityalways
Status closedResolutionno change required 
PlatformGNU/LinuxOSRHELOS Version9.4
Product Versiondev 
Summary0004218: Outdated codeStream Example Leading to a Segmentation Fault
DescriptionThe example provided in codeStream.H for setting a non-uniform internal field ( https://github.com/OpenFOAM/OpenFOAM-dev/blob/master/src/OpenFOAM/db/dictionary/functionEntries/codeStream/codeStream.H#L63-L84 ) consistently results in a segmentation fault.
Steps To Reproduce1. Generate a mesh in a tutorial case.
2. Copy and paste the example code from codeStream.H as the internalField value in any scalarField boundary condition in the 0/ directory.
3. Expand the field using the following command:
$ foamDictionary -expand 0/<scalarField>
Additional InformationThe example provided in codeStream.H was valuable and convenient for various applications, such as:
1. Setting up Gaussian profile initial conditions.
2. Defining initial turbulent fluctuations or
3. Other non-uniform field initialisations required for advanced simulations, e.g. void-fraction distributions.
TagsNo tags attached.

Activities

henry

2025-03-04 09:28

manager   ~0013534

I tried it to set alpha.water in the damBreak case and it worked correctly, no problems at all.

However foamDictionary cannot expand the that particular codeStream entry because the file is read and processed as a pure dictionary not a field, foamDictionary does not have an fvMesh.

Issue History

Date Modified Username Field Change
2025-03-03 23:06 blocksgearing0d New Issue
2025-03-04 09:28 henry Note Added: 0013534
2025-03-05 11:04 henry Assigned To => henry
2025-03-05 11:04 henry Status new => closed
2025-03-05 11:04 henry Resolution open => no change required