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

DTCHull Ship Resistance Tutorial - Morphing vs Overset Dynamic Mesh

Register Blogs Community New Posts Updated Threads Search

Like Tree1Likes

Reply
 
LinkBack Thread Tools Search this Thread Display Modes
Old   August 13, 2022, 13:00
Default DTCHull Ship Resistance Tutorial - Morphing vs Overset Dynamic Mesh
  #1
New Member
 
Nick
Join Date: Dec 2021
Posts: 15
Rep Power: 5
myozinaung is on a distinguished road
Hello everyone,

This is my first time posting a question on this forum.

Normally, ship resistance tests do not require an overset mesh for the dynamic mesh. Even for a planning hull, a morphing mesh approach is sufficient. DTCHullMoving tutorial from "multiphase/interFoam/RAS" uses that approach.

When I was running resistance simulations (2DOF, free pitch and heave) in shallow water, I found that there is not enough room for mesh morphing below the ship hull in certain cases where the trim and sinkage are significant. Some of the cells get squeezed until their volumes become essentially zero leading to the simulation divergence. Adjusting mesh morphing diffusivity method and morphing range (innerDistance and outterDistance) can help in some cases, but it does not solve the whole problem. Different adjustments might be needed for different ship speeds depending on the sinkage and trim history. This kind of problem is more likely to happen when a finer mesh is used.

To solve that, I wanted to test the overset mesh approach. I modified the DTCHullMoving tutorial for overset mesh by combining it with rigidBodyHull tutorial from the overInterDyMFoam. I was successfully able to run the simulation. The resistance convergence histories are attached. The total resistance values are similar for all DTCHull, DTCHullMoving and DTCHullMovingOverset (mine). But, the pressure and viscous components of Overset version is different from the those of DTCHull and DTCHullMoving.

My question is: Why are they different? Forces calculation/decomposition method in overset mesh is different from the normal one?

If you are interested in the case files, I will upload them.
Attached Images
File Type: jpg DTCHullFixed.jpg (142.6 KB, 174 views)
File Type: jpg DTCHullMoving.jpg (137.5 KB, 141 views)
File Type: jpg DTCHullMovingOverset.jpg (146.7 KB, 136 views)
myozinaung is offline   Reply With Quote

Old   September 1, 2022, 16:03
Default
  #2
New Member
 
Join Date: Oct 2014
Location: Lafayette, LA
Posts: 18
Rep Power: 12
gigliagarf is on a distinguished road
Hello myozinaung, can you post your case files so we can go over them? That might help to determine the differences.
gigliagarf is offline   Reply With Quote

Old   September 15, 2022, 09:38
Default
  #3
New Member
 
Nick
Join Date: Dec 2021
Posts: 15
Rep Power: 5
myozinaung is on a distinguished road
The problem is now resolved. The resistance values are similar for both morphing and overset cases.
If you are interested in the case files, check the link below.

https://github.com/myozinaung/DTCMoving_Overset
myozinaung is offline   Reply With Quote

Old   September 25, 2022, 22:04
Default
  #4
New Member
 
Join Date: Oct 2014
Location: Lafayette, LA
Posts: 18
Rep Power: 12
gigliagarf is on a distinguished road
Happy to hear things are better for you! I found this document which outlines best practices for overset, maybe it would be of use to you if you do some larger motions. I found the tutorials for overset had different values for the fvSolution dictionary than what these guys are recommending. http://www.wolfdynamics.com/training...s_2021_OF8.pdf
gigliagarf is offline   Reply With Quote

Old   October 6, 2022, 07:38
Default
  #5
New Member
 
Akram P A
Join Date: Apr 2020
Location: Kochi - India
Posts: 15
Rep Power: 6
simucentral is on a distinguished road
Hi,
If you could throw some light on how the problem got resolved, that will really be a great insight. in the snapshots you uploaded earlier, we see, even though the total resistance is similar, the pressure and viscous components are showing significant differences.
Thanks and regards.
akram
simucentral is offline   Reply With Quote

Old   October 6, 2022, 10:59
Default
  #6
