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

Problem with <unresolved overloaded function type>

Register Blogs Community New Posts Updated Threads Search

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 18, 2021, 09:27
Default Problem with <unresolved overloaded function type>
  #1
New Member
 
Join Date: Sep 2018
Posts: 25
Rep Power: 8
jeroendemto is on a distinguished road
Dear OpenFOAMers

I'm trying to implement conjugate heat transfer into my phase change model, however I have a problem when implementing a volScalarField rho, which depends on the volScalarField T (temperature).

This is the code I use to define the temperature field:

Code:
PtrList<volScalarField> TFluid(fluidRegions.seize());

TFluid.set
(
    i,
    new volScalarField
    (
        IOobject
        (
                "T",
                runTime.timeName(),
                fluidRegions[i],
                IOobject::MUST_READ,
                IOobject::AUTO_WRITE
        ),
        fluidRegions[i]
    )
);
When I try to calculate the rho (refRhoLiquid*(scalar(1)-beta*(T-T0))) it gives the following error:

Code:
error: no match for 'opertor-' (operand types are '<unresolved overloaded function type>' and 'FOAM::dimesnionedScalar'
This means I did not define the temperature (T) correctly, but I can't see what went wrong with that?

If you need additional information feel free to ask.

regards,
Jeroen
jeroendemto is offline   Reply With Quote

Old   May 18, 2021, 10:21
Default
  #2
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16
mAlletto will become famous soon enough
The problem is you try to subtract from a scalar 1 a dimensionised scalar beta. The operation is not defined anywhere. You need either to write beta.value() or assign the correct dimension to 1
mAlletto is offline   Reply With Quote

Old   May 18, 2021, 10:46
Default
  #3
New Member
 
Join Date: Sep 2018
Posts: 25
Rep Power: 8
jeroendemto is on a distinguished road
Thank you for your response, but I think the issue is not the beta function, as this worked before like this:

Code:
volScalarField rho
(
    IOobject
    (
        "rho",
        runTime.timeName(),
        mesh,
        IOobject::READ_IF_PRESENT,
        IOobject::AUTO_WRITE
    ),
    rhoLiquid*(scalar(1) - beta*(T - T0))
);
I also added an image to show the exact error, it shows that the problem is with T-T_0. T should be a volScalarField but is not.
Attached Images
File Type: jpg error.JPG (25.6 KB, 2 views)
jeroendemto is offline   Reply With Quote

Old   May 18, 2021, 11:18
Default
  #4
New Member
 
Join Date: Sep 2018
Posts: 25
Rep Power: 8
jeroendemto is on a distinguished road
Found the solution it should be TFluid[i] - T0 instead of T-T0
jeroendemto is offline   Reply With Quote

Old   May 18, 2021, 11:18
Default
  #5
Senior Member
 
Michael Alletto
Join Date: Jun 2018
Location: Bremen
Posts: 616
Rep Power: 16
mAlletto will become famous soon enough
Can you post the code snippet which is failing
mAlletto is offline   Reply With Quote

Old   May 18, 2021, 11:28
Default
  #6
New Member
 
Join Date: Sep 2018
Posts: 25
Rep Power: 8
jeroendemto is on a distinguished road
This is the original

Code:
rhoFluid.set
    (
    	    i,
	    new volScalarField
	    (
		    IOobject
		    (
			"rhoLiquid",
			runTime.timeName(),
			fluidRegions[i],
			IOobject::READ_IF_PRESENT,
			IOobject::AUTO_WRITE
		    ),
		    refRhoLiquid*(scalar(1) - beta*(T - T0))
	    )
    );
It should be:

Code:
rhoFluid.set
    (
    	    i,
	    new volScalarField
	    (
		    IOobject
		    (
			"rhoLiquid",
			runTime.timeName(),
			fluidRegions[i],
			IOobject::READ_IF_PRESENT,
			IOobject::AUTO_WRITE
		    ),
		    refRhoLiquid*(scalar(1) - beta*(TFluid[i] - T0))
	    )
    );
jeroendemto is offline   Reply With Quote

Reply

Tags
multiregions, overloaded function, phase change, temperature


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
[Other] refineWallLayer Error Yuby OpenFOAM Meshing & Mesh Conversion 2 November 11, 2021 12:04
problem during mpi in server: expected Scalar, found on line 0 the word 'nan' muth OpenFOAM Running, Solving & CFD 3 August 27, 2018 05:18
[mesh manipulation] RefineMesh Error and Foam warning jiahui_93 OpenFOAM Meshing & Mesh Conversion 4 March 3, 2018 12:32
[mesh manipulation] refineMesh Error mohsen.boojari OpenFOAM Meshing & Mesh Conversion 3 March 1, 2018 23:07
[blockMesh] Axisymmetrical mesh Rasmus Gjesing (Gjesing) OpenFOAM Meshing & Mesh Conversion 10 April 2, 2007 15:00


All times are GMT -4. The time now is 12:55.