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

timeVaryingMappedFixedValue on a velocity outlet

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 14, 2024, 05:27
Default timeVaryingMappedFixedValue on a velocity outlet
  #1
Member
 
Jógvan
Join Date: Feb 2014
Posts: 32
Rep Power: 12
Jeggi is on a distinguished road
Hi All,

I am trying to simulate the transient tidal flow in a strait using a single-phase model and boundary conditions that vary in time and space. The boundary conditions are received from an ocean model. The setup has already been done in Fluent (see https://www.youtube.com/watch?v=UanYru7E0gI&t=13s), but because our research license has expired, we would like to attempt to run the simulation in OpenFOAM.

The strait is 1.2 km wide and about 8 km long. It is tidally driven, meaning that there is both inflow and outflow at both ends. The Fluent setup used a velocity inlet with a specified profile at each end and an outflow boundary condition placed in the middle of the domain (at “Leynar” in the animation) to ensure mass balance. The outflow boundary condition is required because the ocean model can give a few percent difference in volumetric flow rate due to tidal rise.

The strait inlet/outlets are called profile1 and profile.

I would expect that using a timeVaryingMappedFixedValue for U and a zeroGradient for p would be equivalent to Fluent velocity inlet condition. The outflow is modeled as zeroGradient for U and fixedPressure of 0 for p.

The simulation does run, but there are clear issues of unphysical velocities near the profile that serves as the outlet boundary condition. See https://www.youtube.com/watch?v=hhJ-m-a27VI and the attached image.

When I plot the boundary patches of my inlets and outlets, the velocity profiles seem to be correctly implemented (see profile1_u.png). However, when I plot the pressure on the boundary with the velocity condition that is currently functioning as an outlet, I observe clear indications of issues (see profile1_p.png). In contrast, if I plot the pressure patch of the boundary that is currently functioning as an inlet, the pressure field appears correct.

Does anyone have suggestions on how to mitigate this issue? I've tried using different types of meshes (with and without snapping), lowering the time step and changing schemes, without any success.
The case can be downloaded at https://rao.fo/files/case02_newk_cfdonline.zip .

p
Code:
dimensions      [0 2 -2 0 0 0 0]; 

internalField   uniform 0;

boundaryField
{
	"(profile1|profile4)"
	{
        type            zeroGradient;
	}
	
	"(profile1_lid|profile4_lid)"
	{
        type            zeroGradient;
	}		
    overflow
    {
        type            fixedValue;
        value           uniform 0;
    }  
    "(frontAndBack|lowerWall|upperWall)"
    {
        type            zeroGradient;
    }
    bath
    {
        type            zeroGradient;
    }
}
U
Code:
dimensions      [0 1 -1 0 0 0 0];

//internalField   uniform (0.0 0 0);

internalField   uniform (0.0 0.0 0.0);

boundaryField
{
    profile1
    {
	type            timeVaryingMappedFixedValue;
        offset          (0 0 0);
        setAverage      off;
	mapMethod 	planar; //nearest; //planar is default
    }
    profile4
    {
	type            timeVaryingMappedFixedValue;
        offset          (0 0 0);
        setAverage      off;
	mapMethod 	planar; 
		
    }   
    overflow
    {
	type zeroGradient;
    }
    "(frontAndBack|lowerWall|upperWall)"
    {
        type            slip ;
    }
    bath
    {
        type            slip;
    }
}
k
Code:
dimensions      [0 2 -2 0 0 0 0];

internalField   uniform 7.526400000000001e-06;

boundaryField
{
	"(profile1|profile4|profile1_lid|profile4_lid)"
	{
		type            turbulentIntensityKineticEnergyInlet;
		intensity       0.05; // Adjust based on turbulence intensity (e.g., 5%)
		value           $internalField;
	}
    overflow
    {
        type            inletOutlet;
        inletValue      $internalField;
        value           $internalField;
    }
    "(frontAndBack|lowerWall)"
    {
        type            zeroGradient;
    }
    "(bath|upperWall)"
    {
        type	kqRWallFunction; 
         value	uniform $internalField; 
    }
}
nut
Code:
dimensions      [0 2 -1 0 0 0 0];
// turbulent viscosity
internalField   uniform 0.0039970162311404244;//5.59e-5;

boundaryField
{
	"(overflow|frontAndBack|lowerWall)"
    {
		type            zeroGradient; 
    }

	"(profile1|profile4)"
    {

		type            calculated;
		value           uniform 0;
    }
	"(profile1_lid|profile4_lid)"
	{
		type            inletOutlet;
		inletValue      $internalField;
		value           $internalField; // Placeholder
	}
    "(bath|upperWall)"
    {
        type            nutUWallFunction;
        value           $internalField;
    }
}
omega
Code:
dimensions      [0 0 -1 0 0 0 0];

internalField   uniform 0.005;//0.0194;//calculated //0.00011846205005452487;

boundaryField
{  
    "(profile1|profile4)"
    {
        type            turbulentMixingLengthDissipationRateInlet;
        mixingLength    0.098; //d_discharge*0.07
        value           $internalField; 
    }
    overflow
    {
        type            zeroGradient;
    }
    "(frontAndBack|lowerWall)"
    {
        type            zeroGradient;
    }
    "(bath|upperWall)"
    {
        type            omegaWallFunction;
        value           uniform 0.1;
    }	
}
Attached Images
File Type: jpg cfdonline1.jpg (20.9 KB, 5 views)
File Type: png profile1_u.png (69.5 KB, 5 views)
File Type: png profile1_p.PNG (70.7 KB, 5 views)

Last edited by Jeggi; October 14, 2024 at 06:00. Reason: Zip file with case could not be attached. Clarified the text.
Jeggi is offline   Reply With Quote

Reply


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
UDF comilation error. urgent help please m zubair Fluent UDF and Scheme Programming 4 February 10, 2019 12:19
The method on dealing with velocity in static pressure outlet boundary condition mona.li CFX 2 September 30, 2017 02:33
Inlet & Outlet Velocity BC issue naiter OpenFOAM 3 December 19, 2012 08:14
commit velocity outlet to velocity inlet chelvistero OpenFOAM 0 March 27, 2010 04:46
VOF Outlet boundary condition in cfd - ace JM Main CFD Forum 0 December 15, 2006 09:07


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