New Member
 
Nick
Join Date: Dec 2021
Posts: 15
Rep Power: 5
myozinaung is on a distinguished road
Hello,

Previously I used the solver settings (fvSolution and fvSchemes) from the rigidBodyHull tutorial because that is the overset mesh tutorial with a ship and propeller. The problem is the solver settings are not suitable for the resistance calculation. So I modified the solver settings to match the original DTCHullMoving tutorial settings which are set up for the resistance calculation.
The new results are attached for your reference.

Regards,
Myo
Attached Images
File Type: jpg DTCMoving_Overset_Resolved.jpg (96.7 KB, 100 views)
myozinaung is offline   Reply With Quote

Old   October 6, 2022, 11:04
Default
  #7
New Member
 
Akram P A
Join Date: Apr 2020
Location: Kochi - India
Posts: 15
Rep Power: 6
simucentral is on a distinguished road
Thank you so much for the quick reply.
I shall check that. Are you working in Openfoam.com or openfoam.org?
Thanks and regards,
akram
simucentral is offline   Reply With Quote

Old   October 6, 2022, 11:12
Default
  #8
New Member
 
Nick
Join Date: Dec 2021
Posts: 15
Rep Power: 5
myozinaung is on a distinguished road
I used OpenFOAM v2206 (openfoam.com).
simucentral likes this.
myozinaung is offline   Reply With Quote

Old   December 9, 2022, 18:44
Default trying to run the DTCMoving_Overset case (from git )
  #9
ibe
New Member
 
Join Date: Oct 2022
Posts: 11
Rep Power: 4
ibe is on a distinguished road
Hello,

I'm trying to run DTCMoving_Overset case (from git )



I running into some glitches.



The Allrun and Allclean scripts call for these scripts that aren't available..:
DTCMoving_Overset/background/restore0Dir
DTCMoving_Overset/hull/cleanCase0




Also,

I'm trying to recreate the results in the youtube tutorial

Ship resistance prediction (Luofeng Huang, UCL)

At around 36:43 of the video Dr. Huang references an .xls output file.
i've poked through a bunch of controlDict files and I can't find a useful example of how to export to an .xls file. Any suggestions ?


Thank you,
ibe is offline   Reply With Quote

Old   December 9, 2022, 19:01
Default
  #10
New Member
 
Nick
Join Date: Dec 2021
Posts: 15
Rep Power: 5
myozinaung is on a distinguished road
Which version of OpenFOAM are you using? Foundation or ESI?
Only ESI support the overset mesh.

restore0Dir and cleanCase0 are tutorial-run functions and they come with OpenFOAM installation (ESI version).
At the top of the Allrun scripts in "background" and "hull" folder you will see the following line:

. ${WM_PROJECT_DIR:?}/bin/tools/RunFunctions

It allows to use tutorial-run functions like restore0Dir and cleanCase0.

I think Dr. Huang converts the forces.dat file to .xls file manually.
You can find forces.dat file in the "postprocessing" folder during running simulation. It is generated by the forces function defined in the ControlDict
myozinaung is offline   Reply With Quote

Old   December 10, 2022, 13:06
Default
  #11
ibe
New Member
 
Join Date: Oct 2022
Posts: 11
Rep Power: 4
ibe is on a distinguished road
Hello,

I just installed this version
https://www.openfoam.com/news/main-n...rs-and-physics

which I believe is the ESI enabled version.



the scripts were found by correctly setting
WM_PROJECT_DIR='/opt/openfoam';
and

export PATH=$PATH:'/opt/openfoam/bin/tools';



I now have 3 different "DTC" cases:
DTCHull DTCHullMoving DTCMoving_Overset
all seem to run the Allclean + Allrun sequence
but I can't find any forces.dat file in any of these dirs..



Still poking around for clues.
Thank you,
ibe is offline   Reply With Quote

Old   December 10, 2022, 13:15
Default
  #12
New Member
 
Nick
Join Date: Dec 2021
Posts: 15
Rep Power: 5
myozinaung is on a distinguished road
forces.dat file should be in the dir: "DTCHullMoving\postProcessing\forces\0\forces. dat"

