|
[Sponsors] |
November 21, 2023, 13:04 |
interFoam not holding waveform
|
#1 |
Member
Mike Tree
Join Date: Feb 2016
Location: Charlotte, NC
Posts: 37
Rep Power: 10 |
Fellow foamers,
I'm attempting to simulate wing in-ground effects on a 2D airfoil over an air-water interface. I want to assign a specific waveform to the interface, but the waveform is changing shape as it progresses through the domain. I recognize that the presence of the airfoil will affect the waveform shape, but I'm seeing waveform changes as soon as one period after the boundary, which is ~9 chord lengths upstream of the airfoil. Picture1 shows the initial setup. Picture2 shows the first period of the wave from the boundary condition and highlights an indentation at the wave peak. Picture3 shows the first several periods and the change in waveform shape as it progresses through the domain. Does anyone have ideas on how I can better control the waveform shape that reaches the airfoil? Here are my pertinent input files: controlDict Code:
application interFoam; startFrom latestTime; //startTime; startTime 0.; stopAt nextWrite; //endTime; endTime 0.31896; // 60 periods (3x flow-throughs) deltaT 1e-6; writeControl adjustableRunTime; writeInterval 2.658e-4; // 20 steps per period purgeWrite 0; writeFormat binary; writePrecision 6; writeCompression off; timeFormat general; timePrecision 6; runTimeModifiable yes; adjustTimeStep on; maxCo 3.; maxAlphaCo 1.; maxDeltaT 1.; Code:
ddtSchemes { default Euler; } gradSchemes { default Gauss linear; limitedGrad cellLimited Gauss linear 1; } divSchemes { div(rhoPhi,U) Gauss linearUpwind grad(U); div(phi,alpha) Gauss vanLeer; div(phirb,alpha) Gauss linear; div(phi,k) Gauss linearUpwind limitedGrad; div(phi,omega) Gauss linearUpwind limitedGrad; div(((rho*nuEff)*dev2(T(grad(U))))) Gauss linear; } laplacianSchemes { default Gauss linear corrected; } interpolationSchemes { default linear; } snGradSchemes { default corrected; } wallDist { method meshWave; } Code:
solvers { "alpha.water.*" { nAlphaCorr 3; nAlphaSubCycles 1; cAlpha 1; icAlpha 0; MULESCorr yes; nLimiterIter 15; alphaApplyPrevCorr yes; solver smoothSolver; smoother symGaussSeidel; tolerance 1e-10; relTol 0; minIter 1; } "pcorr.*" { solver GAMG; smoother DIC; tolerance 1e-3; relTol 0; }; p_rgh { solver GAMG; smoother DIC; tolerance 5e-8; relTol 0; }; p_rghFinal { $p_rgh; relTol 0; } "(U|k|omega).*" { solver smoothSolver; smoother symGaussSeidel; nSweeps 1; tolerance 1e-7; relTol 0; minIter 1; }; } PIMPLE { momentumPredictor no; nOuterCorrectors 2; nCorrectors 2; nNonOrthogonalCorrectors 0; correctPhi yes; moveMeshOuterCorrectors no; turbOnFinalIterOnly yes; } relaxationFactors { equations { ".*" 1; } } cache { grad(U); } Code:
Umean 100; dimensions [0 1 -1 0 0 0 0]; internalField uniform ($Umean 0 0); boundaryField { front_and_back { type empty; } inlet { type fixedValue; value $internalField; } outlet { type outletPhaseMeanVelocity; alpha alpha.water; Umean $Umean; value $internalField; } top { type pressureInletOutletVelocity; tangentialVelocity $internalField; value uniform (0 0 0); } bottom { type pressureInletOutletVelocity; tangentialVelocity $internalField; value uniform (0 0 0); } wing { type noSlip; } } Code:
dimensions [1 -1 -2 0 0 0 0]; internalField uniform 0; boundaryField { front_and_back { type empty; } bottom { type totalPressure; p0 uniform 0; } wing { type fixedFluxPressure; value $internalField; } outlet { type zeroGradient; } top { type totalPressure; p0 uniform 0; } inlet { type fixedFluxPressure; value $internalField; } } Code:
dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { front_and_back { type empty; } bottom { type inletOutlet; inletValue uniform 1; value $internalField; } wing { type zeroGradient; } outlet { type variableHeightFlowRate; lowerBound 0; upperBound 1; value $internalField; } top { type inletOutlet; inletValue $internalField; value $internalField; } inlet { type uniformFixedValue; value $internalField; uniformValue { type expression; variables ( "orig_h = -0.1329" // wave amplitude "a = 0.045" // wave speed (match velocity inlet) "Vg = 100" // wavelength "l = 0.5316" // wave height "eta = -a*cos(2*pi()*Vg*time()/l)" ); expression #{ // if the y position is less than or equal to // the original water level plus the wave // height then set the alpha value to 1; if not // set the alpha value to 0 (pos().y() <= orig_h + eta) ? 1 : 0 #}; } } } |
|
November 22, 2023, 04:28 |
|
#2 |
Senior Member
Join Date: Dec 2021
Posts: 246
Rep Power: 5 |
Hey!
You could use the file waveProperties with the waveVelocity and waveAlpha boundary conditions to generate waves. They tend to be stable in my experience. There are some examples in the interFoam tutorials. Other than that, maybe turning off the turbulence will help because turbulence will introduce dissipation depending on the scale of the simulation. And I always turn off alphaApplyPrevCorr in fvSolution, my simulations are more unstable more often than not (although I may be using it when it is not applicable). Just a thing that you could also try And finally, if you use setFields, add an hRef file in constant with your initial water level. It helps with the water leaving properly at the outlet. |
|
Tags |
airfoil 2d, interfoam, waves multiphaseinterfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Adding diffusion term to interFoam transport equation | Gearb0x | OpenFOAM Programming & Development | 3 | February 14, 2023 05:16 |
interFoam vs. simpleFoam channel flow comparison | DanM | OpenFOAM Running, Solving & CFD | 12 | January 31, 2020 16:26 |
Question about interFoam Solver | Kahnbein.Kai | OpenFOAM Running, Solving & CFD | 2 | August 26, 2019 16:36 |
interFoam (HELYX-OS) pressure boundary conditions | SFr | OpenFOAM Running, Solving & CFD | 8 | June 23, 2016 17:36 |
k-e & GAMG interFoam Schemitisation Stability Issue | JFM | OpenFOAM Running, Solving & CFD | 3 | December 1, 2015 06:58 |