|
[Sponsors] |
November 15, 2022, 10:18 |
Time varying far field boundary conditions
|
#1 |
Member
Anders Aamodt Resell
Join Date: Dec 2021
Location: Oslo, Norway
Posts: 66
Rep Power: 5 |
Dear SU2 devs,
I'm trying to modify the source code to account for time varying far field boundary conditions for the Euler Equations. (In the future I would also like to extend them to vary spatially, but this is a first step). I have modified the function CEulerSolver::BC_Far_Field, and the edited piece of the code looks like this: Code:
bool UsingTraject = config->UsingTrajectory(); Vel2_Infty = 0.0; Vn_Infty = 0.0; for (iDim = 0; iDim < nDim; iDim++) { Vel_Infty[iDim] = UsingTraject ? config->GetVelocityFS_Traject(iDim) : GetVelocity_Inf(iDim); Vel2_Infty += Vel_Infty[iDim]*Vel_Infty[iDim]; Vn_Infty += Vel_Infty[iDim]*UnitNormal[iDim]; } Density_Infty = UsingTraject ? config->GetDensityFS_Traject() : GetDensity_Inf(); Pressure_Infty = UsingTraject ? config->GetPressureFS_Traject() : GetPressure_Inf(); SoundSpeed_Infty = sqrt(Gamma*Pressure_Infty/Density_Infty); Entropy_Infty = pow(Density_Infty, Gamma)/Pressure_Infty; However my implementation doesn't seem to work. I have ran a supersonic case on a wedge-like object where I gradually changed the direction of the freestream velocity, but the incoming field doesn't seem to change direction. I would like some guidance on possible reasons for why my implementation is failing. Is there is something wrong in my assumption that I can modify the BC_Far_Field function in this way? Thanks in advance! Last edited by ander; November 15, 2022 at 13:40. |
|
November 16, 2022, 18:55 |
|
#2 |
Senior Member
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 676
Rep Power: 21 |
Did you check that the farfield changes if you change the farfield velocity from the config file? And what if you just hardcode some value for the farfield conditions in the farfield function?
Did you check that you are actually entering the farfield routine every timestep? |
|
November 17, 2022, 15:02 |
|
#3 |
Member
Anders Aamodt Resell
Join Date: Dec 2021
Location: Oslo, Norway
Posts: 66
Rep Power: 5 |
You are correct, they didn't change! The reason was that I updated the config file only on the MASTER rank, and therefore all the different copies of the config file didn't change.
I tested it now, and if I make the velocity field accelerate linearly and apply the same acceleration as a body force, the velocity field seems to get a uniform acceleration, which was what I hoped (at least in the supersonic case). I need to do more testing to see if I am able to implement far field BC's for a rotating reference frame |
|
November 17, 2022, 16:57 |
|
#4 |
Senior Member
bigfoot
Join Date: Dec 2011
Location: Netherlands
Posts: 676
Rep Power: 21 |
Great to hear!
By the way, there is also the option to use the python wrapper to implement this, you can have a look in Testcases/py_wrapper for some examples. |
|
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
AMI speed performance | danny123 | OpenFOAM | 21 | October 24, 2020 05:13 |
[swak4Foam] swakExpression not writing to log | alexfells | OpenFOAM Community Contributions | 3 | March 16, 2020 19:19 |
My radial inflow turbine | Abo Anas | CFX | 27 | May 11, 2018 02:44 |
CFD analaysis of Pelton turbine | amodpanthee | CFX | 31 | April 19, 2018 19:02 |
Radiation interface | hinca | CFX | 15 | January 26, 2014 18:11 |