|
[Sponsors] |
August 7, 2020, 22:27 |
manipulating field values at the boundaries
|
#1 |
New Member
Christoph Kammer
Join Date: Jun 2020
Posts: 4
Rep Power: 5 |
Hello everyone!
I defined a field volTensorField Q ( IOobject ( "Q", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::AUTO_WRITE ), mesh, dimensionSet(0,0,0,0,0,0), "codedFixedValue" //"calculated" ); I need to manipulate the entries of Q at the boundary patches and thought I would do something like this forAll(mesh.boundaryMesh(), patchI){ forAll(mesh.boundary()[patchI], facei){ //Q.boundaryField()[patchI][facei] = tensor(1,0,0,0,1,0,0,0,1); Q.boundaryField()[patchI][facei].xx() = Foam::cos(..) // ..some assignment } } This won't compile throwing back the error "assignment of read-only location". Apparently the reference above doesn't allow assignments.. Does anyone have an idea how to resolve this issue? Any help is greatly appreciated, Thank you! |
|
August 7, 2020, 22:45 |
|
#2 |
New Member
Christoph Kammer
Join Date: Jun 2020
Posts: 4
Rep Power: 5 |
Never Mind,
changing Q.boundaryField()[patchI][facei].xx() = Foam::cos(..) // ..some assignment to Q.boundaryFieldRef()[patchI][facei].xx() = Foam::cos(..) // ..some assignment does the trick! |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to obtain pressure values on the zeroGradient boundaries of the domain? | deepbandivadekar | OpenFOAM Running, Solving & CFD | 2 | June 22, 2021 12:17 |
Field values at the boundary cells | vcvedant | OpenFOAM Running, Solving & CFD | 4 | August 2, 2017 17:50 |
display contour/map of differences for different field values (T, U, etc.) | msarkar | Main CFD Forum | 9 | August 30, 2013 09:43 |
display contour/map of differences for different field values (T, U, etc.) | msarkar | OpenFOAM Post-Processing | 0 | July 17, 2013 04:45 |
Appending field values to a file | teopetre | Fluent UDF and Scheme Programming | 2 | April 21, 2012 09:13 |