|
[Sponsors] |
Accessing boundary patch face coordinates for codeStream BC |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
September 18, 2024, 08:22 |
Accessing boundary patch face coordinates for codeStream BC
|
#1 |
New Member
talop
Join Date: Feb 2023
Posts: 8
Rep Power: 3 |
Good day,
I am trying to simulate natural convection from a hot cavity in air using incompressible ideal gas model. Unfortunately, simulations crash or give unrealistic flow fields such as thin jets of air flowing in from the outlet patch. I think the initial pressure field "p" is the suspect and managed to initialize the internal field with hydrostatic effects (p = p_ref + rho*delta_h). The gravity acts along the -y direction. For the boundary patches, I have tried the following BC: Code:
outlet_1 { type calculated; value #codeStream { codeInclude #{ #include "fvCFD.H" #}; codeOptions #{ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude #}; //libs needed to visualize BC in paraview codeLibs #{ -lmeshTools \ -lfiniteVolume #}; code #{ const IOdictionary& d = static_cast<const IOdictionary&> ( dict.parent().parent() ); const fvMesh& mesh = refCast<const fvMesh>(d.db()); // const surfaceVectorField& Cf = mesh.Cf(); const label id_o1 = mesh.boundary().findPatchID("outlet_1"); const fvPatch& patch_o1 = mesh.boundary()[id_o1]; const vectorField& Cf= patch_o1.Cf(); scalarField p_Outlet_1(patch_o1.size(), 100000.0); scalar p_Atm = 100000.0; scalar rho_Atm = 1.3772; // = 100000/(287*253) scalar delta_h = 0.8; forAll(p_Outlet_1, j) { const scalar y = Cf()[j][1]; p_Outlet_1[j] = p_Atm + (delta_h - y)*rho_Atm*9.81; } writeEntry(os,"", p_Outlet_1); #}; }; } Code:
const scalar y = Cf()[j][1]; Running the code for one patch and initializing the others as type calculated and value uniform 100000.0 did not change the problem. I am using OpenFOAM v10 (from the foundation) |
|
Tags |
boundary condition, codedstream, face center coordinate |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[snappyHexMesh] sHM layer process keeps getting killed | MBttR | OpenFOAM Meshing & Mesh Conversion | 4 | August 15, 2016 04:21 |
[mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 19:57 |
[blockMesh] non-orthogonal faces and incorrect orientation? | nennbs | OpenFOAM Meshing & Mesh Conversion | 7 | April 17, 2013 06:42 |
[Netgen] Import netgen mesh to OpenFOAM | hsieh | OpenFOAM Meshing & Mesh Conversion | 32 | September 13, 2011 06:50 |
[blockMesh] Axisymmetrical mesh | Rasmus Gjesing (Gjesing) | OpenFOAM Meshing & Mesh Conversion | 10 | April 2, 2007 15:00 |