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

dimensions      [0 0 0 1 0 0 0];

internalField   uniform 300;

boundaryField
{
    #includeEtc "caseDicts/setConstraintTypes"

    piston
    {
        type            zeroGradient;
    }

    cylinderWall
    {
       type            zeroGradient;
    }

    topWall
    {
        type            zeroGradient;
    }

    
    inlet 
    {
        type            fixedValue;
        value           uniform 320;
    }

    outlet
    {
        type            zeroGradient;
    }

// inlet
// {
     
//     type            codedMixed;
//     value           uniform 300; // Initial temperature (K)
//     name            timeDependentInletTemperature;
//     refGradient     uniform 0;         // Zero gradient component
//     valueFraction   uniform 0;         // Initial blending (0 = Neumann)
//     refValue        uniform 300;
   
//    codeInclude
//     #{
//         #include "fvCFD.H"
//     #};

//     codeOptions
//     #{
//         -I$(LIB_SRC)/finiteVolume/lnInclude \
//         -I$(LIB_SRC)/meshTools/lnInclude
//     #};

//     codeLibs
//     #{
//         -lfiniteVolume \
//         -lmeshTools
//     #};
//      codeContext             <dict>;

//     code            #{
//                         // Get current simulation time
//                         const scalar t = this->db().time().value();
                        
//                         // Define cycle parameters
//                         const scalar cyclePeriod = 0.1;  // Full cycle duration (sec)
//                         const scalar suctionTime = 0.02;   // Suction phase duration (sec)
                    
//                         // Calculate time within the current cycle
//                         scalar cycleTime = t - floor(t / cyclePeriod) * cyclePeriod;
                        
//                         if (cycleTime <= suctionTime)
//                         {
//                             // Suction phase: fixed temperature (300K)
//                             this->refValue() = 300;       // Temperature value (K)
//                             this->valueFraction() = 1.0;  // Fully fixed value
//                         }
//                         else
//                         {
//                             // Wall phase: zero gradient (adiabatic)
//                             this->refValue() = 0;         // Irrelevant for zero gradient
//                             this->valueFraction() = 0.0;  // Fully zero gradient
//                         }
//                     #};


// }
  
  
}

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