|
[Sponsors] |
December 22, 2018, 20:02 |
Read .csv ffile in codeStream
|
#1 |
Member
Akshay Patil
Join Date: Nov 2015
Location: Pune, India
Posts: 35
Rep Power: 11 |
Hello everyone,
I am trying to implement a simple codeStream implementation for inlet boundary condition. I have a .dat file which is stored in postProcessing/volFlowRateSurface/0/surfaceFieldValue.dat which looks something like this Code:
# Region type : sampledSurface sampleSurfaceDict # Faces : 2880 # Area : 1.596839e+02 # Time areaNormalIntegrate(U) 0.001 (1.339634e+00 0.000000e+00 0.000000e+00) 0.002 (2.785413e+00 0.000000e+00 0.000000e+00) So far I could not even build the boundary condition logic since I cannot import the value. I assume it should follow something like this. Code:
INLET { type variableHeightFlowRateInletVelocity; flowRate //Set the value for flowRate using codeStream #codeStream { codeInclude #{ #include "fvCFD.H" #include "IOstream" //Not sure if this is the right library to include for reading a .csv file #}; codeOptions #{ -I$(LIB_SRC)/finiteVolume/lnInclude \ -I$(LIB_SRC)/meshTools/lnInclude #}; codeLibs #{ -lmeshTools \ -lfiniteVolume #}; code #{ //This sets the time index, which will be used to locate the outflow value from file scalar t = this->db().time().value() //Introduce t scalar for indexing the .csv file later //Import the csv file (say) with name "foo" //Set initial flow rate value if(t = 0) { scalar flowRate = 0 flowrate.write("",os) } else { //Index the .csv file //Pseudo Code as below scalar Inflow //construct a variable //Index through the .csv file Inflow = foo[t-1] flowRate.write("",os) } #}; }; alpha alpha.water; value uniform (0 0 0); } |
|
Tags |
boundary condition u, codestream, csv files, programming |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Read Force Report by UDF | denis.sanga@hotmail.it | FLUENT | 1 | June 1, 2018 10:11 |
Workbench Parametric Runs - Obtaion .csv files Automatically | nikos_ | FLUENT | 3 | April 3, 2017 04:14 |
[mesh manipulation] Importing Multiple Meshes | thomasnwalshiii | OpenFOAM Meshing & Mesh Conversion | 18 | December 19, 2015 19:57 |
[Commercial meshers] fluentMeshToFoam multidomain mesh conversion problem | Attesz | OpenFOAM Meshing & Mesh Conversion | 12 | May 2, 2013 11:52 |
999999 (../../src/mpsystem.c@1123):mpt_read: failed:errno = 11 | UDS_rambler | FLUENT | 2 | November 22, 2011 10:46 |