|
[Sponsors] |
February 15, 2022, 03:54 |
Problems with applying thoms formula
|
#1 |
New Member
Patryk
Join Date: Dec 2021
Posts: 5
Rep Power: 4 |
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); = |
|
Tags |
boundary condition, cfd, vorticity |
|
|
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 |