|
[Sponsors] |
June 7, 2016, 11:01 |
Object of type GeometricBoundaryField
|
#1 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Dear all,
I want to change the boundary types of a special pointScalarField. As I can figure out with doxygen, I need the GeometricBoundaryField for my further manipulations. Sofar so good, done: Code:
pointScalarField::GeometricBoundaryField& gBF = pointMotionU_.boundaryField(); Any suggestions are appreciated. Thanks in advance. PS: To explain the problem more precisely. I want to use ACMI with moving meshes (not solidBodyMotion). Hence we create a pointScalarField called pointMotionU_. The problem now is that the patch types in that field for ACMI boundaries are of type ACMI. The problem is that these patches should become zeroGradient.
__________________
Keep foaming, Tobias Holzmann Last edited by Tobi; June 7, 2016 at 12:24. |
|
June 7, 2016, 13:40 |
|
#2 |
New Member
|
Hi Tobias,
When you say operator=() did you mean: //- Assignment to FieldField<PatchField, Type> void operator=(const FieldField<PatchField, Type>&); To change an individual patch's type, I think this is the best choice. B.R. |
|
June 7, 2016, 18:37 |
Doxygen
|
#3 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hey,
thanks for the replay. I made a beautiful mistake. I always checked out Doxygen for 2.3.1 but I use 3.0+. I checked the online version and could not get the same classes that I have in 2.3.1. Tomorrow I will compile Doxygen for 3.0+ and recheck the stuff. I will check your funtion and give a replay. Thanks in advance. Tobi
__________________
Keep foaming, Tobias Holzmann |
|
June 8, 2016, 09:13 |
|
#4 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Dear Bryan (?), B.R.
The problem at the moment (may be I am too focused on the patch type change) is how to do exactly what you have. Here the code that I already have (nothing special): Code:
Info<< "Manipulating patch fields for ACMI\n" << endl; pointScalarField::GeometricBoundaryField& gBF = pointMotionU_.boundaryField(); const wordList& typeNames = gBF.types(); Info<< gBF << endl; forAll(typeNames, n) { if (typeNames[n] == "cyclicACMI") { //- Get patchField //patchField& pF = gBF[](n); //- Set new patchField with new patch type //gBF[](n)= } } Any suggestions are appreciated. Thanks in advance, Tobi
__________________
Keep foaming, Tobias Holzmann |
|
June 8, 2016, 11:53 |
|
#5 |
New Member
|
Hi Tobias,
As far as I know: Code:
typedef GeometricField<scalar, pointPatchField, pointMesh> pointScalarField; Can you try this: Code:
Info<< "Manipulating patch fields for ACMI\n" << endl; pointScalarField::GeometricBoundaryField& gBF = pointMotionU_.boundaryField(); Info<< gBF << endl; const wordList& typeNames = gBF.types(); forAll(typeNames, i) { if (typeNames[i] == "cyclicACMI") { FieldField<pointPatchField, scalar>& xxx = gBF; PtrList<pointPatchField<scalar> >& yyy = xxx; const pointPatch& pp = yyy[i].patch(); const DimensionedField<scalar, pointMesh>& pif = yyy[i].dimensionedInternalField(); yyy.set(i, new zeroGradientPointPatchField<scalar>(pp, pif); } } Best Regard |
|
June 8, 2016, 14:04 |
|
#6 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Hi,
thanks for the replay. I also tested out something different: Code:
pointScalarField tmp ( IOobject ( "tmp", runTime.timeName(), mesh, IOobject::NO_READ, IOobject::NO_WRITE ), point::New(mesh), dimensionedScalar("tmp", dimensionSet(0,1,-1,0,0,0,0), scalar(0)), newTypeNames, oldTypeNames ); Info<< tmp.boundaryField() << endl; pointMotionU_ = tmp; Info<< pointMotionU_.boundaryField() << endl; Code:
GeometricField (const IOobject &, const Mesh &, const dimensioned< Type > &, const wordList &wantedPatchTypes, const wordList &actualPatchTypes=wordList()) Constructor given IOobject, mesh, dimensioned<Type> and patch types.
__________________
Keep foaming, Tobias Holzmann |
|
June 10, 2016, 05:15 |
|
#7 |
Super Moderator
Tobias Holzmann
Join Date: Oct 2010
Location: Bad Wörishofen
Posts: 2,711
Blog Entries: 6
Rep Power: 52 |
Dear all,
first, thank you for the replay. The code you mentioned is working and I get the modified patch types for the ACMI. The solution looks better but still I get interpolation somehow. Hence I did the same for the volMotionU_ field. After that the stuff looked even better but I still get interpolations in between the point field of the ACMI patches (if they get connected). I do not know why but it is based on the ACMI type. See the pictures. Therefore, I need more investigations how to manipulate the ACMI patch values. If this is done, I think the ACMI will also work fine with dynamic meshes motion (not zone motion). Maybe I will focus on the manipulation on the pointScalarFields but there is only less time doing this. I thought after changing the ACMI patch types it is done, but not as I saw, not really (I was too enthusiastic) . Maybe it would be even better to manipulate the ACMI patch class somehow to forbid interpolation for the motion fields. Thanks epi_c for the kind help. Again I learned more about programming in FOAM. Up to now, I think I got a good insight into what we have to manipulated but it is not finished . if I get any progress I will let you know.
__________________
Keep foaming, Tobias Holzmann |
|
June 10, 2016, 05:46 |
|
#8 |
New Member
|
Hi Tobias,
I'm glad the code is working and the result improved. Best Regards |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
second order schemes | marine | OpenFOAM | 67 | April 11, 2022 19:19 |
[OpenFOAM.org] compile error in dynamicMesh and thermophysicalModels libraries | NickG | OpenFOAM Installation | 3 | December 30, 2019 01:21 |
Time continuity error & FAN patch | Zephiro88 | OpenFOAM Running, Solving & CFD | 4 | April 22, 2015 13:39 |
[GAMBIT] periodic faces not matching | Aadhavan | ANSYS Meshing & Geometry | 6 | August 31, 2013 12:25 |
Flow Around a Cylinder | ronaldo | OpenFOAM | 5 | September 18, 2009 09:13 |