2017-02-28 16:47 GMT

View Issue Details Jump to Notes ]
IDProjectCategoryView StatusLast Update
0002427OpenFOAM[All Projects] Bugpublic2017-01-13 14:26
Reporterzhulianhua 
Assigned Tohenry 
PrioritynormalSeverityminorReproducibilityalways
StatusresolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version14.04
Product Version4.1 
Target VersionFixed in Versiondev 
Summary0002427: Description in the header file $FOAM_SRC/fvOptions/sources/general/codedSource/codedSource.H is incorrect.
DescriptionBoth the `fieldNames' entry and the

'''
sourceTimeCoeffs
{
     // Dummy entry
}
'''
are not correct.
Steps To ReproduceAttached is a case using the `vectorCodeSource' type fvOption to apply an external force to drive the channel flow. The `control/fvOptions' are written according to the above-mentioned header file. Run the case using simpleFoam. The error would be:

keyword name is undefined in dictionary "/home/lhzhu/OpenFOAM/lhzhu-4.1/run/channel_external_force_bug/constant/fvOptions.externalForce"
Additional InformationThis header file description has not been corrected yet in OpenFOAM-dev also.

I've attached a corrected version of the `constant/fvOptions' independently.
TagsfvOptions
Attached Files
  • ? file icon fvOptions (1,580 bytes) 2017-01-09 14:53 -
    /*--------------------------------*- C++ -*----------------------------------*\
    | =========                 |                                                 |
    | \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
    |  \\    /   O peration     | Version:  4.1                                   |
    |   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
    |    \\/     M anipulation  |                                                 |
    \*---------------------------------------------------------------------------*/
    FoamFile
    {
        version     2.0;
        format      ascii;
        class       dictionary;
        location    "constant";
        object      fvOptions;
    }
    // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
    
    externalForce
    {
        type            vectorCodedSource;
        active          yes;
        name     	    sourceTime;
    
        vectorCodedSourceCoeffs
        {
            selectionMode   all;
    	fields		(U);
    
    	codeInclude
    	#{
    
    	#};
    
    	codeCorrect
    	#{
    	    Pout<< "**codeCorrect**" << endl;
    	#};
    
    	codeAddSup
    	#{
    	    vectorField& USource = eqn.source();
    	    const scalarField& V = mesh_.V();
    	    vector force(1.0, 0, 0);
    	    USource -= force*V;
    	#};
    
    	codeSetValue
    	#{
    	    Pout<< "**codeSetValue**" << endl;
    	#};
    
    	// Dummy entry. Make dependent on above to trigger recompilation
    	code
    	#{
    	    $codeInclude
    	    $codeCorrect
    	    $codeAddSup
    	    $codeSetValue
    	#};
        }
        sourceTimeCoeffs
        {
    	$vectorCodedSourceCoeffs;
        }
    }
    
    // ************************************************************************* //
    
    ? file icon fvOptions (1,580 bytes) 2017-01-09 14:53 +
  • gz file icon channel_external_force_bug.tar.gz (105,053 bytes) 2017-01-09 14:53
  • ? file icon CodedSource.H (5,972 bytes) 2017-01-11 10:09

-Relationships
+Relationships

-Notes

~0007619

henry (manager)

Could you provide an updated codedSource.H file including the additional entries in the documentation needed?

~0007621

zhulianhua (reporter)

Attached please find the updated CodeSource.H with corrected documentation.

~0007632

henry (manager)

Thanks for the patch.

Resolved in OpenFOAM-dev by commit 03362483db760099343e87123d4d9411c5407d6f
+Notes

-Issue History
Date Modified Username Field Change
2017-01-09 14:53 zhulianhua New Issue
2017-01-09 14:53 zhulianhua File Added: fvOptions
2017-01-09 14:53 zhulianhua Tag Attached: fvOptions
2017-01-09 14:53 zhulianhua File Added: channel_external_force_bug.tar.gz
2017-01-11 09:21 henry Note Added: 0007619
2017-01-11 10:09 zhulianhua File Added: CodedSource.H
2017-01-11 10:09 zhulianhua Note Added: 0007621
2017-01-13 14:26 henry Assigned To => henry
2017-01-13 14:26 henry Status new => resolved
2017-01-13 14:26 henry Resolution open => fixed
2017-01-13 14:26 henry Fixed in Version => dev
2017-01-13 14:26 henry Note Added: 0007632
+Issue History