View Issue Details

IDProjectCategoryView StatusLast Update
0003829OpenFOAMPatchpublic2022-04-25 13:20
ReporterjkauAssigned Tohenry 
PrioritylowSeverityminorReproducibilityalways
Status closedResolutionno change required 
PlatformLInuxOSUbuntuOS Version20.04
Product Versiondev 
Fixed in Version 
Summary0003829: the patchInternalField (zero-gradient field) in outletPhaseMeanVelocity could be changed to const reference
DescriptionI think the updateCoeff() function of outletPhaseMeanVelocity patch field,
the Uzg vectorField could be changed to a const reference.

TagsNo tags attached.

Activities

henry

2022-04-25 10:19

manager   ~0012556

Why do you think it can be changed to a const reference?

jkau

2022-04-25 10:38

reporter   ~0012557

When looking at the code, my understanding is that Uzg is only used for calculating UnzgMean. But if this is wrong, please ignore and close.

henry

2022-04-25 10:47

manager   ~0012558

In the call

    vectorField Uzg(patchInternalField());

what does patchInternalField() return? Is it a const or non-const reference?

jkau

2022-04-25 10:54

reporter   ~0012559

hm, looks like a const reference

henry

2022-04-25 10:58

manager   ~0012560

Which definition of patchInternalField() are you looking at and what is the return type?

jkau

2022-04-25 11:23

reporter   ~0012561

I am looking at
    virtual tmp<Field<Type>> patchInternalField() const;
defined in fvPatchField.H, wich returns
    tmp<Field<Type>>

henry

2022-04-25 12:33

manager   ~0012562

which is not a const reference.

henry

2022-04-25 13:20

manager   ~0012563

https://cfd.direct/openfoam-training/programming-cfd/

henry

2022-04-25 13:20

manager   ~0012564

User error

Issue History

Date Modified Username Field Change
2022-04-25 10:07 jkau New Issue
2022-04-25 10:19 henry Note Added: 0012556
2022-04-25 10:38 jkau Note Added: 0012557
2022-04-25 10:47 henry Note Added: 0012558
2022-04-25 10:54 jkau Note Added: 0012559
2022-04-25 10:58 henry Note Added: 0012560
2022-04-25 11:23 jkau Note Added: 0012561
2022-04-25 12:33 henry Note Added: 0012562
2022-04-25 13:20 henry Note Added: 0012563
2022-04-25 13:20 henry Assigned To => henry
2022-04-25 13:20 henry Status new => closed
2022-04-25 13:20 henry Resolution open => no change required
2022-04-25 13:20 henry Note Added: 0012564