"postProcessing" folder will appear in the case dir when you start running the simulation and finish the first time step. It may take some time to complete the first time step.
myozinaung is offline   Reply With Quote

Old   December 10, 2022, 13:26
Default
  #13
ibe
New Member
 
Join Date: Oct 2022
Posts: 11
Rep Power: 4
ibe is on a distinguished road
your time on this is most appreciated.

Any suggestions are welcome...







Here's the log from the Allrun

and below that is the controldict

nothing seems out of place...

using the unix command

>> find -name 'force*' yields nothing

and there is no postprocessing folder or obvious warnings or errors.





(base) ie@ie-OptiPlex-9020:~/S/CODE/OPENFOAM22/DTCHullMoving$ ./Allclean
Cleaning case /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
(base) ie@ie-OptiPlex-9020:~/S/CODE/OPENFOAM22/DTCHullMoving$ ./Allrun
Running surfaceFeatureExtract on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Running blockMesh on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Running topoSet on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Running refineMesh on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Running topoSet on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Running refineMesh on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Running topoSet on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Running refineMesh on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Running topoSet on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Running refineMesh on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Running topoSet on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Running refineMesh on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Running topoSet on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Running refineMesh on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Running snappyHexMesh on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Restore 0/ from 0.orig/
Running setFields on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Running decomposePar on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Running renumberMesh (8 processes) on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Running interFoam (8 processes) on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
Running reconstructPar on /home/ie/S/CODE/OPENFOAM22/DTCHullMoving
(base) ie@ie-OptiPlex-9020:~/S/CODE/OPENFOAM22/DTCHullMoving$





========== controldict ==========
/*--------------------------------*- C++ -*----------------------------------*\
| ========= | |
| \\ / F ield | OpenFOAM: The Open Source CFD Toolbox |
| \\ / O peration | Version: v2206 |
| \\ / A nd | Website: www.openfoam.com |
| \\/ M anipulation | |
\*---------------------------------------------------------------------------*/
FoamFile
{
version 2.0;
format ascii;
class dictionary;
object controlDict;
}
// * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * //

application interFoam;

startFrom startTime;

startTime 0;

stopAt endTime;

endTime 35;

deltaT 0.0001;

writeControl adjustable;

writeInterval 1;

purgeWrite 0;

writeFormat binary;

writePrecision 6;

writeCompression off;

timeFormat general;

timePrecision 6;

runTimeModifiable yes;

adjustTimeStep yes;

maxCo 25;

maxAlphaCo 15;

maxDeltaT 0.05;

functions
{
forces
{
type forces;
libs (forces);
patches (hull);
rhoInf 998.8;
log on;
writeControl timeStep;
writeInterval 1;
CofR (2.929541 0 0.2);
}
}


// ************************************************** *********************** //
ibe is offline   Reply With Quote

Old   December 10, 2022, 13:39
Default
  #14
New Member
 
Nick
Join Date: Dec 2021
Posts: 15
Rep Power: 5
myozinaung is on a distinguished road
Please check the log.interFoam file and see the simulation ran successfully.
It should be inside the "/home/ie/S/CODE/OPENFOAM22/DTCHullMoving".

If there are errors inside the log.interFoam, you should check the other log files above. such as log.decomposePar, log.setField, etc.

Those log file should be in your case dir if you run the Allrun without any modification. Tutorial run function "runApplication" will generate those log files.
myozinaung is offline   Reply With Quote

Old   December 10, 2022, 17:45
Default
  #15
ibe
New Member
 
Join Date: Oct 2022
Posts: 11
Rep Power: 4
ibe is on a distinguished road
that was a very helpful suggestion.



quoting from log.interfoam . .



so I need to learn how to change the call to interfoam.



The other log files didn't have errors that I could see.



Thank you,







======== log.interfoam =====

--------------------------------------------------------------------------
There are not enough slots available in the system to satisfy the 8
slots that were requested by the application:

interFoam

Either request fewer slots for your application, or make more slots
available for use.

