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

Tutorial/functional case for solidificationMeltingSource

Register Blogs Community New Posts Updated Threads Search

Like Tree31Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   May 28, 2018, 12:49
Default
  #21
Member
 
Tarang
Join Date: Feb 2011
Location: Delhi, India
Posts: 47
Rep Power: 15
gtarang is on a distinguished road
Quote:
Originally Posted by rahul62 View Post
Hi,
I am running the case (solidificationMeltingSource) in of4 but i am not getting alpha1 printed. Can anyone help me with this?

this fvoption uses sms1:alpha1, ie ':', colon in filename. If you are using openfoam in windows, then the file may not be written as windows does not allow ':' in filenames
gtarang is offline   Reply With Quote

Old   April 9, 2019, 10:36
Default
  #22
New Member
 
Anna
Join Date: Feb 2019
Posts: 17
Rep Power: 7
iconde is on a distinguished road
Hi there,

I'm trying to get sms1:alpha1 variable for using it as a condition of a new variable in chtMultiRegionFoam but I'm having problems getting the variable because it doesn't recognize it:

Quote:
./fluid/solveModuloTermicoFluid.H:18:28: error: ‘alpha1_’ was not declared in this scope
newVariable.ref() = alpha1_ * (dimensionedScalar("s", dimensionSet(0,0,1,0,0,0,0), scalar(1.0)));

/opt/openfoam6/wmake/rules/General/transform:25: recipe for target 'Make/linux64GccDPInt32Opt/chtMultiRegionFoamAzterlan.o' failed
Anyone knows how to call this variable?

Thanks!
iconde is offline   Reply With Quote

Old   April 9, 2019, 11:40
Default
  #23
Member
 
Tarang
Join Date: Feb 2011
Location: Delhi, India
Posts: 47
Rep Power: 15
gtarang is on a distinguished road
The variable alpha1_ will not be found directly as you are using. It is there in the memory but not in the .C or .H file in which you are calling.


First you have to search for the variable and then load it. Here you can go ahead in this direction:


Code:
volScalarField liquidFraction = this->mesh_.objectRegistry::lookupObject<volScalarField> ("sMS1:alpha1");

You may have to tweak the above code a bit to match the variable names present in the file.


You may also look at the documentation of chtmultiregionfoam on cpp.openfoam.org.


-gtarang
gtarang is offline   Reply With Quote

Old   April 10, 2019, 04:33
Default
  #24
New Member
 
Anna
Join Date: Feb 2019
Posts: 17
Rep Power: 7
iconde is on a distinguished road
Thank you very much!

I've fixed the problem changing a little bit your function:

Quote:
const volScalarField& liquidFraction = mesh.lookupObject<volScalarField>("sMS1:alpha1");
Thanks!!!!
gtarang likes this.
iconde is offline   Reply With Quote

Old   May 26, 2021, 02:42
Default liquid fraction update
  #25
Member
 
Join Date: Nov 2020
Posts: 53
Rep Power: 5
mikulo is on a distinguished road
Quote:
Originally Posted by gtarang View Post
Hi,
I have been using solidificationMeltingSource as prescribed by you. Other than simple problems the solver fails and typically gives floating point exception error and runs for CFL no 0.1 or less for fine meshes.
I dug into the code and found that energy equation needs to be solved multiple times to actually correct the step function of liquid fraction as can be seen from the algorithm of Voller and Prakash (1987) http://dx.doi.org/10.1016/0017-9310(87)90317-6. I tried doing it by putting nEnergyCorrectors in PIMPLE dictionary and solving the energy equation n times. While I was debugging the code, I found this in solidificationMeltingSource.C line no 145.

Code:
if (curTimeIndex_ == mesh_.time().timeIndex())
    {
        return;
    }
Now according to my understanding, the above code ensures that the liquid fraction is updated only once and found it also. Can anyone suggest what can be the consequences of removing above bit of code.

Thanks
-
Tarang
Hello Tarang,

I have asked that same question too, seems like you are a mile ahead of me in PCM. I have seen your code too, where you remove the snippet above? May I ask, how was your result? Is there any change? It seems like mine is blowing up..

Thanks..

Last edited by mikulo; May 26, 2021 at 06:39.
mikulo is offline   Reply With Quote

Old   June 4, 2021, 01:38
Default
  #26
Member
 
Tarang
Join Date: Feb 2011
Location: Delhi, India
Posts: 47
Rep Power: 15
gtarang is on a distinguished road
I didn't remove that code. That code ensures that liquid fraction is updated only once in a timestep.


-Tarang
gtarang is offline   Reply With Quote

Old   June 4, 2021, 05:55
Default
  #27
Member
 
Join Date: Nov 2020
Posts: 53
Rep Power: 5
mikulo is on a distinguished road
Hello Tarang,

Yes, I understand you. However, if it is updated only once, then the liquid fraction is not corrected, right?Thus, I removed it and make some changes a little bit at the top level.
mikulo is offline   Reply With Quote

Old   November 18, 2023, 14:21
Default
  #28
New Member
 
Akshay Ghorpade
Join Date: Aug 2023
Location: Delhi , India
Posts: 1
Rep Power: 0
Akshay_Ghorpade is on a distinguished road
Hi Anna


In solidificationandMelting Source files (.C and .H) I am unable to understand the placement of this piece of code.



const volScalarField& liquidFraction = mesh.lookupObject<volScalarField>("sMS1:alpha1");

Last edited by Akshay_Ghorpade; November 18, 2023 at 14:25. Reason: Didn't write the complete information
Akshay_Ghorpade is offline   Reply With Quote

Old   April 11, 2024, 07:19
Default chtMultiRegionFoam with solidificationMeltingSource
  #29
New Member
 
Kevin Redosado
Join Date: Jul 2022
Posts: 2
Rep Power: 0
kredosado is on a distinguished road
Hi, I can run the case with bouyantFoam but when I try to use chtMultiRegionFoam the fvOptions "solidificationMeltingSource" does not work. Does anyone know why?
kredosado is offline   Reply With Quote

Old   April 11, 2024, 20:41
Default
  #30
Member
 
Join Date: Nov 2020
Posts: 53
Rep Power: 5
mikulo is on a distinguished road
Quote:
Originally Posted by kredosado View Post
Hi, I can run the case with bouyantFoam but when I try to use chtMultiRegionFoam the fvOptions "solidificationMeltingSource" does not work. Does anyone know why?
It will work, use the fvOptions for fluid region. Can I see your test case?
mikulo is offline   Reply With Quote

Reply

Tags
melting, phase change


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
Is Playstation 3 cluster suitable for CFD work hsieh OpenFOAM 9 August 16, 2015 14:53
MRFSimpleFoam wind turbine case diverges ysh1227 OpenFOAM Running, Solving & CFD 2 May 7, 2015 10:13
Superlinear speedup in OpenFOAM 13 msrinath80 OpenFOAM Running, Solving & CFD 18 March 3, 2015 05:36
Transient case running with a super computer microfin FLUENT 0 March 31, 2009 11:20
Turbulent Flat Plate Validation Case Jonas Larsson Main CFD Forum 0 April 2, 2004 10:25


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