View Issue Details

IDProjectCategoryView StatusLast Update
0003418OpenFOAMFeaturepublic2020-01-31 23:51
Reporterhandrake0724 Assigned Tohenry  
PrioritynormalSeverityminorReproducibilityhave not tried
Status resolvedResolutionfixed 
Product Versiondev 
Fixed in Versiondev 
Summary0003418: codedFunction1 implementation
Descriptionrecently there were a need to implement wind load relative to the ship speed such that F = 0.5 rho A (Vw - Vs)^2 with Function1 class.
as comment https://bugs.openfoam.org/view.php?id=3381#c10923,
tried to implement codedFunction1 and found there was no way to access to Time.libs() to get dlLibraryTable in current Function1 structure if I am not wrong.

So, I modified Function1 class to make use of objectRegistry db such that constructor and selector have additional parameter as shown below:

    declareRunTimeSelectionTable
    (
        autoPtr,
        Function1,
        dictionary,
        (
            const word& entryName,
            const objectRegistry& obr,
            const dictionary& dict
        ),
        (entryName, obr, dict)
    );

        //- Construct from entry name
        Function1(const word& entryName, const objectRegistry& obr);

    //- Selector
    static autoPtr<Function1<Type>> New
    (
        const word& entryName,
        const objectRegistry& obr,
        const dictionary& dict
    );

But, this modification impacts on TurbulenceModels, dynamicMesh, finiteVolume/fields etc. as well as Function1 and its sub-classes.
Some classes e.g., radial, freePiston, damping is not possible to work with the modified Function1 class because those classes do not have a way to get objectRegistry object.
It looks like codedFunction1 is not possible to implement in the current Function1 structure.

Is there any way to get Time.lib() in the current Function1 implementation?
TagsNo tags attached.

Activities

henry

2019-12-28 18:20

manager   ~0011006

Function1 is designed to be lower-level than objectRegistry and should not directly depend on it.

handrake0724

2019-12-29 12:54

viewer   ~0011007

Thanks for the comment. I now understand the philosophy of Function1 class.
For the relative wind load external force, I will try to do it with restraint class which is more appropriate for this purpose.
maybe relative wind load external load is not a usual case for wind load analysis, coded version might be useful later.

henry

2020-01-31 23:51

manager   ~0011114

Resolved by commit 0dd2e97bd8af78dd063d158bc0c4965f37529cdb

Issue History

Date Modified Username Field Change
2019-12-28 18:14 handrake0724 New Issue
2019-12-28 18:20 henry Note Added: 0011006
2019-12-29 12:54 handrake0724 Note Added: 0011007
2020-01-31 23:51 henry Assigned To => henry
2020-01-31 23:51 henry Status new => resolved
2020-01-31 23:51 henry Resolution open => fixed
2020-01-31 23:51 henry Fixed in Version => dev
2020-01-31 23:51 henry Note Added: 0011114