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

Conversion of calculated scalar data into non-uniform internal field

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes
  • 1 Post By Tobi

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   December 29, 2019, 05:23
Question Conversion of calculated scalar data into non-uniform internal field
  #1
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 349
Rep Power: 11
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
Hello Foamers,
I want to initialize my source term as non-uniform internal field list (like a pattern below)
Quote:
dimensions [1 -3 -1 0 0 0 0]; //kg/m3.s
internalField nonuniform List<scalar>
1125000
(
--
--
--
--
--
--
Quote:
Continuity --> del.(rho*V)= RRg (load the result in source term - kg/m3.s)
The source term (RRg) was already solved by another solver as a list of scalar output data. How to convert the calculated scalar data into non-uniform internal field (for flow field initialization) in another solver.
Kummi is offline   Reply With Quote

Old   December 29, 2019, 16:45
Default
  #2
HPE
Senior Member
 
HPE's Avatar
 
Herpes Free Engineer
Join Date: Sep 2019
Location: The Home Under The Ground with the Lost Boys
Posts: 932
Rep Power: 12
HPE is on a distinguished road
Can't you write it out at writeTime by `RRg.write()` if RRg is a registered IOobject, like say epsilon.

You mean memory copy or manual ascii copy?

If manual copy, add `Info<< RRg <<nl;`, and recompile the solver.

If none of these help, please elaborate what and how ypu want to sort things out.
HPE is offline   Reply With Quote

Old   December 29, 2019, 21:54
Default
  #3
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 349
Rep Power: 11
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
Dear HPE,
Thank you for your response. Let me elaborate the problem. Let's say there are 2 solvers 1 and 2, which are completely independent of each other.
In SOLVER 1 - I resolved RRg and extracted the output [using functionObjects-probes] as given below:
Quote:
# x 0.1 0.15625 0.2125 0.26875 0.325
# y 1 1 1 1 1
# z 0.05 0.05 0.05 0.05 0.05
# Time
XXX XX XX XX XX

57750 71.3588 64.6285 49.4694 26.5223 1.04415
57800 69.8619 63.327 48.4339 25.9573 1.02178
57850 68.3869 62.0399 47.4105 25.3992 0.999691
57900 66.9348 60.768 46.3999 24.8482 0.977883
58550 50.3579 45.958 34.6875 18.4745 0.725706
58600 49.2663 44.9658 33.907 18.0507 0.708946
58650 48.2006 43.9954 33.1444 17.6366 0.692574
58700 47.1607 43.0468 32.3993 17.2322 0.676587
58750 46.1461 42.1197 31.6719 16.8375 0.660984
In another SOLVER 2, there given continuity equation with source term RRg, where RRg should be loaded with the list of scalar data obtained from SOLVER 1.
Quote:
Continuity --> del.(rho*V)= RRg (load the result in source term - kg/m3.s)
How to load the data of RRg as non-uniform internal field in SOLVER 2 (as given below)?
Quote:
dimensions [1 -3 -1 0 0 0 0]; //kg/m3.s
internalField nonuniform List<scalar>
1125000
(
--
--
--
--
--
--
SOLVER 1 - RRg data output obtained with respect to time
SOLVER 2 - How to load the data of RRg as nonuniform scalar List ?
Do we need to convert the calculated scalar data into non-uniform internal field ?
Kindly correct me if I'm trying to get things with the wrong approach.
Thank you again.
Kummi is offline   Reply With Quote

Old   December 30, 2019, 10:00
Default
  #4
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
Quote:
Originally Posted by Kummi View Post
Do we need to convert the calculated scalar data into non-uniform internal field ?

Yes you do have to transform your data to the corresponding syntax for non-uniform field.
Kummi likes this.
__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   December 30, 2019, 10:04
Default
  #5
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 349
Rep Power: 11
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
Dear Tobi,
Thank you for your response.
Could you please share some ideas or hints regarding as, "how to transform my data into corresponding syntax for non-uniform field".
Kummi is offline   Reply With Quote

Old   December 30, 2019, 10:14
Default
  #6
Super Moderator
 
Tobi's Avatar
 
Tobias Holzmann
Join Date: Oct 2010
Location: Tussenhausen
Posts: 2,708
Blog Entries: 6
Rep Power: 51
Tobi has a spectacular aura aboutTobi has a spectacular aura aboutTobi has a spectacular aura about
Send a message via ICQ to Tobi Send a message via Skype™ to Tobi
I have no idea why you make it so difficult. AFAIU, you calculate the RRg field using solver1. So you should have a volScalarField available. Now you can write this field during your run (using solver 1). Thus, you get the field in the time folders. This file can be used to be loaded in your solver 2. Doing so, there is nothing to be done anymore.


__________________
Keep foaming,
Tobias Holzmann
Tobi is offline   Reply With Quote

Old   December 30, 2019, 10:40
Default
  #7
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 349
Rep Power: 11
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
How silly I'm.. Thank you Tobi.. Solved !!
Kummi is offline   Reply With Quote

Old   January 2, 2020, 06:56
Default
  #8
Senior Member
 
Kumaresh
Join Date: Oct 2016
Posts: 349
Rep Power: 11
Kummi is on a distinguished road
Send a message via Yahoo to Kummi
Hello Tobi,
I have one more query.

SOLVER 1 - 1D heat equation solver - RRg data calculated.
SOLVER 2 - 2D gas flow solver - How to load the data of RRg from 1D into 2D solver ?
I have calculated the source field RRg (as given below) in 1D heat equation (pyrolysis solver).

Quote:
FoamFile
{
version 2.0;
format ascii;
class volScalarField;
location "50000";
object ddt0(rho); //RRg - reaction rate of pyrolysis gases
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //
dimensions [1 -3 -1 0 0 0 0];
internalField nonuniform List<scalar>
25
(
-5.04013e-05
-0.000324749
-0.204003
0
0
-5.04013e-05
-0.000324749
-0.204003
0
0
-5.04013e-05
-0.000324749
-0.204003
0
0
-5.04013e-05
-0.000324749
-0.204003
0
2.47033e-323
-5.04013e-05
-0.000324749
-0.204003
0
0
)
;

boundaryField
{ XXXXX
}
The gas flow path can't be developed without taking into account both the vertical and horizontal components of flow. So, 2D gas flow model is developed based on continuity and Ergun equation.
Quote:
Continuity --> del.(rho*V)= RRg (load the result in source term - kg/m3.s)
How to load the data of RRg in 2D solver as nonuniform scalar List? ==> in order to predict the streamline path for the release of pyrolysis gases.
Kummi 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
FOAM FATAL ERROR: Maximum number of iterations exceeded: 100 antoniomollo OpenFOAM Running, Solving & CFD 5 March 2, 2023 06:13
dsmcFoam setup hherbol OpenFOAM Pre-Processing 1 November 19, 2021 01:52
Inlet patch problems martyn88 OpenFOAM Running, Solving & CFD 6 April 21, 2017 18:34
[mesh manipulation] Importing Multiple Meshes thomasnwalshiii OpenFOAM Meshing & Mesh Conversion 18 December 19, 2015 18:57
Moving mesh Niklas Wikstrom (Wikstrom) OpenFOAM Running, Solving & CFD 122 June 15, 2014 06:20


All times are GMT -4. The time now is 07:00.