CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > OpenFOAM > OpenFOAM Programming & Development

exp() function not working?

Register Blogs Community New Posts Updated Threads Search

 
 
LinkBack Thread Tools Search this Thread Display Modes
Prev Previous Post   Next Post Next
Old   April 23, 2014, 21:10
Default exp() function not working?
  #1
Member
 
CHARLES
Join Date: May 2013
Posts: 46
Rep Power: 13
CHARLES is on a distinguished road
Hello,

For some reason I don't think that exp() is doing anything... can you please tell me what you think is wrong?

I have the following code:
Code:
argf2 = sqr(k_)/(6.0*nu()*epsilon_);
f2 = 1-2/9*Foam::exp(-1.0*sqr(argf2));
I can tell that argf2 is doing what is supposed to.
However, when I bring up f2 in paraview it just shows up as 1 everywhere.

If I define f2 in the following way:
Code:
f2 = 99-2/9*Foam::exp(-1.0*sqr(argf2));
f2 shows up as 99 everywhere.

If I define f2 in the following way:
Code:
f2 = -2/9*Foam::exp(-1.0*sqr(argf2));
Then the field f2 shows up as 0, even if it was initialized as a different value.

I have also tried to not use "Foam::" before exp() and it doesn't make a difference.

Additionally, when I look at the f2 that was output to the time directory it looks like this:
Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2.2.0                                 |
|   \\  /    A nd           | Web:      www.OpenFOAM.org                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    location    "0.001";
    object      f2;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 1;

boundaryField
{
    plate
    {
        type            calculated;
        value           uniform 1;
    }
    back
    {
        type            empty;
    }
    front
    {
        type            empty;
    }
    inlet
    {
        type            calculated;
        value           uniform 1;
    }
    outlet
    {
        type            calculated;
        value           uniform 1;
    }
    top
    {
        type            calculated;
        value           uniform 1;
    }
    symmetry
    {
        type            symmetryPlane;
    }
}


// ************************************************************************* //
when in reality it should be an internalField nonuniform List<scalar>


Thank you!
CHARLES is offline   Reply With Quote

 


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
[blockMesh] non-orthogonal faces and incorrect orientation? nennbs OpenFOAM Meshing & Mesh Conversion 7 April 17, 2013 05:42
Can anybody help me to solve the list errors while compiling Openfoam 15 on Opensuse 103 32bit coompressor OpenFOAM Installation 0 November 12, 2008 19:53
Could you please help me about the VTKFoam liugx212 OpenFOAM Pre-Processing 5 February 13, 2008 11:31
Droplet Evaporation Christian Main CFD Forum 2 February 27, 2007 06:27
[OpenFOAM] Could you please help me liugx212 ParaView 4 December 22, 2005 16:55


All times are GMT -4. The time now is 02:04.