|
[Sponsors] |
March 7, 2013, 17:11 |
Modifying Velocity Boundry Field
|
#1 |
Member
Chris L
Join Date: Sep 2012
Posts: 53
Rep Power: 13 |
Hi all,
I am looking for help with the following code problem. I'd like the ability to adjust the boundary fields in code without using swak4foam. I've added the following snippet of code to bubbleFoam (OF v2.0): Code:
label outletPatchID = mesh.boundaryMesh().findPatchID("outletBottom"); Ua.boundaryField()[outletPatchID] = Uabar/ gSum( mesh.magSf().boundaryField()[outletPatchID] * alpha.boundaryField()[outletPatchID]) / gSum( mesh.magSf().boundaryField()[outletPatchID] ); Info<< nl << "Corrected Boundry Velocity = " << Uabar/ gSum( mesh.magSf().boundaryField()[outletPatchID] * alpha.boundaryField()[outletPatchID]) / gSum( mesh.magSf().boundaryField()[outletPatchID] ) << endl; Info<< "Current Boundry Field = " << endl << Ua.boundaryField()[outletPatchID] << nl << endl; Code:
Courant Number mean: 0.00492361038 max: 0.025444501 deltaT = 0.01 Corrected Boundry Velocity = (0 -0.144231961 0) Current Boundry Field = type fixedValue; value uniform (0 -0.05 0); I would have expected both the outputs for current/corrected boundary to be the same value. However, as the debug info shows Ua.boundryField[] doesn't change after I assign it a new value. Any help would be appreciated. |
|
March 7, 2013, 17:21 |
|
#2 |
Member
Chris L
Join Date: Sep 2012
Posts: 53
Rep Power: 13 |
Just as a follow-up
I was mimicking this snippet of code also found in bubbleFoam, which allows explicit declaration of boundry field values using the method .boundaryField()[patchi]. Code:
// PEqn.H snippit forAll(p.boundaryField(), patchi) { if (isA<zeroGradientFvPatchScalarField>(p.boundaryField()[patchi])) { phiDraga.boundaryField()[patchi] = 0.0; phiDragb.boundaryField()[patchi] = 0.0; } } |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
A Question About Setting Whole Velocity Field Using "Proflie" in FLUENT | adsl17754 | FLUENT | 5 | July 31, 2018 04:29 |
dambreak tutorial's weird velocity field. | sharonyue | OpenFOAM | 8 | October 18, 2016 14:57 |
velocity field | Faiz Ahmed | Main CFD Forum | 0 | March 5, 2006 10:11 |
Variables Definition in CFX Solver 5.6 | R P | CFX | 2 | October 26, 2004 02:13 |
transient temperature field with constant velocity | Törnquist | CFX | 0 | September 16, 2003 04:22 |