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

Problems with applying thoms formula

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   February 15, 2022, 03:54
Default Problems with applying thoms formula
  #1
New Member
 
Patryk
Join Date: Dec 2021
Posts: 5
Rep Power: 4
Patryk Stawicki is on a distinguished road
Hello everyone. I'm working on a solver that solves vorticiy-stream function equation. One of the things I wanted to apply, to one of my case, was 0 velocity at the boundary. To achieve that, I wasn't simply applying 0 velocity at the boundary, since I'm not using primitive variables. My idea was to, make such boundary condition that will create vortex itself, that in result of "mixing" will create a 0-velocity slice near the wall.

So this is a code of my Thoms formula, atleast this is what i think its called.

Code:
const fvPatch& boundaryPatch = patch(); // this patch
            // make a reference to the mesh so that I can access variables
            const fvMesh& mesh = patch().boundaryMesh().mesh();
            const volScalarField& psi = db().lookupObject<volScalarField>("psi");
            const volScalarField& OM = db().lookupObject<volScalarField>("OM");
            label inletPatchID = mesh.boundaryMesh().findPatchID("bottom");
            label inletPatchID2 = mesh.boundaryMesh().findPatchID("left");
            // Get reference to boundary field value
            const scalarField& psib = psi.boundaryField()[inletPatchID];  
            const scalarField& OMb = OM.boundaryField()[inletPatchID];
            
            // get coordinate for cell centres
            const fvPatchVectorField& centre = mesh.C().boundaryField()[inletPatchID];
            const fvPatchVectorField& centreleft = mesh.C().boundaryField()[inletPatchID2];
            //const fvPatchVectorField& centre = mesh.C().boundaryField()[inletPatchID];
            
            //area of patch
            scalarField areasc = mesh.magSf().boundaryField()[inletPatchID];
            scalarField OMwall = OMb;
            scalar area = sum(areasc);
            
             scalar d;
         
          // THOMAS FORMULA      
			forAll (psib, cellI)
			{
				d = mag(mesh.C()[cellI].component(vector::Y) - centre[cellI].component(vector::Y));
				OMwall [cellI] = -2.0*psib[cellI]/(d*d);
			}
			Info << (OMwall);

         operator==(OMwall);
Generally all i want to achieve is the vorticity at the wall that will be equal to:

\omega=\frac{2*\psi}{\Delta y^2}
Patryk Stawicki is offline   Reply With Quote

Reply

Tags
boundary condition, cfd, vorticity


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
[solids4Foam] Problems while validating Turek and Hron (2006) FSI2 and FSI3 problems in solids4Foam subhasisa.rath OpenFOAM CC Toolkits for Fluid-Structure Interaction 0 September 6, 2021 17:37
What is the reason for the lack of convergence in solving thermodynamic problems? NoITMan Main CFD Forum 0 May 25, 2021 07:52
[ICEM] Problems with coedge curves and surfaces tommymoose ANSYS Meshing & Geometry 6 December 1, 2020 12:12
Problems with applying emissivity mahendrark FLUENT 2 June 15, 2020 08:13
Needed Benchmark Problems for FSI Mechstud Main CFD Forum 4 July 26, 2011 13:13


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