|
[Sponsors] |
October 25, 2016, 19:12 |
Extract Velocity Profile
|
#1 |
Senior Member
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10 |
Hello to all,
i want to extract the velocity profile at the outlet of my channel for using it as initial condition in another simulation. My question is: how can i extract it? The only way i found till now is the "readFields" tool but i don't know how to adapt it for the profile over a boundary. Can someone explain me how to modify it? Code:
readFields1 { type readFields; functionObjectLibs ("libfieldFunctionObjects.so"); ... fields (U p); } Thank for help and your time. Roberto |
|
October 26, 2016, 05:45 |
|
#2 |
New Member
Join Date: Jun 2016
Location: Malaga, Spain
Posts: 15
Rep Power: 10 |
There is a tool, that seems that is what you are searching for, MapFields
https://openfoamwiki.net/index.php/MapFields |
|
October 26, 2016, 13:13 |
|
#3 | |
Senior Member
Timofey Mukha
Join Date: Mar 2012
Location: Stockholm, Sweden
Posts: 119
Rep Power: 14 |
Quote:
What do you mean by "profile"? If it is a surface of a line -- use the sample utility. |
||
October 27, 2016, 10:05 |
|
#4 |
Senior Member
Join Date: Mar 2016
Location: Bergamo
Posts: 157
Rep Power: 10 |
||
October 27, 2016, 10:25 |
|
#5 | |
Senior Member
Timofey Mukha
Join Date: Mar 2012
Location: Stockholm, Sweden
Posts: 119
Rep Power: 14 |
Quote:
If you can live with using face-values at the outlet instead, use the sample utility for surface-sampling. If you really need the cell values, you might have to code your self. It is possible to grab the cell-center value associated with the patch-face, so it be doable. Explor the fvPatchField classes and ralated things for that. Best, Timofey |
||
October 28, 2016, 00:18 |
|
#6 | |
Member
Ping Chang
Join Date: Feb 2016
Location: Perth
Posts: 93
Rep Power: 10 |
Quote:
I think you can achieve this by using ParaView. Using the "select cells on" function, then you can select the cells on the outlet. Then you can read the data on the cells which you chose and output the data on the cells. Regards, Ping |
||
December 15, 2018, 12:18 |
Code snippet to write outlet velocity as an fixedValue boundary condition
|
#7 |
New Member
Join Date: Nov 2016
Posts: 10
Rep Power: 10 |
This code snippet will extract the outlet velocity of a case on the patch named "outlet" and then write the output formatted as a fixedValue BC for a velocity inlet. Just copy and past the buffer output into your 0/U file.
Paste the following into the bottom of your solver and compile (wmake): const label& patchID = mesh.boundaryMesh().findPatchID("outlet"); const fvPatch& outPatch = mesh.boundary()[patchID]; const fvPatchField<vector>& outU = outPatch.lookupPatchField<volVectorField, vector>("U"); const vectorField outUvalues = outU.patchInternalField(); Info << " type fixedValue;" << endl; Info << " value nonuniform List<vector>" << endl; Info << " " << outUvalues.size() << endl; Info << " (" << endl; forAll(outUvalues,vecI) { Info << " (" << outUvalues[vecI][0] << " 0 0)" << endl; } Info << " );" << endl; Last edited by victorious_BIG; December 15, 2018 at 12:19. Reason: typo |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[UDF] Relative coordinates in logarithmic velocity profile | cfdworker | Fluent UDF and Scheme Programming | 25 | July 13, 2017 04:44 |
3d velocity profile at velocity inlet | swethaprakash | FLUENT | 3 | September 1, 2015 03:10 |
[swak4Foam] groovyBC error: velocity profile (2D) >> what's wrong? | vitorspadeto | OpenFOAM Community Contributions | 4 | June 19, 2014 16:31 |
[boundary condition] logarithmic velocity profile | cfdworker | FLUENT | 2 | April 18, 2009 00:36 |
Prescribed inflow velocity profile - how to? | Alan | Main CFD Forum | 10 | October 28, 2005 13:14 |