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

[OpenFOAM] Stream function and wrong updating of calculated boundary condition

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   October 28, 2021, 10:48
Post [OpenFOAM] Stream function and wrong updating of calculated boundary condition
  #1
New Member
 
Jayabrata Dhar
Join Date: Nov 2018
Posts: 17
Rep Power: 8
jd87 is on a distinguished road
Hello everyone,

I am trying to solve the Darcy equations using the classical stream function formulation. Although it is a CLASSICAL CASE, I did not find any related thread regarding this topic, so decided to start a new thread. My question is simple, I solve for the stream function (named, p) using the LaplacianFoam and then find the velocities using the expressions (2D case):

Code:
volVectorField gradP = fvc::grad(p);
ux = -gradP.component(vector::Y);
uy = gradP.component(vector::X);
Then I define a velocity vector (U) as

Code:
const vector ii(1, 0, 0);
const vector jj(0, 1, 0);
U = ii*ux + jj*uy;
and save it at given time intervals. Boundary conditions for U (or ux and uy) are NOT read from any file, therefore when I save them, I get the obvious 'calculated' boundary values. Thereafter I use this U to calculate other equations (which is not the focus of the thread).

My right-left walls are cyclic and frontBack patches are empty. At the top and bottom walls (walls running parallel to x), p is set as uniform 0 since there is no penetration velocity (uy should be zero). From the expression above, uy at the top and bottom walls are just derivatives of p along x and must be zero (since p is constant at top and bottom walls). However, when I view the velocity file (U file), the calculated boundary values for uy at the top and bottom wall is not exactly 0. It has value one to two order magnitude lower than ux though (my ux is usually ~1e-03 and uy~1e-04 or lower, so nowhere close to eps of the system).

Can anybody shed light on why this is occurring and how to circumvent the issue? It would be very helpful if anyone can point out why this simple fulfilment of the boundary condition is not working.

PS: Later, I also tried to set uy as a separate file in 0-folder where the top and bottom conditions are set to uniform 0 and uy is read in each iteration using the

Code:
uy.correctBoundaryConditions();
command (Note: uy is not stored in future times, only U, the vectorField is stored). But the results remain the same, uy is not equal to zero at the top and bottom walls!!!
jd87 is offline   Reply With Quote

Reply

Tags
darcy flow, openfoam, stream function method


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
[swak4Foam] How to define boundary condition variables by using previosly defined variables? pawlo OpenFOAM Community Contributions 8 September 13, 2020 12:37
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 05:18
Wrong Boundary Conditions (maximum number of iterations) in compressibleInterDyMFoam silencebreak OpenFOAM Running, Solving & CFD 0 September 11, 2017 08:05
Setting up cyclic boundary condition KateEisenhower OpenFOAM Pre-Processing 6 January 11, 2017 18:17
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00


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