CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Running, Solving & CFD (https://www.cfd-online.com/Forums/openfoam-solving/)
-   -   Modified polynomial thermophysical and transport properties (https://www.cfd-online.com/Forums/openfoam-solving/235911-modified-polynomial-thermophysical-transport-properties.html)

tijan May 5, 2021 06:33

Modified polynomial thermophysical and transport properties
 
Dear all,

I am new to openFOAM and I'm trying to use it to solve heat transfer during SLM (selective laser melting) and I am experiencing some difficulties correctly defining the temperature-dependent material properties. The problem is that the process involves an irreversible transformation of material from powder to bulk state, when the melting takes place. The material properties of bulk and powder follow different temperature dependencies.

The idea that I had was declaring a new field (beta) on the mesh, where the state of material (powder-->1 and bulk-->0) is followed. This field could then be used to modify the polynomial equations for material properties. For instance, if the regular polynomial equation for Cp follows the following dependence:

Cp coeffs: (X0,X1,X2,X3)
Cp = X0 + X1*T + X2*T^2 + X3*T^3,

I would like to modify it in the following manner:

Cp coeffs bulk: (X0,X1,X2,X3)
Cp coeffs powder: (Y0,Y1,Y2,Y3)
Cp = (1-beta)* (X0 + X1*T + X2*T^2 + X3*T^3) + (beta)* (Y0 + Y1*T + Y2*T^2 + Y3*T^3).

My questions are as follows:

1.) Is it correct that in order to alter the polynomial equations I should modify the:
- hPolynomialThermoI.H file for Cp
- PolynomialThermoI.H file for mu
- icoPolynomialI.H file for rho ?

2.) As I am very unfamiliar to C++, I'm having problems locating where in these files the polynomes are being resolved and hence which part of the code needs to be modified. Could you please point me to the relevant lines of the code?

Any help will be greatly appreciated!


Best,
Tijan

mikulo August 20, 2021 02:49

Quote:

Originally Posted by tijan (Post 803183)
Dear all,

I am new to openFOAM and I'm trying to use it to solve heat transfer during SLM (selective laser melting) and I am experiencing some difficulties correctly defining the temperature-dependent material properties. The problem is that the process involves an irreversible transformation of material from powder to bulk state, when the melting takes place. The material properties of bulk and powder follow different temperature dependencies.

The idea that I had was declaring a new field (beta) on the mesh, where the state of material (powder-->1 and bulk-->0) is followed. This field could then be used to modify the polynomial equations for material properties. For instance, if the regular polynomial equation for Cp follows the following dependence:

Cp coeffs: (X0,X1,X2,X3)
Cp = X0 + X1*T + X2*T^2 + X3*T^3,

I would like to modify it in the following manner:

Cp coeffs bulk: (X0,X1,X2,X3)
Cp coeffs powder: (Y0,Y1,Y2,Y3)
Cp = (1-beta)* (X0 + X1*T + X2*T^2 + X3*T^3) + (beta)* (Y0 + Y1*T + Y2*T^2 + Y3*T^3).

My questions are as follows:

1.) Is it correct that in order to alter the polynomial equations I should modify the:
- hPolynomialThermoI.H file for Cp
- PolynomialThermoI.H file for mu
- icoPolynomialI.H file for rho ?

2.) As I am very unfamiliar to C++, I'm having problems locating where in these files the polynomes are being resolved and hence which part of the code needs to be modified. Could you please point me to the relevant lines of the code?

Any help will be greatly appreciated!


Best,
Tijan

Hey, I don't understand very well what modification of Coeffs you wanted to use but yes, you need to modify the hPolynomialI.H for Cp, H, etc.. You can even add a code there if you wanted to. Also, you have to modify icoPolynomial for mu, too.

If i understood well, you kinda wanted to have two CpCoeffs, right? You look at the codes for .H and .C of these files, then add a variable similar to how CpCoeffs is defined or passed in a function. In other words, you simply have to add say Polynomial ... CpCoeffs2 for you second CpCoeffs.

You need to see the Doxygen in order to know which files are calling which. You will see that you need to modify specie, basic, and rhoReactionThermo for all of this. They are all interrelated with one another.


All times are GMT -4. The time now is 17:13.