View Issue Details

IDProjectCategoryView StatusLast Update
0002427OpenFOAM[All Projects] Bugpublic2017-01-13 14:26
ReporterzhulianhuaAssigned Tohenry 
PrioritynormalSeverityminorReproducibilityalways
Status resolvedResolutionfixed 
PlatformGNU/LinuxOSUbuntuOS Version14.04
Product Version4.1 
Fixed 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

Activities

zhulianhua

2017-01-09 14:53

reporter  

fvOptions (1,580 bytes)
/*--------------------------------*- 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;
    }
}

// ************************************************************************* //
fvOptions (1,580 bytes)

zhulianhua

2017-01-09 14:53

reporter  

channel_external_force_bug.tar.gz (105,053 bytes)

henry

2017-01-11 09:21

manager   ~0007619

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

zhulianhua

2017-01-11 10:09

reporter   ~0007621

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

CodedSource.H (5,972 bytes)

henry

2017-01-13 14:26

manager   ~0007632

Thanks for the patch.

Resolved in OpenFOAM-dev by commit 03362483db760099343e87123d4d9411c5407d6f

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