Implementing a B.C. from a csv
1 Attachment(s)
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. |
Try timeVaryingMappedFixedValue
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 ( constant/boundaryData/heated_wall//0/T Code:
458 ( 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 I hope that helps you. |
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!!!! |
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! :D |
1 Attachment(s)
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. |
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 ;) https://i.imgur.com/qfxmMre.png |
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 I guess it is not installed, right? |
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 |
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 |
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 -" |
I am using OpenFOAM.com version,
so I guess parafoam won't be an option for me. |
All times are GMT -4. The time now is 16:05. |