CFD Online Discussion Forums

CFD Online Discussion Forums (https://www.cfd-online.com/Forums/)
-   OpenFOAM Programming & Development (https://www.cfd-online.com/Forums/openfoam-programming-development/)
-   -   develope a solver (https://www.cfd-online.com/Forums/openfoam-programming-development/123797-develope-solver.html)

AmirBaqa1987 September 21, 2013 07:21

develope a solver
 
Hi everyone
I want to develop a solver by adding the following Eq to simpleFoam solver:

http://latex.codecogs.com/gif.latex?...wn%20T%29/T%5D

http://latex.codecogs.com/gif.latex?%5Crho,c,k,D and S are constant.
V:velocity vector
T and L are scalars.

I've considered these assumptions:
m=fvc::grad(L)
n=fvc::grad(T)/T
and define m and n in createfields and finally write TEqn as bellow:

Code:

  fvScalarMatrix TEqn
 (
  rho*c*fvm::div(phi,T)
  -fvm::laplacian(k,T)
 );

 solve(TEqn == rho*c*T*(D*(m&n)+S*(n&n)));
  m=fvc::grad(V);
  n=fvc::grad(T)/T;

dimensions of variable and constants are listed below:
http://latex.codecogs.com/gif.latex?%5Crho [1 -3 0 0 0 0 0 ]
c [0 2 -2 -1 0 0 0 ]
D&S [0 2 -1 0 0 0 0]
k [1 1 -3 -1 0 0 0]
variable L is volume fraction and has no dimension.
variable T is temperature:[0 0 0 1 0 0 0]

I've made this new solver with wmake command successfully but when I run the case and want to complete the solver I confronted the following Fatal Error:
Code:


--> FOAM Warning :
    From function dlOpen(const fileName&, const bool)
    in file POSIX.C at line 1175
    dlopen error : libsimpleSwakFunctionObjects.so: cannot open shared object file: No such file or directory
--> FOAM Warning :
    From function dlLibraryTable::open(const fileName&, const bool)
    in file db/dynamicLibrary/dlLibraryTable/dlLibraryTable.C at line 96
    could not load "libsimpleSwakFunctionObjects.so"

--> FOAM FATAL ERROR:
incompatible dimensions for operation
    [T[1 -1 -3 0 0 0 0] ] - [T[1 -1 -3 2 0 0 0] ]


    From function checkMethod(const fvMatrix<Type>&, const fvMatrix<Type>&)
    in file /opt/openfoam211/src/finiteVolume/lnInclude/fvMatrix.C at line 1316.

FOAM aborting

#0  Foam::error::printStack(Foam::Ostream&) in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#1  Foam::error::abort() in "/opt/openfoam211/platforms/linux64GccDPOpt/lib/libOpenFOAM.so"
#2  void Foam::checkMethod<double>(Foam::fvMatrix<double> const&, Foam::fvMatrix<double> const&, char const*) in "/home/amir/OpenFOAM/amir-2.1.1/platforms/linux64GccDPOpt/bin/nanoHeatSimpleFoam"
#3 
 at nanoHeatSimpleFoam.C:0
#4 
 in "/home/amir/OpenFOAM/amir-2.1.1/platforms/linux64GccDPOpt/bin/nanoHeatSimpleFoam"
#5  __libc_start_main in "/lib/x86_64-linux-gnu/libc.so.6"
#6 
 in "/home/amir/OpenFOAM/amir-2.1.1/platforms/linux64GccDPOpt/bin/nanoHeatSimpleFoam"
Aborted (core dumped)


can anybody help?
Thanks
Arjang

sharonyue September 22, 2013 20:11

Quote:

Originally Posted by AmirBaqa1987 (Post 452863)
Hi everyone
I want to develop a solver by adding the following Eq to simpleFoam solver:

http://latex.codecogs.com/gif.latex?...wn%20T%29/T%5D

http://latex.codecogs.com/gif.latex?%5Crho,c,k,D and S are constant.
V:velocity vector
T and L are scalars.

Hi Arjang,

Im not an expert in this field. but are you sure your equation's dimension is compatible? In the following equation, I think the left's dimension is not the same with the right one.

\rho c V \cdot \nabla T = \rho c D \nabla L \cdot \nabla T

AmirBaqa1987 September 23, 2013 01:17

Hi Forrest
I've found the problem.
I've made a miss and set the dimension of k in the Transport Properties Dictionary wrong, I mean:
K [1 1 -3 1 0 0 0] instead of k [1 1 -3 -1 0 0 0].
I modify this dictionary and my problem is solved.


All times are GMT -4. The time now is 01:41.