/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  plus                                  |
|   \\  /    A nd           | Web:      www.OpenFOAM.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    class       dictionary;
    location    "system";
    object      faSolution;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

#include "${FOAM_CASE}/system/configDict"

solvers
{
    ".*"
    {
        // smoothSolver works fine (or better) for membrane
        //solver      smoothSolver;
        //smoother    DICGaussSeidel;
        solver          PBiCGStab;
        preconditioner  FDIC;
        tolerance       1e-12;
        relTol          1e-05;
        maxIter         100;
    }
}

faSurfaceStructureSolver
{
    // criterion for initial residual (solver tol must be lower!)
    convergenceCriterion    1e-8;
    minIter                 2;
    maxIter                 40;
    
    // For coupling between flow and surface structure fields
    coupling 
    {
        // NOTE: load relaxation may reduce convergence rate, because 
        // in the first coupling step of a time step it is relaxed with the old
        // time step value, whereas the deflection is relaxed with the 
        // predicted deflection value
        loadTransferUrel          1.0;
        deflectionTransferUrel    ${:deflectionTransferUrel};    // may be adapted/overridden by aitken relaxation
        deflectionTransferUrelMax 1.0;
        deflectionTransferUrelMin 0.3;
        
        // aitken relaxation (for deflection field only) crashes for steady-state 
        // Therefore disabled automatically in steady-state case
        adaptiveAitkenUrel      ${:adaptiveAitkenUrel}; 
        
        // convergence criteria for data transfers
        // deflection is a way better indicator than load
        loadTransferConvergenceCriterion        0.2;    // set to 1000: virtually disable this criterion
        deflectionTransferConvergenceCriterion  0.0002; // set to 1000: virtually disable this criterion
        
        // whether or not to divide the criterion by the under-relaxation 
        // factor so that the truly predicted deltaIter is used as a criterion
        correctDeflectionTransferConvergenceCriterion   yes;
        correctLoadTransferConvergenceCriterion         yes;
        
        // transient cases only
        strongCoupling      $isStrongCoupling;
        couplingStartTime   ${:couplingStartTime};
        predictDeflection   secondOrder; // zerothOrder, firstOrder, secondOrder
        
        // min and max number of coupling iterations
        maxCouplingIters    30;
        minCouplingIters    2;
        
        // write fields if a time step did not converge
        writeUnconvergedTimeSteps   ${:writeUnconvergedTimeSteps};
    }
    
    membrane 
    {
        // membrane-specific configuration 
        membraneUseUndeformedDiscretization yes;
    }
}

relaxationFactors
{
    equations
    {
    }
    fields
    {
    }
}

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