CFD Online Logo CFD Online URL
www.cfd-online.com
[Sponsors]
Home > Forums > Software User Forums > SU2

Applying Temperature Distribution on Wall in SU2

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   November 25, 2023, 22:07
Default Applying Temperature Distribution on Wall in SU2
  #1
Member
 
Sean
Join Date: May 2023
Posts: 43
Rep Power: 2
bgulzar22 is on a distinguished road
Hello everyone, I need guidance on applying a temperature distribution on a wall. Could someone please provide the procedure or point me to relevant documentation?
bgulzar22 is offline   Reply With Quote

Old   November 25, 2023, 22:35
Default
  #2
Member
 
na
Join Date: Jul 2018
Posts: 83
Rep Power: 7
TKatt is on a distinguished road
You want to use the python wrapper


Please take a look at TestCases/py_wrapper/custom_heat_flux/run_ad.py and probably better TestCases/py_wrapper/custom_load_fea/run.py and take it from there. The code is from the custom_load_fea case and does eseentially what you want - which is to apply a spatially varying temperature BC.



Code:
  # Apply a load based on the coordinates.
  if nVertex > 0:
    MarkerCoords = SU2Driver.MarkerCoordinates(MarkerID)
    L = 0.5
    dx = L / 16 # known from mesh settings in this case.
    for iVertex in range(nVertex):
      x = MarkerCoords(iVertex, 0)
      nodalForce = (2 * x / L) * dx
      # Half load due to half dx on first and last node.
      if abs(x) < 1e-6 or abs(x - L) < 1e-6:
        nodalForce = nodalForce / 2
      SU2Driver.SetMarkerCustomFEALoad(MarkerID, iVertex, (0, nodalForce))
TKatt is offline   Reply With Quote

Old   March 29, 2024, 04:44
Default
  #3
Member
 
Sean
Join Date: May 2023
Posts: 43
Rep Power: 2
bgulzar22 is on a distinguished road
Quote:
Originally Posted by TKatt View Post
You want to use the python wrapper


Please take a look at TestCases/py_wrapper/custom_heat_flux/run_ad.py and probably better TestCases/py_wrapper/custom_load_fea/run.py and take it from there. The code is from the custom_load_fea case and does eseentially what you want - which is to apply a spatially varying temperature BC.



Code:
  # Apply a load based on the coordinates.
  if nVertex > 0:
    MarkerCoords = SU2Driver.MarkerCoordinates(MarkerID)
    L = 0.5
    dx = L / 16 # known from mesh settings in this case.
    for iVertex in range(nVertex):
      x = MarkerCoords(iVertex, 0)
      nodalForce = (2 * x / L) * dx
      # Half load due to half dx on first and last node.
      if abs(x) < 1e-6 or abs(x - L) < 1e-6:
        nodalForce = nodalForce / 2
      SU2Driver.SetMarkerCustomFEALoad(MarkerID, iVertex, (0, nodalForce))
I'm facing difficulties in properly setting this boundary condition based on temperature data from an external file. I have written a Python script to read the temperature data, assign it to the appropriate marker, and run the simulation. However, despite my efforts, I am encountering issues with the implementation.

To provide more context and allow for a better understanding of the problem, I have prepared a comprehensive package containing the following:

Configuration file
Mesh file
Temperature data file
Python script for setting the boundary condition and running the simulation
You can access the files package through this link:https://drive.google.com/drive/folde...usp=drive_link
Could you please look into it and please lend some help. I will be grateful.
bgulzar22 is offline   Reply With Quote

Reply


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Divergence in AMG solver! marina FLUENT 20 August 1, 2020 11:30
A question related to writing expression for (htc)Heat transfer coefficient Hamda CFX 11 April 17, 2020 00:57
Can't Get Temperature distribution in Solids in Fluent (Pipe cooling) Bobby Charlton FLUENT 0 December 31, 2019 19:07
How To Calculate Average Heat Transfer Coefficient in CFD-Post? Shomaz ul Haq CFX 16 November 24, 2019 18:57
Difficulty In Setting Boundary Conditions Moinul Haque CFX 4 November 25, 2014 17:30


All times are GMT -4. The time now is 15:47.