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

Adjoint Convergence Problem

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 3, 2016, 11:16
Lightbulb Adjoint Convergence Problem
  #1
Senior Member
 
FlyBob91's Avatar
 
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10
FlyBob91 is on a distinguished road
Hi to all,
i wrote my own adjoint solver and compiled it correcty. However i'm meeting some problem running my case because the residuals seem to converge but the solution literally explodes as you can see below

Code:
smoothSolver:  Solving for Uax, Initial residual = 4.39575174596e-05, Final residual = 4.16030919667e-08, No Iterations 2
smoothSolver:  Solving for Uay, Initial residual = 4.5057555084e-05, Final residual = 3.58842322767e-08, No Iterations 2
smoothSolver:  Solving for Uaz, Initial residual = 4.06676312041e-05, Final residual = 3.22296628924e-08, No Iterations 2
GAMG:  Solving for pa, Initial residual = 0.000212921685966, Final residual = 1.41332460912e-06, No Iterations 4
Adjoint continuity errors : sum local = 15942358.9466, global = 8202.0330787, cumulative = 9256411904.89

I try to use low relaxation factors but nothing change. I link my fvschemes and fvsolution files.
I also noticed others people have had a problem similar to mine, because the adjoint problem are very sensitive to the boundary conditions.

Code:
solvers
{
    "(p|pa)"
    {
        solver          GAMG;
        tolerance       1e-08;
        relTol          0.01;
        smoother        GaussSeidel;
        nPreSweeps      0;
        nPostSweeps     2;
        cacheAgglomeration true;
        nCellsInCoarsestLevel 10;
        agglomerator    faceAreaPair;
        mergeLevels     1;
    }

    "(U|Ua|k|epsilon)"
    {
        solver          smoothSolver;
        smoother        GaussSeidel;
        nSweeps         2;
        tolerance       1e-08;
        relTol          0.1;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
    pRefCell 0;
    pRefValue 0;
}

relaxationFactors
{
    fields
    {
        "(p|pa)"        0.1;
        alpha           0.1;
    }
    equations
    {
        "(U|Ua)"        0.1;
        "(k|epsilon)"   0.7;
    }
}
Code:
ddtSchemes
{
    default         steadyState;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         Gauss upwind;

    div(phi,U)      bounded Gauss upwind;
    div(phi,k)      bounded Gauss upwind;
    div(phi,epsilon) bounded Gauss upwind;
    div((nuEff*dev(T(grad(U))))) Gauss linear;

    div(-phi,Ua)    bounded Gauss upwind;
    div((nuEff*dev(T(grad(Ua))))) Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear uncorrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         uncorrected;
}

fluxRequired
{
    default         no;
    p;
    pa;
}

Furthermore i read this thread

HTML Code:
http://www.cfd-online.com/Forums/openfoam-solving/103229-adjointshapeoptimizationfoam-checkerboarding-inlet.html
where sylvester suggest to use a " pseudo staggered grid approach" but i don't uderstand what he refers to.

The simulation type is a laminar and if you are interested in my code you can find it in a previuos thread

HTML Code:
http://www.cfd-online.com/Forums/openfoam-programming-development/180587-insert-dimensioned-salar.html
i link also my mesh quality

Code:
Create polyMesh for time = 0

Time = 0

Mesh stats
    points:           306516
    faces:            863850
    internal faces:   810150
    cells:            279000
    faces per cell:   6
    boundary patches: 4
    point zones:      0
    face zones:       0
    cell zones:       0

Overall number of cells of each type:
    hexahedra:     279000
    prisms:        0
    wedges:        0
    pyramids:      0
    tet wedges:    0
    tetrahedra:    0
    polyhedra:     0

Checking topology...
    Boundary definition OK.
    Cell to face addressing OK.
    Point usage OK.
    Upper triangular ordering OK.
    Face vertices OK.
    Number of regions: 1 (OK).

Checking patch topology for multiply connected surfaces...
    Patch               Faces    Points   Surface topology                  
    walls               52500    52619    ok (non-closed singly connected)  
    inlet1              300      336      ok (non-closed singly connected)  
    inlet2              300      336      ok (non-closed singly connected)  
    outlet              600      651      ok (non-closed singly connected)  

Checking geometry...
    Overall domain bounding box (-0.00015 -0.00165 0) (0.003 0.00165 0.0002)
    Mesh (non-empty, non-wedge) directions (1 1 1)
    Mesh (non-empty) directions (1 1 1)
    Boundary openness (-6.91724010847e-18 1.96638314844e-18 2.57097977866e-17) OK.
    Max cell openness = 1.29246970711e-16 OK.
    Max aspect ratio = 1 OK.
    Minimum face area = 1e-10. Maximum face area = 1e-10.  Face area magnitudes OK.
    Min volume = 1e-15. Max volume = 1e-15.  Total volume = 2.79000000001e-10.  Cell volumes OK.
    Mesh non-orthogonality Max: 0 average: 0
    Non-orthogonality check OK.
    Face pyramids OK.
    Max skewness = 1.25 OK.
    Coupled point location match (average 0) OK.

Mesh OK.

Any idea to solve the problem?

Thanks for help,
Roberto
Attached Images
File Type: png Tmixer.png (11.9 KB, 47 views)
FlyBob91 is offline   Reply With Quote

Old   April 27, 2017, 06:02
Default
  #2
New Member
 
Mary Claire
Join Date: Mar 2015
Posts: 9
Rep Power: 11
Silver Silhouette is on a distinguished road
Hello

I am currently running an airfoil optimization case using adjoint solver.
What I do is iteratively run the flow solver and adjoint solver without initializing. Is this correct?
Also after a certain number of iterations the adjoint solver or the flow solver doesnt seem to converge. Initially i try to bring down the under relaxation factor. This converges the case up to a few more iterations then starts diverging again. However the mesh doesnt seem to have failed or there doesn't seem to a flow separation. Can i drive my solution to convergence using any other methods??
Or since it is an optimization problem should i stop when the solution diverges?

Also how is it that you write your own code into the adjoint solver? What i am following is standard for pressure and second order for momentum for the adjoint solver
Silver Silhouette is offline   Reply With Quote

Reply


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
[Other] engineFoam new mesh problem ayhan515 OpenFOAM Meshing & Mesh Conversion 5 August 10, 2015 09:45
UDF compiling problem Wouter Fluent UDF and Scheme Programming 6 June 6, 2012 05:43
Gambit - meshing over airfoil wrapping (?) problem JFDC FLUENT 1 July 11, 2011 06:59
natural convection problem for a CHT problem Se-Hee CFX 2 June 10, 2007 07:29
Adiabatic and Rotating wall (Convection problem) ParodDav CFX 5 April 29, 2007 20:13


All times are GMT -4. The time now is 16:47.