/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  v2412                                 |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    object      optimisationDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

optimisationManager steadyOptimisation;

primalSolvers
{
    p1
    {
        active                 true;
        type                   incompressible;
        solver                 simple;
        solutionControls
        {
            nIters          3000;
            residualControl
            {
                "p.*"       5.e-6;
                "U.*"       5.e-6;
                "k.*"       5.e-6;
                "omega.*"   5.e-6;
            }
        }
    }
}

adjointManagers
{
    am1
    {
        primalSolver    p1;
        adjointSolvers
        {
            as1
            {
                // choose adjoint solver
                //----------------------
                active                 true;
                type                   incompressible;
                solver                 adjointSimple;

                // manage objectives
                //------------------
                objectives
                {
                    type            incompressible;
                    objectiveNames
                    {
                        losses
                        {
                            weight          1;
                            type            PtLosses;
                            patches         ( Inlet Outlet );
                        }
                    }
                }

                // ATC treatment
                //--------------
                ATCModel
                {
                    ATCModel        standard;
                }

                // solution control
                //------------------
                solutionControls
                {
                    nIters          3000;
                    residualControl
                    {
                        "pa.*"       5.e-6;
                        "Ua.*"       5.e-6;
                        "ka.*"       5.e-6;
                        "wa.*"       5.e-6;
                    }
                }
            }
        }
    }
}

optimisation
{
    designVariables
    {
        type            shape;
        shapeType       volumetricBSplines;
        sensitivityType shapeFI;
        patches         ( lower upper );
        maxInitChange   0.002;
    }
    updateMethod
    {
        method BFGS;
    }
}

// ************************************************************************* //
