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

adjointShapeOptimizationFoam checkerboarding inlet

Register Blogs Members List Search Today's Posts Mark Forums Read

Like Tree1Likes
  • 1 Post By sylvester

Reply
 
LinkBack Thread Tools Display Modes
Old   June 14, 2012, 05:52
Default adjointShapeOptimizationFoam checkerboarding inlet
  #1
Member
 
Roland
Join Date: Mar 2009
Location: Netherlands
Posts: 62
Rep Power: 8
sylvester is on a distinguished road
For an optimization study I am working with an Ahmed body using adjointShapeOptimizationFoam.

As you can see from the picture 'ahmed_alpha.jpg' the solver works really well near the body, trying to extend the body with an aerodynamic fairing. However near the inlet I am experiencing a strange checkerboarding problem in my adjoint equations, see pictures 'ahmed_pa.jpg' and 'ahmend_Ua.jpg'. All pictures are taken after (only) 100 iterations.After a further several hundred iterations the adjoint flow field fully diverges. The primal flow field is smooth, as expected, see pictures 'ahmed_p.jpg' and 'ahmed_U.jpg'.

The adjoint boundary conditions are taken from the adjointShapeOptimizationFoam tutorial (see below), as are the values for lambda and alphaMax. The fvSolution and fvSchemes settings (see below) are based on the tutorials with lower adjoint relaxations and uncorrected in stead of corrected schemes. Lower values of relTol and relaxation where also tested, but without improvements. CheckMesh reports 'Mesh OK', with no warnings.

Does anyone have suggestions on how best to solve this?

Thanks!

regards,
Sylvester

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|omega)"
    {
        solver          smoothSolver;
        smoother        GaussSeidel;
        nSweeps         2;
        tolerance       1e-08;
        relTol          0.1;
    }
}

SIMPLE
{
    nNonOrthogonalCorrectors 0;
}
relaxationFactors
{
    fields
    {
        p               0.3;
        pa              0.1;
        alpha           0.1;
    }
    equations
    {
        U               0.7;
        Ua              0.1;  
        "(k|omega)"     0.7;
    }
Code:
ddtSchemes
{
    default         steadyState;
}

gradSchemes
{
    default         Gauss linear;
}

divSchemes
{
    default         Gauss upwind;
    div((nuEff*dev(T(grad(U))))) Gauss linear;
    div((nuEff*dev(T(grad(Ua))))) Gauss linear;
}

laplacianSchemes
{
    default         Gauss linear uncorrected;
}

interpolationSchemes
{
    default         linear;
}

snGradSchemes
{
    default         uncorrected;
}

fluxRequired
{
    default         no;
    p;
    pa;
}
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       volScalarField;
    object      p;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [ 0 2 -2 0 0 0 0 ];

internalField   uniform 0;

boundaryField
{
    ".*"
    {
        type            zeroGradient;
    }
    outlet
    {
        type            adjointOutletPressure;
        value           uniform 0;
    }
    symmetry
    {
        type            symmetryPlane;
    }
}
Code:
FoamFile
{
    version     2.0;
    format      ascii;
    class       volVectorField;
    object      Ua;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

dimensions      [ 0 1 -1 0 0 0 0 ];

internalField   uniform ( -1 0 0 );

boundaryField
{
    ".*"
    {
        type            fixedValue;
        value           uniform ( 0 0 0 );
    }
    inlet
    {
        type            fixedValue;
        value           uniform ( -1 0 0 );
    }
    outlet
    {
        type            adjointOutletVelocity;
        value           uniform ( 0 0 0 );
    }
    farfield
    {
        type            slip;
    }
    symmetry
    {
        type            symmetryPlane;
    }
}
Attached Images
File Type: jpg ahmed_alpha.jpg (26.4 KB, 136 views)
File Type: jpg ahmed_pa.jpg (85.8 KB, 124 views)
File Type: jpg ahmed_Ua.jpg (51.7 KB, 102 views)
File Type: jpg ahmed_p.jpg (63.3 KB, 91 views)
File Type: jpg ahmed_U.jpg (51.0 KB, 85 views)

Last edited by sylvester; June 14, 2012 at 06:00. Reason: added checkMesh info
sylvester is offline   Reply With Quote

Old   June 19, 2012, 04:46
Default pseudo staggered approach for the adjoint equations
  #2
Member
 
Roland
Join Date: Mar 2009
Location: Netherlands
Posts: 62
Rep Power: 8
sylvester is on a distinguished road
Hi!

Using a pseudo staggered approach for the adjoint equations helps, see the images below.

I've modified adjointShapeOptimizationFoam a bit so it uses the pseudo staggered grid approach also used in, for example, buoyantBoussinesqSimpleFoam.

As you can see in the images, this approach removes the checkerboarding near the floor, but it does not completely remove it over the full surface of the inlet. The adjoint equations only diverge at the inlet, the rest of the domain are OK. The second image also shows that the calculation of 'alpha' is unaffected by the pseudo staggering.

Any directions on how to proceed would be much appreciated!

Regards,
Sylvester
Attached Images
File Type: jpg pa_pseudo.jpg (38.0 KB, 94 views)
File Type: jpg alpha_pseudo.jpg (21.8 KB, 91 views)
fumiya likes this.
sylvester is offline   Reply With Quote

Old   January 7, 2013, 16:51
Default
  #3
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,205
Rep Power: 17
immortality is on a distinguished road
hi.how did you solved the problem?can this solver be used for compressible flows?could you introduce me some useful papers or texts about using the method?i want to know how points are changed according to this solver.can it be used with optimization algorithms like ant colony or other ones?thank you.
immortality is offline   Reply With Quote

Old   January 8, 2013, 05:38
Default
  #4
Member
 
Roland
Join Date: Mar 2009
Location: Netherlands
Posts: 62
Rep Power: 8
sylvester is on a distinguished road
Hi,

I haven't been able to work on this, so not much progress has been made. The adjoint solver in OpenFOAM is for incompressible flows only. For compressible flows the adjoint equations also exist, so you should be able to make a compressible version. A Google search will probably provide you with references on this.

regards,
Sylvester
sylvester is offline   Reply With Quote

Old   January 8, 2013, 06:44
Default
  #5
Senior Member
 
immortality's Avatar
 
Ehsan
Join Date: Oct 2012
Location: Iran
Posts: 2,205
Rep Power: 17
immortality is on a distinguished road
thanks.if send me a suitable to start pdf ill be very thankful to you!
Force.of.love@gmail.com
immortality is offline   Reply With Quote

Reply

Tags
adjoint, ahmed, checkerboarding, instability, optimization

Thread Tools
Display Modes

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 On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Oscillating inlet BC November OpenFOAM 4 March 21, 2012 21:46
Velocity inlet boundary condition for porous medium Chander CFX 3 March 11, 2012 22:18
VOF Volume fraction in Velocity inlet aruelle FLUENT 1 March 18, 2010 12:53
Inlet Velocity in CFX aeroman CFX 12 August 6, 2009 18:42
Diffusion component at inlet Balaji FLUENT 2 August 8, 2005 07:37


All times are GMT -4. The time now is 15:52.