OpenFOAM basic integration
Hi,
does OpenFOAM provide basic integral methods? If I provide a mathematical function and the lower and upper limits of integration is there a OpenFOAM method to calculate the integral or do I have to use third party code? greetings maybee |
Check this out:http://www.cfd-online.com/Forums/ope...-integral.html
By Christian Butcher's hint, I am gonna try Remberg method. You can find Remberg's code somewhere else. Best, |
hi,
thx, but I ve already used another library for basic numerical integration. :) I am not sure if I am allowed link it here (?). |
Hi Maybee
Its availble in OpenFOAM no need of third party soft
In the "/opt/openfoam222/applications/test/dataEntry" in the dataEntry.C you can find about the integration with the upper and lower limits. You can make that dataEntry.C by copying it to run folder. Regards, Manjunath |
Quote:
Code:
|
Hi sharonyue
Firstly it works like if we give x and y data, it interpolates linearly(default) or it uses cubic spline. So then by giving lower limit and upper limit it integrates over the limits and gives the data. This is how it works kk
Now coming to dataEntry.... you can see in dataEntryProperties /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.2.2 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class dictionary; location "constant"; object dataEntryProperties; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // x0 0.5;//lower limit x1 1;//Upper limit dataEntry table ( (0 0)//(x1,y1) point (10 1));(x2,y2) point // ************************************************** *********************** // dataEntry().integrate(x0, x1) //This is area under the region Iterpolates this data and gives the stright line and on integration gives area under the region.... Post your error i will look into that.... Regards Manjunath |
All times are GMT -4. The time now is 07:01. |