|
[Sponsors] |
February 8, 2021, 03:59 |
Change Boundary Condition Type From Solver
|
#1 |
New Member
Join Date: Feb 2021
Posts: 2
Rep Power: 0 |
Hi guys. I want to change boundary condition type within the solver. how can I do it. for example initially Pressure boundary condition on a patch is fixedFluxPressure and I want when I reach certain time during simulation, change it to fixed value with specified value. (I want to do this from solver)
boundaryField { Left { type fixedFluxPressure; } . .// other BCs . } then change it to : boundaryField { Left { type fixedValue; value 1e5; } . .// other BCs . } |
|
February 8, 2021, 06:16 |
I found it!
|
#2 |
New Member
Join Date: Feb 2021
Posts: 2
Rep Power: 0 |
finally i found it and i leave this reply to my post maybe help another one with this issue some days later.
to change boundary condition type for a field, first you must find patch id of that face. label leftFacePatchID = mesh.boundaryMesh().findPatchID("Left"); const polyPatch& leftPatch = mesh.boundaryMesh()[leftFacePatchID]; then you can set boundary type with this syntax: (for example if pressure is desired field with p notation) p.boundaryFieldRef().set(leftFacePatchID , fvPatchField<scalar>::New("fixedValue", mesh.boundary()[leftFacePatchID ],p)); in above, first argument of New() must be boundary type, and for example here it sets BC to fixedValue. then to assign a value to this fixed value BC, we must go through all cells face in patch and set desired value. forAll(leftPatch , faceI) { p.boundaryFieldRef()[leftFacePatchID][faceI] = pressureValue; } |
|
Tags |
boundary condition, cfd, solver |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Radiation in semi-transparent media with surface-to-surface model? | mpeppels | CFX | 11 | August 22, 2019 08:30 |
My radial inflow turbine | Abo Anas | CFX | 27 | May 11, 2018 02:44 |
Error - Solar absorber - Solar Thermal Radiation | MichaelK | CFX | 12 | September 1, 2016 06:15 |
Question about heat transfer coefficient setting for CFX | Anna Tian | CFX | 1 | June 16, 2013 07:28 |
[swak4Foam] Air Conditioned room groovyBC | Sebaj | OpenFOAM Community Contributions | 7 | October 31, 2012 15:16 |