|
[Sponsors] |
Update boundary values and correctBoundaryConditions() |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 26, 2021, 17:21 |
Update boundary values and correctBoundaryConditions()
|
#1 |
Member
Join Date: Feb 2020
Posts: 90
Rep Power: 6 |
Hello to all,
I would like to have some input on how to update the boundary values of a field. I created a field called test: Code:
volScalarField test ( IOobject ( "test", runTime.timeName(), mesh, IOobject::MUST_READ, IOobject::AUTO_WRITE ), mesh, dimensionedScalar("test_", dimless, 2) ); Code:
dimensions [0 0 0 0 0 0 0]; internalField uniform 0; boundaryField { "(.*)" { type fixedValue; value uniform 2; } } Code:
test = test+test Code:
test.write(); Code:
dimensions [0 0 0 0 0 0 0]; internalField uniform 4; boundaryField { myPatch1 { type calculated; value uniform 4; } myPatch2 { type calculated; value uniform 4; } myPatch3 { type calculated; value uniform 4; } myPatch4 { type calculated; value uniform 4; } myPatch5 { type calculated; value uniform 4; } } How can I do this? I could just loop over the patch faces and adjust the value but is there a function for this? If I try: Code:
test.correctBoundaryConditions(); Can anyone clarify this ? |
|
March 27, 2021, 09:04 |
|
#2 |
New Member
Giovanni Luddeni
Join Date: Jan 2021
Posts: 14
Rep Power: 5 |
I don't know the answer but I have an idea.
As you know, a field has a boundary (list of boundary faces) and an internal field (list of cells). Maybe you could try to sum the internal fields instead of the whole fields. I had a similar problem anyway, and I just ended up cycling on the cells. |
|
March 28, 2021, 14:58 |
|
#3 | |
Member
Join Date: Feb 2020
Posts: 90
Rep Power: 6 |
Quote:
That is a fix, but I would like to know why this happens. In the PEqn of a lot of solvers you see: Some operation on U followed by the update of the boundary conditions: e.g., in PISO foam Code:
U = HbyA - rAU*fvc::grad(p); U.correctBoundaryConditions(); You can also see this applied to p_ rhg in several solvers. I would like to know what it is doing (or what I did wrong in calling it), since the function call 3 functions: Code:
this->setUpToDate(); storeOldTimes(); boundaryField_.evaluate(); |
||
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
3D Windturbine simulation in SU2 | k.vimalakanthan | SU2 | 15 | October 12, 2023 05:53 |
Boundary face values in density based solver? | Chen Zhi | FLUENT | 3 | November 28, 2019 06:51 |
FLUENT: Reference values, Boundary Conditions, Drag Co-efficient and Downforce | Harshal | FLUENT | 21 | September 12, 2017 11:12 |
Co-simulation, map values to a non-convective boundary | Jimmy123 | STAR-CCM+ | 0 | September 6, 2013 07:01 |
RPM in Wind Turbine | Pankaj | CFX | 9 | November 23, 2009 04:05 |