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

InterFoam + cyclicAMI of an open channel (river)

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

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   April 20, 2024, 10:48
Default InterFoam + cyclicAMI of an open channel (river)
  #1
New Member
 
Join Date: Feb 2024
Posts: 1
Rep Power: 0
clarinha is on a distinguished road
Hi everyone,

I am trying to simulate free-surface flow over a river. The riverbed is very detailed, obtained from high-resolution topographic data. The mesh resolution is 2 mm across the domain. The idea is to run a range of velocities and flow depths, with which I will obtain drag and friction factor exerted by the riverbed. I would like to simulate the river reach only, without adding a channel upstream to allow flow development. I am also interested in capturing the free surface distortions caused by the bed topography once the flow is stabilised.

For this purpose, I am using interFoam and cyclicAMI at the inlet and outlet. The turbulence model is RNG k-epsilon. For the sake of the simulation, the bed slope is 2 degrees.

The issue with the simulation is that water (alpha.water > 0.5) and, thus, the free surface are not being correctly mapped from outlet to inlet, though the patches show similar values of the variables, which is strange. As a result, the water level is near zero near the inlet because water does not recycle from the outlet. I have tried both createPatchDict and the manual editing of the boundary file to implement cyclicAMI. I use setFieldsDict to define the initial water volume. Please find attached some relevant files. If its something related to the implementation of the cyclicAMI or another misstep, Id be happy if you could help me identify the possible cause, and Im also happy to provide further details of the model.

Cheers,
Clarinha


Code:
/*--------------------------------*- C++ -*----------------------------------*\
| =========                 |                                                 |
| \\      /  F ield         | OpenFOAM: The Open Source CFD Toolbox           |
|  \\    /   O peration     | Version:  2306                                  |
|   \\  /    A nd           | Website:  www.openfoam.com                      |
|    \\/     M anipulation  |                                                 |
\*---------------------------------------------------------------------------*/
FoamFile
{
    version     2.0;
    format      ascii;
    arch        "LSB;label=32;scalar=64";
    class       polyBoundaryMesh;
    location    "constant/polyMesh";
    object      boundary;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

6
(
    inlet
    {
        type            cyclicAMI;
	neighbourPatch	outlet;
	transform	translational;
	separationVector	(2.01876947 0 -0.07049698);
        nFaces          1596;
        startFace       1923927;
    }
    outlet
    {
        type            cyclicAMI;
	neighbourPatch	inlet;
	transform	translational;
	separationVector	(-2.01876947 0 0.07049698);
        nFaces          1560;
        startFace       1925523;
    }
    top
    {
        type            patch;
        nFaces          46056;
        startFace       1927083;
    }
    leftWall
    {
        type            wall;
        inGroups        1(wall);
        nFaces          5633;
        startFace       1973139;
    }
    rightWall
    {
        type            wall;
        inGroups        1(wall);
        nFaces          5797;
        startFace       1978772;
    }
    bed
    {
        type            wall;
        inGroups        1(wall);
        nFaces          46288;
        startFace       1984569;
    }
)

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

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

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

internalField   uniform 0.001;

boundaryField
{
    "(inlet|outlet)"
    {
	type		cyclicAMI;
    }
    top
    {
	type		totalPressure;
	p0		uniform 0;
    }
    "(leftWall|rightWall|bed)"
    {
	type		fixedFluxPressure;
    }

}


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

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

dimensions      [0 0 0 0 0 0 0];

internalField   uniform 0;

boundaryField
{
    "(leftWall|rightWall|bed)"
    {
        type            zeroGradient;
    }
    top
    {
        type            inletOutlet;
	inletValue	uniform 0;
	value		uniform 0;		
    }
    "(inlet|outlet)"
    {
	type		cyclicAMI;
    }

}

// ************************************************************************* //
Attached Images
File Type: png water-level-20s.png (23.4 KB, 14 views)
File Type: png water-level-60s.png (83.8 KB, 14 views)
File Type: png water-inlet-outlet.png (45.3 KB, 12 views)
clarinha is offline   Reply With Quote

Old   April 22, 2024, 05:59
Default
  #2
VRN
New Member
 
Vinayak Ramachandran
Join Date: Jan 2024
Posts: 3
Rep Power: 2
VRN is on a distinguished road
Hello Clarinha,

This is unfortunately a know shortcoming in the formulation of the interFoam solver. The problem arises because the solver uses a single pressure system for simplicity; combining the static and hydrostatic pressure to give the modified pressure (p_rgh). In the solver algorithm, the modified pressure equation is solved.

When you have a cyclic boundary where the two boundaries are at different heights (physically) there is a pressure jump across the boundaries due to the different values of h at either sides of the boundary, leading to unphysical behaviours.

Some workarounds have been suggested in previous discussions in the community forums (Ref thread https://www.cfd-online.com/Forums/sh...d.php?p=335817.), but I have not tried to implement them so cannot comment on their accuracy.

Good luck!
VRN is offline   Reply With Quote

Reply

Tags
cyclicami, free surface, interfoam, open channel, periodic

Thread Tools Search this Thread
Search this Thread:

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


Similar Threads
Thread Thread Starter Forum Replies Last Post
[OpenFOAM.com] swak4foam compiling issues on a cluster saj216 OpenFOAM Installation 5 January 17, 2023 16:05
[Other] Tabulated thermophysicalProperties library chriss85 OpenFOAM Community Contributions 62 October 2, 2022 03:50
Using PengRobinsonGas EoS with sprayFoam Jabo OpenFOAM Running, Solving & CFD 35 April 29, 2022 15:35
Questions about simulation free surface open channel flow by interFoam and pimpleFoam IsanM OpenFOAM Programming & Development 0 September 10, 2020 03:13
Open Channel Flow using InterFoam type solver sxhdhi OpenFOAM Running, Solving & CFD 3 May 5, 2009 21:58


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