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

Incompatible fields for operation

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 31, 2005, 07:18
Default Hi everybody, I am trying t
  #1
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 102
Rep Power: 17
tehache is on a distinguished road
Hi everybody,

I am trying to solve solidification/melting problems, smearing out release of latent heat over a temperature intervall around melting point, i.e. would like to solve this:

d/dt(rho*cp*T+l*g(T)) -laplacian(DT,T) = 0

Forgetting for the moment cp, rho,l (latent heat),
I created a volScalarField g_T (dimensionSet(0,0,0,1,0,0,0), and assign values (0 below melting point, then a transition, 1 above).
The field T has the same dimension.

Simple-hearted as I am, then tried to do this:

solve
(
fvm::ddt(T) +fvm::ddt(g_T) - fvm::laplacian(DT, T)
);

compiles, but then

--> FOAM FATAL ERROR : incompatible fields
for operation [T] + [g_T]

Thank you very much for any hint ...
tehache is offline   Reply With Quote

Old   August 31, 2005, 08:55
Default I think this is because you ar
  #2
Member
 
diablo80@web.de
Join Date: Mar 2009
Posts: 93
Rep Power: 17
sampaio is on a distinguished road
I think this is because you are trying to solve for two different variables at the same equation (same matrix).

If you want the term on g(T) implicit, I think you should decompose ddt(g(T)) into something like ddt(g) * ddt(T) using chain rule. If you cannot calculate ddt(g) analitically (gl in chain rule) pehaps you can use something like:

fvc::ddt(g_T)/fvc::ddt(T) * fvm::ddt(T)

\___________________/ \_______/

||||||||||| gl explicit ||||||||||||||||| implicit

You will need some correction tought if fvc::ddt(T) gets close to zero...

(I never tried something like this, better listen to what more experienced people has to say about it... )
sampaio is offline   Reply With Quote

Old   August 31, 2005, 09:17
Default thanks a lot...works with chai
  #3
Senior Member
 
Thomas Jung
Join Date: Mar 2009
Posts: 102
Rep Power: 17
tehache is on a distinguished road
thanks a lot...works with chain rule.
In fact somehow trivial, but when you are new to this its sometimes confusing
tehache is offline   Reply With Quote

Old   November 27, 2007, 13:07
Default Hello,all, I am trying to s
  #4
Member
 
Quinn Tian
Join Date: Mar 2009
Posts: 62
Rep Power: 17
qtian is on a distinguished road
Hello,all,

I am trying to study anisotropic eddy viscosity effect to my simulation. I created an anisotropic viscosity ternsor "nuEffAn" in the turbulenceModel.H file and also modified the momentum equation in kOmegaSST.C as following.

tmp<fvvectormatrix> kOmegaSST::divR(volVectorField& U) const
{
return
(
- fvm::laplacian(nuEffAn(), U)
- fvc::div(nuEffAn()&dev(fvc::grad(U)().T()))+(2.0/3.0)*fvc::grad(k_)
);
}

//- Return the effective anisotropic viscosity ternsor
virtual tmp<voltensorfield> nuEffAn() const
{
tensor T1(1,1,1,1,1,1,1,1,1);
tensor T2(0.6,1,1,1,1,0.6,1,0.6,1);

return tmp<voltensorfield>
(
new volTensorField("nuEffAn", nut()*T2 + nu()*T1)
);
}


After compiled the turbulence model, while I start my simulation, I got following error message:

--> FOAM FATAL ERROR : incompatible fields for operation
[U] + [region0]#0 Foam::error::printStack(Foam:stream&)
#1 Foam::error::abort()
#2 void Foam::checkMethod<foam::vector<double> >(Foam::fvMatrix<foam::vector<double> > const&, Foam::fvMatrix<foam::vector<double> > const&, char const*)
#3 Foam::tmp<foam::fvmatrix<foam::vector<double> > > Foam::operator+<foam::vector<double> >(Foam::tmp<foam::fvmatrix<foam::vector<double> > > const&, Foam::tmp<foam::fvmatrix<foam::vector<double> > > const&)
#4 main
#5 __libc_start_main
#6 __gxx_personality_v0 at /usr/src/packages/BUILD/glibc-2.3/csu/../sysdeps/i386/elf/start.S:122


From function checkMethod(const fvMatrix<type>&, const fvMatrix<type>&)
in file /home/dm2/henry/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/lnInclude/fvMatrix.C at line 1005.


Can anybody tell me what I did wrong? Thanks.
qtian is offline   Reply With Quote

Old   April 7, 2010, 07:48
Default
  #5
New Member
 
mediode
Join Date: Mar 2009
Posts: 27
Rep Power: 17
mediode is on a distinguished road
@tehache

Hi,

could you please be more specific on the chain rule applied. I have some doubt that ddt(g)*ddt(T) is correct, I think it should be ddT(g)*ddt(T) instead. Something like ddT is not implemented in OF, or?

Please corect me if I'm wrong.

Cheers
m*
mediode is offline   Reply With Quote

Old   January 30, 2018, 16:32
Default
  #6
New Member
 
Join Date: Jan 2018
Posts: 19
Rep Power: 8
Zhi Cheng is on a distinguished road
Have you solved this problem? Thanks!
I will be greatly appreciated if you replied me.
Quote:
Originally Posted by qtian View Post
Hello,all,

I am trying to study anisotropic eddy viscosity effect to my simulation. I created an anisotropic viscosity ternsor "nuEffAn" in the turbulenceModel.H file and also modified the momentum equation in kOmegaSST.C as following.

tmp<fvvectormatrix> kOmegaSST::divR(volVectorField& U) const
{
return
(
- fvm::laplacian(nuEffAn(), U)
- fvc::div(nuEffAn()&dev(fvc::grad(U)().T()))+(2.0/3.0)*fvc::grad(k_)
);
}

//- Return the effective anisotropic viscosity ternsor
virtual tmp<voltensorfield> nuEffAn() const
{
tensor T1(1,1,1,1,1,1,1,1,1);
tensor T2(0.6,1,1,1,1,0.6,1,0.6,1);

return tmp<voltensorfield>
(
new volTensorField("nuEffAn", nut()*T2 + nu()*T1)
);
}


After compiled the turbulence model, while I start my simulation, I got following error message:

--> FOAM FATAL ERROR : incompatible fields for operation
[U] + [region0]#0 Foam::error:rintStack(Foam:stream&)
#1 Foam::error::abort()
#2 void Foam::checkMethod<foam::vector<double> >(Foam::fvMatrix<foam::vector<double> > const&, Foam::fvMatrix<foam::vector<double> > const&, char const*)
#3 Foam::tmp<foam::fvmatrix<foam::vector<double> > > Foam:perator+<foam::vector<double> >(Foam::tmp<foam::fvmatrix<foam::vector<double> > > const&, Foam::tmp<foam::fvmatrix<foam::vector<double> > > const&)
#4 main
#5 __libc_start_main
#6 __gxx_personality_v0 at /usr/src/packages/BUILD/glibc-2.3/csu/../sysdeps/i386/elf/start.S:122


From function checkMethod(const fvMatrix<type>&, const fvMatrix<type>&)
in file /home/dm2/henry/OpenFOAM/OpenFOAM-1.4/src/finiteVolume/lnInclude/fvMatrix.C at line 1005.


Can anybody tell me what I did wrong? Thanks.
Zhi Cheng 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
Incompatible fields for operation divphi Ub vvqf OpenFOAM Running, Solving & CFD 4 April 4, 2018 04:28
incompatible fields for operationproblem in simpleFoam kbr OpenFOAM Running, Solving & CFD 3 March 10, 2009 11:25
Incompatible fields for operation su_junwei OpenFOAM Pre-Processing 1 October 15, 2008 09:34
TurbFoam simpleFoam incompatible fields for operation braennstroem OpenFOAM Running, Solving & CFD 0 June 19, 2008 11:43
The incompatible of UDF Summer FLUENT 3 April 23, 2007 05:11


All times are GMT -4. The time now is 23:05.