|
[Sponsors] |
Adding a Power Source Term (UDF) to a closed Domain |
|
LinkBack | Thread Tools | Search this Thread | Display Modes |
March 7, 2020, 05:31 |
Adding a Power Source Term (UDF) to a closed Domain
|
#1 |
New Member
Julius
Join Date: Mar 2020
Location: Aachen
Posts: 10
Rep Power: 6 |
Hi there,
I'm trying to calculate the pressure rise in a closed compartment. Let's say I have a cube as a domain which is closed. Now I have a .csv file where the time and the Power in [W] is stored in two columns. I want this power input to emerge from a smaller cube inside the outer cube. The result should be a pressure distribution. Can anyone help me with that problem? How do I import such a file, I've read that it is possible with a UDF but I dont' know how to proceed. Thanks a lot! Best regards Julius |
|
March 7, 2020, 06:14 |
Source
|
#2 |
Senior Member
|
To read such a file, you do not require a UDF. It can be directly read in. However, this has to be in a required format; csv is not recommended for any work related to Fluent. The file is called profile file in Fluent and there are two formats for transient profile. You can use one column format
((profileName transient 3 0) (time 0 0.1 0.14 ) (var 128.3 892.3 342.23 )) You may use any name for the variables, profileName and var. transient must be written as it is. 3 specifies the number of data points. 0 specifies whether the data is time-periodic or not. Parentheses must be used as it is. Read this file via File > Read > Profile. Then, you can apply it as source term or as any condition that needs to vary with time, such as, velocity or pressure or mass fraction at a boundary. Do note that all the data is in SI units. Fluent does not know whether this is mass source, or momentum source, or energy source or pressure. So, you can hook it for anything. Values under the var are in per unit volume (for source), i.e., if these are mass source then values are taken as kg/cu.m. For pressure increase, it could be mass source or momentum source or energy source.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
March 7, 2020, 11:40 |
|
#3 |
New Member
Julius
Join Date: Mar 2020
Location: Aachen
Posts: 10
Rep Power: 6 |
Thanks for your answer!
The information that i cant' use .csv is helpful! You said: "I can hook it for anything" but how do i hook it at all? I pretty new to ansys so I dont' really understand what you mean. I did a Geometry in ICEM (one big cube and on smaller cube inside the bigger one, so the bigger one is a closed compartment) I don't know if I need the small cube, but Ithought I need some kind of Geometry to release the energy from the .profile file. Then I meshed the Geometry and opened it in Fluent. How do I say Fluent that there is a loaded Energy file and that it shpuld be released inside the small cube and emerge in the bigger cube. Thank you! |
|
March 7, 2020, 12:06 |
Energy
|
#4 |
Senior Member
|
What is the type of energy that you want to release from the smaller cube? Is it thermal energy or pressure or momentum? Smaller cube is not must but useful. Do note that you should have conformal mesh between the smaller and the larger cube.
Once you load the profile file in Fluent, you can go to cell zone conditions, select smaller cell zone, enable source, and then apply the profile.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
March 7, 2020, 12:18 |
|
#5 |
New Member
Julius
Join Date: Mar 2020
Location: Aachen
Posts: 10
Rep Power: 6 |
It is thermal energy, it comes from an electric arc, so its a file where the arc power is written over time. The originally problem is a electric arc ignition between two electrodes inside a closed compartment. This electric power is transformed into heat and then into pressure rise inside the closed compartment. And as a result of my simulation i want a pressure distribution on each wall of the outer compartment.
And I just wanted to start simple, so i didnt want to simulate the two electrodes, so the small cube is intended to describe the gap between the two electrodes between which the arc is ignited. Do you think its a good way to simulate such a scenario? Best regards Julius |
|
March 7, 2020, 12:25 |
Approach
|
#6 |
Senior Member
|
Yes, this is a correct approach. Do ensure that the fluid is modeled as compressible. If it's gas, you may use Ideal gas law.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
March 8, 2020, 09:37 |
|
#7 |
New Member
Julius
Join Date: Mar 2020
Location: Aachen
Posts: 10
Rep Power: 6 |
Hi,
i proceeded as you recommended but I get an error ("floeting point exception") and it won't work. I can't see the inner cube and how do I define that the energy is released in the inner cube? Did I do something wrong? Thanks a lot! |
|
March 8, 2020, 09:43 |
|
#8 |
New Member
Julius
Join Date: Mar 2020
Location: Aachen
Posts: 10
Rep Power: 6 |
And the model looks like this now:
I think the inner smaller cube is part of the fluid. Thats ok, but I couldn't define the energy to emerge from there.. |
|
March 8, 2020, 09:45 |
|
#9 |
New Member
Julius
Join Date: Mar 2020
Location: Aachen
Posts: 10
Rep Power: 6 |
And how do I ensure that the Gas is compressible?
|
|
March 8, 2020, 10:56 |
|
#10 |
New Member
Julius
Join Date: Mar 2020
Location: Aachen
Posts: 10
Rep Power: 6 |
I think i fixed it at least there were no more errors when started the calculation.
But I think nothing happend, I cant' see the pressure distribution. (Iattached two screenshots, maybe you can tell me what I've done wrong) Do you have an idea which setting I've set wrong? Best regards Julius |
|
March 8, 2020, 13:18 |
Setup
|
#11 |
Senior Member
|
Assuming you have two bodies at the CAD level, two bodies at the meshing level, you should have two cell zones in Fluent. If you do not have those, I'd suggest go back to CAD model and ensure that there are two bodies, one representing the smaller cube and the other one representing the larger cube excluding the inner cube region since inner cube is supposed to be fully enclosed by the outer cube.
At the meshing level, in the Geometry branch, there should only be one part and both bodies should belong to that part. This will ensure conformal mesh. Also give names to both bodies, you can give whatever names you want. Do not use capital letters or spaces between words. To model compressible flow, you need to use ideal gas for density.
__________________
Regards, Vinerm PM to be used if and only if you do not want something to be shared publicly. PM is considered to be of the least priority. |
|
Tags |
energy input, power, pressure, udf |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Using PengRobinsonGas EoS with sprayFoam | Jabo | OpenFOAM Running, Solving & CFD | 36 | July 16, 2024 04:52 |
multiRegionHeater error | ordinary | OpenFOAM Running, Solving & CFD | 2 | June 9, 2020 18:43 |
[swak4Foam] Error bulding swak4Foam | sfigato | OpenFOAM Community Contributions | 18 | August 22, 2013 13:41 |
[swak4Foam] funkySetFields compilation error | tayo | OpenFOAM Community Contributions | 39 | December 3, 2012 06:18 |
DxFoam reader update | hjasak | OpenFOAM Post-Processing | 69 | April 24, 2008 02:24 |