CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM (https://www.cfd-online.com/Forums/openfoam/)
-   -   Conversion of calculated scalar data into non-uniform internal field (https://www.cfd-online.com/Forums/openfoam/223172-conversion-calculated-scalar-data-into-non-uniform-internal-field.html)

Kummi December 29, 2019 05:23

Conversion of calculated scalar data into non-uniform internal field
 
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.

HPE December 29, 2019 16:45

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.

Kummi December 29, 2019 21:54

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.

Tobi December 30, 2019 10:00

Quote:

Originally Posted by Kummi (Post 753446)
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 December 30, 2019 10:04

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".

Tobi December 30, 2019 10:14

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.



Kummi December 30, 2019 10:40

How silly I'm.. Thank you Tobi.. Solved !!

Kummi January 2, 2020 06:56

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.


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