|
[Sponsors] |
October 11, 2011, 06:01 |
volPointInterpolation on boundaryField only?
|
#1 | |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 17 |
Hi all,
I want to make an interpolation from (boundary) cell faces to cell points. I know that an interpolation for the (whole) internalField of a mesh can be done using volPointInterpolation : Quote:
hbVol does only have values on the boundaryField patches, which where previously mapped using vsm.mapToVolume (FAM->FVM). When I do the above interpolation, hbVol boundaryField values are interpolated to the hbVolPoints internalField. Thats not exactly what I need... I need an interpolation from the boundary cell faces to the boundary cell points, both stored in the boundaryField! Is this possible? I guess I could make a mapping back from the internalField to the boundaryField, but I guess this could be done directly and without loosing accuracy. Furthermore, I do not need the interpolation for the whole mesh (which is done using above function), but only for the boundaryFields. Any suggestions? Arne Last edited by Arnoldinho; October 11, 2011 at 07:13. Reason: Changed content structure |
||
October 11, 2011, 13:18 |
|
#2 |
Senior Member
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 16 |
Have a look at sampleDict. you can sample data on patches and there are few interpolation schemes available.www.openfoam.com/docs/user/sample.php
|
|
October 11, 2011, 15:00 |
|
#3 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 17 |
Thanks doubstincfd. I guess I forgot to say that I need the interpolation during runtime, within th solver directly.
sampleDict seems to be working in postprocessing only. But I will have a look at the source code of it. Arne |
|
October 11, 2011, 16:15 |
|
#4 |
Senior Member
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 16 |
you are welcome. Let me know if it works. Else I will dig in more
|
|
October 11, 2011, 16:16 |
|
#5 |
Senior Member
Join Date: Nov 2009
Location: Michigan
Posts: 135
Rep Power: 16 |
Meanwhile:
psip_(volPointInterpolation::New(psi.mesh()).inter polate(psi)) in http://foam.sourceforge.net/docs/cpp/a04429_source.html |
|
October 12, 2011, 04:47 |
|
#6 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,089
Rep Power: 34 |
Hi Arne,
You could use primitivePatchInterpolation to interpolate from boundary faces to boundary points (and vice versa). i.e. Code:
//- set-up interpolator primitivePatchInterpolation patchInterpolator ( mesh.boundaryMesh()[patchOfInterestIndex] ); //- perform interpolation vectorField faceValues = patchInterpolator.pointToFaceInterpolate<vector> ( pointValues ); Philip |
|
October 12, 2011, 10:23 |
|
#7 | |||
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 17 |
Bigphil, thanks for the hint. This is exactly what I was looking for and seems to be doing what it should.
1. Now I have another problem, mainly in the syntax of OF: I want to store the interpolated boundary points values in a previously declared pointScalarField hbVolPoints. Quote:
Quote:
2. Another one: I'm also missing the correct syntax for storing the values of a pointScalarField hbVolPoints into components of a pointVectorField hbVolPoints2. Quote:
Any clue? |
||||
October 12, 2011, 10:35 |
|
#8 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,089
Rep Power: 34 |
Arne,
Good to hear that it is starting to work. Hmnnn you could always use a forAll loop to set each value: Code:
forAll(hbVolPoints.boundaryField()[patchi], pointi) { hbVolPoints.boundaryField()[patchi][pointi] = hbVolPointsPatch[pointi]; } I am not sure why your current method does not work, maybe the "=" operator is not defined for this. Philip |
|
October 12, 2011, 11:29 |
|
#9 | |||
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 17 |
Quote:
Quote:
Quote:
|
||||
October 12, 2011, 11:46 |
|
#10 |
Super Moderator
Philip Cardiff
Join Date: Mar 2009
Location: Dublin, Ireland
Posts: 1,089
Rep Power: 34 |
Hmnnn I am not sure, maybe someone else has an idea.
I am not very familiar with pointScalarFields. What happens when you: Info << hbVolPoints.boundaryField()[patchi] << endl; Does it just print out a scalarfield? Philip |
|
October 12, 2011, 12:00 |
|
#11 | ||
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 17 |
Quote:
Quote:
hbVolPoints.boundaryField()[patchi] has not been initialized with any values before. Arne |
|||
October 12, 2011, 13:00 |
|
#12 | |||
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 17 |
Hi,
Quote:
Quote:
Quote:
|
||||
March 11, 2013, 09:55 |
|
#13 |
Senior Member
HECKMANN Frédéric
Join Date: Jul 2010
Posts: 249
Rep Power: 16 |
Hello,
I know this topic is a bit old, but did you find a solution to your problem ? Can you provide the final version of your technique ? Thx |
|
October 27, 2014, 08:37 |
|
#14 | |
Member
Fei Fan
Join Date: Jun 2013
Location: NanJing, China
Posts: 54
Rep Power: 12 |
Quote:
I'm the student of Yuchuan Bai of Tianjin University, I get my master degree on Ocean Univerity of China. my master tutor is Bingchen Liang. Both of them attend the China-Germany seminar on september. They saied you do a good job on local scour. so I want to following with you. the problem you mentioned above make me confused. You mapped the internalField of FAM to the boundayField of FVM, which was stored in the centre of volume. And you want to get the displacement of boundary point. so you need a interpolated. what confused me is that, why you interpoated from the cell face to cell point. On my understood, the variables are stored on Vol centre, so, the interpolated should be from vol to point. could you make me clear about this? In your paper, 3D sand slide model is used. I have understood the 2D sand slide model, but for 3D ,I have some problem. could you give me some hints about how does is work? Thanks . Best Regards Fan Fei |
||
October 31, 2014, 02:52 |
|
#15 |
Senior Member
Arne Stahlmann
Join Date: Nov 2009
Location: Hanover, Germany
Posts: 209
Rep Power: 17 |
Hei Fanfei,
yes you are right, we talked about OF scour modeling at CGJoint Sysposium here in Hanover. Coming to your questions: 1. If I'm not totally wrong now - I wrote the source code almost two years ago and do not have easy access to it right now - the interpolation FAM (after solving the Exner equation) to FVM is carried out to the FVM boundary faces, not the volume! So from FAM volume (which is actually 2D) center to FVM boundary face center. In order to calculate the mesh motion, which I in my case did for the mesh points and not the volumes, the boundary face center values where then calculated to the boundary points, serving as 'boundary condition' for the inner point motion of the entire 3D domain. 2. For the sand slide routine, I did this using the bed load calculation procedure I implemented. If you give qb from the bed load calculation an 'artificial' high and meaningful calculated value with limiter function in the direction of the steepest slope of the boundary face, this can serve as a sliding procedure. In a first step, you of cource have to calculate the direction of steepest slope, which is however quite simple, as you can easily get all boundary face angles from the boundary (boundary faces/points) domain. Greetings, Arne |
|
November 3, 2014, 05:50 |
|
#16 | |
Member
Fei Fan
Join Date: Jun 2013
Location: NanJing, China
Posts: 54
Rep Power: 12 |
Quote:
Hi Arne: Thank you very much. I'm clear to those now. Greetings, Fan fei |
||
November 3, 2014, 21:50 |
|
#17 | |
Member
Fei Fan
Join Date: Jun 2013
Location: NanJing, China
Posts: 54
Rep Power: 12 |
Quote:
[SIZE="5"] I'm so sorry to trouble you again. I have some question about your sand slid model. From what I understood. First, the bed level change was calculated with bed load model, and stored in face centre. Then, the displacement of point was interploated, and mesh was update. And then, the steepest slope angle of boundary face was calcuted. If the steepest angle of a face exceed the repose angle, the face should be adjusted. However,due to the mass conservation, the centroid of face shouldn't move , in order to statisfy the need of angle, the face should rotate around the centroid of face. And the displacement of point of this face are solve. Is that right? Best regards Fan Fei |
||
Thread Tools | Search this Thread |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Difference between 'internalField' and 'boundaryField'? | Rusty Velo | OpenFOAM | 21 | September 20, 2016 06:29 |
Need help with boundary conditions: open to atmosphere | Wolle | OpenFOAM | 2 | April 11, 2011 07:32 |
boundaryField vs. internalField | sebonator | OpenFOAM | 10 | January 24, 2011 16:43 |
pipe flow with heat transfer | Fabian | OpenFOAM | 2 | December 12, 2009 04:53 |
changing the names and types of a boundaryField | gerado | OpenFOAM Running, Solving & CFD | 0 | March 24, 2009 08:55 |