|
[Sponsors] |
June 10, 2020, 12:06 |
Implementing a B.C. from a csv
|
#1 |
New Member
Sibo Anthony Athikho
Join Date: Apr 2020
Posts: 2
Rep Power: 0 |
Dear Foamers,
I am trying to simulate mixed convection over a heated flat plate. The simulation is 3D and the boundary conditions are available in a .csv format. I am trying to apply a temperature profile (in csv format) B.C. on the plate in the x and z direction using the fixedProfile boundary condition. However, I am unable to do so as I could not find the option for adding the two co-ordinate directions. So, how do i add two coordinate directions using the fixedProfile boundary condition? What are the other options through which the desired boundary condition can be implemented? I am attaching a diagram of the problem, the csv file and T file. Note: The first and second column in the csv file are the x and z coordinates. |
|
June 10, 2020, 12:58 |
Try timeVaryingMappedFixedValue
|
#2 |
Senior Member
Carlos Rubio Abujas
Join Date: Jan 2018
Location: Spain
Posts: 127
Rep Power: 11 |
I don't know of any way to do this from a CSV directly. Maybe you can try timeVaryingMappedFixedValue. It reads a folder format inside constant/boundaryData/heated_wall, you have to create these folders yourself.
In this folder you need to define at least two files:
constant/boundaryData/heated_wall/points: Code:
458 ( (0 -0.14 0) (0 -0.07 0) (0 0 0) ... (0 -0.14 0.1) (0 -0.07 0.1) (0 0 0.1) ... ) constant/boundaryData/heated_wall//0/T Code:
458 ( 327.6 334.5 340.3 ... 327.6 334.5 340.3 ) If you think that the temperature of the plate may change across time you can create further folders, for example constant/boundaryData/heated_wall//100/T and the profile will interpolate across the time. You don't have to redefine the points for this, the same file is valid for each of the time instants. In the boundary file T just define it as: Code:
heated_wall { type timeVaryingMappedFixedValue; offset (0 0 0); setAverage off; } I hope that helps you. |
|
June 10, 2020, 16:34 |
|
#3 |
New Member
Sibo Anthony Athikho
Join Date: Apr 2020
Posts: 2
Rep Power: 0 |
Thank you very much. The timeVaryingMappedFixedValue worked. A slight change in the boundary file of T was made: offset (0 0 0); was changed to offset 0; as the former led to an error:
--> FOAM FATAL IO ERROR: wrong token type - expected Scalar, found on line 26 the punctuation token '('. Thank you once again for helping out!!!! |
|
June 10, 2020, 18:23 |
|
#4 | |
Senior Member
Carlos Rubio Abujas
Join Date: Jan 2018
Location: Spain
Posts: 127
Rep Power: 11 |
Quote:
Wops, my fault. I've just copy-pasted from a previous example and didn't figure out that it is from a vectorField. Glad I've could help you! |
||
March 20, 2021, 09:52 |
|
#5 |
Member
Mohammad M F
Join Date: Jan 2016
Location: Washington DC, USA
Posts: 43
Rep Power: 10 |
Hi Carlos;
I have a simple 2-D inclined Couette flow, and I want to apply a fixed boundary condition for U at the inlet using timeVaryingMappedFixedValue. The vertical axis is x, and flow is in +y direction. And domain is one cell thickness in z direction (from -0.05mm to +0.05mm). My data for inlet velocity would be on x-z plane (y=0). The bottom wall will be moving at 5 mm/s in +y direction, while the inclined top wall is stationary. However, I am not sure why paraview is not showing the correct velocity profile at the inlet. I followed exactly what you said, but no luck. I would be grateful if you could take a quick look at my case folder to see why it is not working. |
|
March 20, 2021, 12:55 |
|
#6 | |
Senior Member
Carlos Rubio Abujas
Join Date: Jan 2018
Location: Spain
Posts: 127
Rep Power: 11 |
Hi Mohammad,
Quote:
Try using paraFoam, which has a closest relation with openFoam and will be able to run the required code to interpret your boundary condition. You're expecting a profile like this one, right? If so that is the cause |
||
March 20, 2021, 13:15 |
|
#7 |
Member
Mohammad M F
Join Date: Jan 2016
Location: Washington DC, USA
Posts: 43
Rep Power: 10 |
Thanks Carlos;
Yes, I am using paraView. And yes, I noticed that my simulation results are correct, but somehow paraView does not want to show the correct profile. I am using OpenFOAM on WSL on windows 10. When I type paraFoam, I get an error: Code:
Invalid $PV_PLUGIN_PATH and -plugin-path= not defined No supplementary ParaView/OpenFOAM reader modules Using builtin reader: paraFoam -vtk Created temporary 'couetteFLow.foam' /opt/OpenFOAM/OpenFOAM-v2006/bin/paraFoam: 420: /opt/OpenFOAM/OpenFOAM-v2006/bin/paraFoam: paraview: not found I guess it is not installed, right? |
|
March 20, 2021, 13:34 |
|
#8 |
Senior Member
Carlos Rubio Abujas
Join Date: Jan 2018
Location: Spain
Posts: 127
Rep Power: 11 |
Look like its not installed. If you're using a ubuntu distribution inside the WSL (and assuming you have administrator priviledges) you may install paraview with:
Code:
sudo apt-get install paraviewopenfoam56 |
|
March 20, 2021, 13:39 |
|
#9 |
Member
Mohammad M F
Join Date: Jan 2016
Location: Washington DC, USA
Posts: 43
Rep Power: 10 |
Thanks;
I have already set up X server to be used with pyFoamPlotWatcher. When I run the command, I get this error: Reading package lists... Done Building dependency tree Reading state information... Done E: Unable to locate package paraviewopenfoam56 |
|
March 20, 2021, 13:55 |
|
#10 |
Senior Member
Carlos Rubio Abujas
Join Date: Jan 2018
Location: Spain
Posts: 127
Rep Power: 11 |
Oh, sorry. I think you need to add the repository
Code:
sudo sh -c "wget -O - https://dl.openfoam.org/gpg.key | apt-key add -" sudo add-apt-repository http://dl.openfoam.org/ubuntu sudo apt-get update |
|
March 20, 2021, 15:02 |
|
#11 |
Member
Mohammad M F
Join Date: Jan 2016
Location: Washington DC, USA
Posts: 43
Rep Power: 10 |
I am using OpenFOAM.com version,
so I guess parafoam won't be an option for me. |
|
Tags |
csvfile, fixedprofile, openfoam6 |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
[extend-bazaar] How to apply timeVaryingSolidTraction B.C. to fsiFoam? | postechkian | OpenFOAM Programming & Development | 1 | April 8, 2019 05:25 |
Problem with reading CSV files | MrNinainaidi | OpenFOAM Running, Solving & CFD | 1 | July 2, 2015 06:34 |
question about implementing boundary conditions | saygin | Main CFD Forum | 0 | July 6, 2006 08:08 |
Urgent! Help on UDF to set B.C. of 3rd type | Ray Hong | FLUENT | 0 | December 28, 2005 20:35 |
How to set B.C. of the 2nd or 3rd type in UDS? | Ray Hong | FLUENT | 0 | December 28, 2005 07:03 |