|
[Sponsors] |
How to extract ONLY ONE Boundary data to make a VectorField File from volVectorField |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
April 11, 2016, 19:05 |
How to extract ONLY ONE Boundary data to make a VectorField File from volVectorField
|
#1 |
New Member
Yi Han
Join Date: Oct 2013
Location: Laramie WY
Posts: 15
Rep Power: 13 |
I have a volVectorField file which reflects the face and cell center of the whole block. Now I need to extract only the Inlet Boundary VectorField. Could anyone tell me how can I do it?
Staring file : /--------------------------------- C++ -----------------------------------\ | | | \ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \ / O peration | Version: 2.1.1 | | \ / A nd | Web: www.OpenFOAM.org | | \/ M anipulation | | *---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class volVectorField; location "0"; object HAG_BC; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // dimensions [0 1 0 0 0 0 0]; internalField uniform (0 0 0); boundaryField { east { type calculated; value uniform (0 0 0); } lower { type calculated; value uniform (0 0 0); } north { type calculated; value uniform (0 0 0); } south { type calculated; value uniform (0 0 0); } upper { type calculated; value uniform (0 0 0); } west { type calculated; value nonuniform List<vector> 25704 ( (9.19230379557e-13 15.015839523 1.65544315243) (7.49421465245e-13 45.1163422992 1.61844085759) (1.09919448444e-12 75.2338386748 2.04987578236) ...... ) //================================================== ===============// Want: /*--------------------------------*- C++ -*----------------------------------*\ | ========= | | | \\ / F ield | OpenFOAM: The Open Source CFD Toolbox | | \\ / O peration | Version: 2.2.2 | | \\ / A nd | Web: www.OpenFOAM.org | | \\/ M anipulation | | \*---------------------------------------------------------------------------*/ FoamFile { version 2.0; format ascii; class vectorField; object values; } // * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * // 25704 ( (9.19230379557e-13 15.015839523 1.65544315243) (7.49421465245e-13 45.1163422992 1.61844085759) (1.09919448444e-12 75.2338386748 2.04987578236) (1.00178036208e-12 105.373361965 2.31514277443 ... ... ) |
|
April 12, 2016, 07:09 |
|
#2 |
New Member
Volker
Join Date: Aug 2014
Location: Germany
Posts: 16
Rep Power: 12 |
Hi there,
I understand that you just want to process the strings in the output file. Another option - however requiring source code changes - would be to print out something like Code:
Info << HAG_BC.boundaryField()[5] ; I did something similar you want to do, but for scalar fields, see example in the attachment. I think one could modify that to process vector fields, too. |
|
April 14, 2016, 13:11 |
|
#3 | |
New Member
Yi Han
Join Date: Oct 2013
Location: Laramie WY
Posts: 15
Rep Power: 13 |
Quote:
Hi volker1, I have figured it out a way which will not touch the structure of the volVectorField. I just add 2 statement before and after the Input part as: // Read the Heigh_Above_Ground data (Try volVectorField, not complete) const fvMesh& mesh = patch().boundaryMesh().mesh(); //Add 1st volVectorField Hightprof ( IOobject ( "HAG_BC", this->db().time().timeName(), mesh, IOobject::MUST_READ, IOobject::NO_WRITE ), mesh ); const label inletPatchID = mesh.boundaryMesh().findPatchID("west"); // Add 2nd vectorField faceCenterHgtag = Hightprof.boundaryField()[inletPatchID]; But thanks also for your solution. It is another method to learn. Thanks , Yi |
||
Tags |
openfoam |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[swak4Foam] funkyDoCalc with OF2.3 massflow | NiFl | OpenFOAM Community Contributions | 14 | November 25, 2020 04:30 |
[waves2Foam] Waves2Foam Related Topics | ngj | OpenFOAM Community Contributions | 660 | August 20, 2018 13:39 |
Question about heat transfer coefficient setting for CFX | Anna Tian | CFX | 1 | June 16, 2013 07:28 |
pisoFoam compiling error with OF 1.7.1 on MAC OSX | Greg Givogue | OpenFOAM Programming & Development | 3 | March 4, 2011 18:18 |
OpenFOAM 1.7.1 installation problem on OpenSUSE 11.3 | flakid | OpenFOAM Installation | 16 | December 28, 2010 09:48 |