|
[Sponsors] |
February 11, 2017, 15:31 |
Solving a Reaction-Diffusion Type Equation
|
#1 |
New Member
Join Date: Oct 2016
Posts: 3
Rep Power: 10 |
Hello Everyone!
My current Project (using OpenFOAM 4.0) demands (for the Sake of Stability) the spatial Filtering of a scalar Field to remove features smaller than a specified length scale. The Values of this Field should be blurred by averaging them with the Values of Cells within a certain radius. My first attempt at this (as specified by the Paper I was reading: http://www.topopt.dtu.dk/files/TopOpt88.pdf) was doing a weighted Average over all Cells within a certain radius. My Implementation of involved a for-loop over all Cells with max() and gsum() functions. While this yielded some Results (see below), it proved to be unusably slow. I therefore wanted to replace this by something faster, preferably leveraging the PDE-Solving powers of OpenFOAM. The Paper proposed an alternative Approach for filtering by solving a Reaction-Diffusion-Type Equation, which I wrote as follows: Code:
RFilter = pow(rFilter/(2*::sqrt(3.0)),2.0); filteredObjectSensitivity = ObjectSensitivity; Info<< "rFilter = " << rFilter << nl << "RFilter = " << RFilter << nl << endl; fvScalarMatrix PDEFilter ( laplacianDimKiller*RFilter*fvm::laplacian(filteredObjectSensitivity) -filteredObjectSensitivity == -ObjectSensitivity ); PDEFilter.solve(); filteredObjectSensitivity = filteredObjectSensitivity/(max(filteredObjectSensitivity).value()*0.000000001); rFilter as the original Filter length scale (set by user, type scalar) ObjectSensitivity as the original (unfiltered) volScalarField filteredObjectSensitivity as the filtered volScalarField laplacianDimKiller as a scalar of unity value to make FOAM stop complaining about dimensions The last Line is to normalize values to a certain Range. The Paper specifies BCs as Gradients normal to the Boundary to be zero, so I set zeroGradient BCs for the filteredObjectSensitivity field. Entries in fvSolution and fvSchemes were: Code:
filteredObjectSensitivity { solver GAMG; tolerance 1e-06; relTol 0.001; smoother GaussSeidel; cacheAgglomeration true; nCellsInCoarsestLevel 20; agglomerator faceAreaPair; mergeLevels 1; } Code:
laplacian(filteredObjectSensitivity) Gauss linear corrected; unfiltered.png Filtering this with rFilter set to 0.5 yields following output on the CLI: Code:
rFilter = 0.5 [0 0 0 0 0 0 0] 0.5 RFilter = pow((0.5|3.4641),2) [0 0 0 0 0 0 0] 0.02083333333 GAMG: Solving for filteredObjectSensitivity, Initial residual = 1, Final residual = 0.0008298633416, No Iterations 6 filtered05.png For Comparison, Result of old filter Approach: oldfilter05.png Filtering with rFilter set to 0.05 gives this: Code:
rFilter = 0.05 [0 0 0 0 0 0 0] 0.05 RFilter = pow((0.05|3.4641),2) [0 0 0 0 0 0 0] 0.0002083333333 GAMG: Solving for filteredObjectSensitivity, Initial residual = 1, Final residual = 0.0008298633416, No Iterations 6 filtered005.png And old Filter using the same Parameters: oldfilter005.png As can be seen, the PDE filter Approach does not really care for the Values of rFilter, as the old Filter does. What can I do to make the Output of the PDE-Filter at least similar to the Output of the old Filter? What I tried: - Flipping signs in the Equation -> Does not do anything exept inverting the Solution - Tried very large/small values for rFilter -> Same Results - Setting one BC as fixedValue, value 0 -> Distorts solution, still no Impact of rFilter to filteredObjectSensitivity field Now I am pretty much out of Ideas. Maybe I did not quite understand something? Best Regards, Juggler |
|
Tags |
implementation, reaction-diffusion |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Extrusion with OpenFoam problem No. Iterations 0 | Lord Kelvin | OpenFOAM Running, Solving & CFD | 8 | March 28, 2016 12:08 |
Unstabil Simulation with chtMultiRegionFoam | mbay101 | OpenFOAM Running, Solving & CFD | 13 | December 28, 2013 14:12 |
Upgraded from Karmic Koala 9.10 to Lucid Lynx10.04.3 | bookie56 | OpenFOAM Installation | 8 | August 13, 2011 05:03 |
Orifice Plate with a fully developed flow - Problems with convergence | jonmec | OpenFOAM Running, Solving & CFD | 3 | July 28, 2011 06:24 |
Pressure instability with rhoSimpleFoam | daniel_mills | OpenFOAM Running, Solving & CFD | 44 | February 17, 2011 18:08 |