A "slot" is the Open MPI term for an allocatable unit where we can
launch a process. The number of slots available are defined by the
environment in which Open MPI processes are run:

1. Hostfile, via "slots=N" clauses (N defaults to number of
processor cores if not provided)
2. The --host command line parameter, via a ":N" suffix on the
hostname (N defaults to 1 if not provided)
3. Resource manager (e.g., SLURM, PBS/Torque, LSF, etc.)
4. If none of a hostfile, the --host command line parameter, or an
RM is present, Open MPI defaults to the number of processor cores

In all the above cases, if you want Open MPI to default to the number
of hardware threads instead of the number of processor cores, use the
--use-hwthread-cpus option.

Alternatively, you can use the --oversubscribe option to ignore the
number of available slots when deciding the number of processes to
launch.
--------------------------------------------------------------------------
ibe is offline   Reply With Quote

Old   December 10, 2022, 17:53
Default
  #16
New Member
 
Nick
Join Date: Dec 2021
Posts: 15
Rep Power: 5
myozinaung is on a distinguished road
In the decomposeParDict, the no. of subdomain is 8. You need 8 cores/threads to run interFoam. If you don't have enough cores/threads on your system, use a lower number for subdomain.
myozinaung is offline   Reply With Quote

Old   December 10, 2022, 19:01
Default
  #17
ibe
New Member
 
Join Date: Oct 2022
Posts: 11
Rep Power: 4
ibe is on a distinguished road
My system has four cores.
https://www.dicytrends.com/optiplex-...pecifications/


Assuming that translates to supporting four subdomains,

I first tried

numberOfSubdomains 4;
and

then

numberOfSubdomains 1;
in decomposeParDict


I've attached the corresponding log.interfoam files,

and will poke through the forums in search of solutions.

Any suggestions or references which sacrifice parallelism or speed i.o.t. run more reliably would be most appreciated.
Attached Files
File Type: txt log.interfoam_NOS_1.txt (2.2 KB, 7 views)
File Type: txt log.interfoam_NOS_4.txt (1.9 KB, 3 views)
ibe is offline   Reply With Quote

Old   December 12, 2022, 12:12
Default
  #18
ibe
New Member
 
Join Date: Oct 2022
Posts: 11
Rep Power: 4
ibe is on a distinguished road
Here's another thread that addresses some of the problems I'm seeing.


https://www.cfd-online.com/Forums/op...ubdomains-not-
equals-number-processors.html
ibe is offline   Reply With Quote

Old   December 12, 2022, 12:18
Default
  #19
Senior Member
 
Yann
Join Date: Apr 2012
Location: France
Posts: 1,236
Rep Power: 29
Yann will become famous soon enoughYann will become famous soon enough
Did you run decomposePar again after modifying decomposeParDict?

Code:
decomposePar -force
Yann
Yann is offline   Reply With Quote

Old   December 12, 2022, 12:32
Default
  #20
ibe
New Member
 
Join Date: Oct 2022
Posts: 11
Rep Power: 4
ibe is on a distinguished road
Hi,



I'm just rerunning the Allrun script which has this excerpt


# runApplication decomposePar
runParallel -s decompose redistributePar -decompose


I precede that call with Allclean - which wipes out all the intermediate result dirs so I believe that accomplishes the -force intent.




That other thread gave me the info on the subdomains necessary (it seems) to make runs and start looking at force output.

progress!



thanks
ibe 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
Combining multiSolidBodyMotionSolver (Overset Mesh) + SolidBodyDisplacementLaplacian egebat7 OpenFOAM Running, Solving & CFD 4 September 12, 2023 22:38
foam-extend-4.1 release hjasak OpenFOAM Announcements from Other Sources 19 July 16, 2021 06:02
dynamic mesh tutorial files for fluent hesham ANSYS 0 February 2, 2016 20:51
[snappyHexMesh] No layers in a small gap bobburnquist OpenFOAM Meshing & Mesh Conversion 6 August 26, 2015 10:38
Icemcfd 11: Loss of mesh from surface mesh option? Joe CFX 2 March 26, 2007 19:10


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